2 ; # ---------------------------------------------------------------------
4 ; # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 ; # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 ; # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 ; # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
10 ; # This software is governed by the CeCILL-B license under French law and
11 ; # abiding by the rules of distribution of free software. You can use,
12 ; # modify and/ or redistribute the software under the terms of the CeCILL-B
13 ; # license as circulated by CEA, CNRS and INRIA at the following URL
14 ; # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 ; # or in the file LICENSE.txt.
17 ; # As a counterpart to the access to the source code and rights to copy,
18 ; # modify and redistribute granted by the license, users are provided only
19 ; # with a limited warranty and the software's author, the holder of the
20 ; # economic rights, and the successive licensors have only limited
23 ; # The fact that you are presently reading this means that you have had
24 ; # knowledge of the CeCILL-B license and that you accept its terms.
25 ; # ------------------------------------------------------------------------ */
27 ;=============================================================================
28 ; bbs-mode.el = Emacs major mode for editing bbi script files (.bbs).
30 ; Add bbs listfile names to the mode list.
33 '(("\\.bbs\\'" . bbs-mode))
35 ; Note, add the above setq auto-mode-alist to your .emacs
36 ; along with the following to have the mode loaded when
37 ; a *.mac file is loaded in emacs.
38 ; (autoload 'bbs-mode "bbs-mode.el" t)
40 ; Default indentation increment.
41 (defvar bbs-tab-width 2)
43 ; Define keyword highlighting.
44 (defconst bbs-font-lock-defaults
74 "Highlighting expressions for bbs mode.")
77 ; Define a variable to hold the syntax table.
78 (defvar bbs-mode-syntax-table nil "Syntax table for bbs-mode.")
80 ; If bbs mode file is reloaded, we want the syntax table to be
81 ; regenerated when bbs-mode is called.
82 (setq bbs-mode-syntax-table nil)
84 ; Let users hook to bbs mode.
85 (defvar bbs-mode-hook nil)
87 ; Mode startup function.
89 "Major mode for editing bbtk script files (.bbs)."
91 (kill-all-local-variables)
92 (setq major-mode 'bbs-mode)
93 (setq mode-name "bbs")
94 ; Create the syntax table
95 (setq bbs-mode-syntax-table (make-syntax-table))
96 (set-syntax-table bbs-mode-syntax-table)
97 (modify-syntax-entry ?_ "w" bbs-mode-syntax-table)
98 (modify-syntax-entry ?\( "()" bbs-mode-syntax-table)
99 (modify-syntax-entry ?\) ")(" bbs-mode-syntax-table)
100 (modify-syntax-entry ?# "<" bbs-mode-syntax-table)
101 (modify-syntax-entry ?\n ">" bbs-mode-syntax-table)
103 ; Setup font-lock mode.
104 (make-local-variable 'font-lock-defaults)
105 (setq font-lock-defaults '(bbs-font-lock-defaults))
107 ; Setup comment syntax.
108 (make-local-variable 'comment-start)
109 (setq comment-start "#")
111 (run-hooks 'bbs-mode-hook))
113 ; This file provides bbs-mode.