Commit | Line | Data |
---|---|---|
d8677156 | 1 | ;;; generic-x.el --- Extra Modes for generic-mode |
ca1e63a5 | 2 | |
d8677156 | 3 | ;; Copyright (C) 1997, 1998, 2003, 2005 Free Software Foundation, Inc. |
ca1e63a5 RS |
4 | |
5 | ;; Author: Peter Breton <pbreton@cs.umb.edu> | |
6 | ;; Created: Tue Oct 08 1996 | |
7 | ;; Keywords: generic, comment, font-lock | |
8 | ||
9 | ;; This file is part of GNU Emacs. | |
10 | ||
11 | ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 | ;; it under the terms of the GNU General Public License as published by | |
13 | ;; the Free Software Foundation; either version 2, or (at your option) | |
14 | ;; any later version. | |
15 | ||
16 | ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 | ;; GNU General Public License for more details. | |
20 | ||
21 | ;; You should have received a copy of the GNU General Public License | |
22 | ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
23 | ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
24 | ;; Boston, MA 02111-1307, USA. | |
25 | ||
26 | ;;; Commentary: | |
27 | ;; | |
28 | ;; This file contains some pre-defined generic-modes. | |
ffe0c7ef | 29 | ;; |
ca1e63a5 RS |
30 | ;; INSTALLATION: |
31 | ;; | |
32 | ;; Add this line to your .emacs file: | |
33 | ;; | |
34 | ;; (require 'generic-x) | |
35 | ;; | |
36 | ;; You can decide which modes to load by setting the variable | |
d8677156 | 37 | ;; `generic-extras-enable-list'. Some platform-specific modes are |
ca1e63a5 RS |
38 | ;; affected by the variables `generic-define-mswindows-modes' and |
39 | ;; `generic-define-unix-modes' (which see). | |
ffe0c7ef | 40 | ;; |
ca1e63a5 RS |
41 | ;; You can also send in new modes; if the file types a reasonably common, |
42 | ;; we would like to install them. | |
43 | ;; | |
44 | ;; PROBLEMS WHEN USED WITH FOLDING MODE: | |
45 | ;; | |
762f539b DL |
46 | ;; [The following relates to the obsolete selective-display technique. |
47 | ;; Folding mode should use invisible text properties instead. -- Dave | |
48 | ;; Love] | |
49 | ;; | |
ca1e63a5 | 50 | ;; From Anders Lindgren <andersl@csd.uu.se> |
ffe0c7ef | 51 | ;; |
ca1e63a5 RS |
52 | ;; Problem summary: Wayne Adams has found a problem when using folding |
53 | ;; mode in conjuction with font-lock for a mode defined in | |
54 | ;; `generic-x.el'. | |
55 | ;; | |
56 | ;; The problem, as Wayne described it, was that error messages of the | |
57 | ;; following form appeared when both font-lock and folding are used: | |
ffe0c7ef | 58 | ;; |
ca1e63a5 RS |
59 | ;; > - various msgs including "Fontifying region...(error Stack |
60 | ;; > overflow in regexp matcher)" appear | |
ffe0c7ef | 61 | ;; |
ca1e63a5 RS |
62 | ;; I have just tracked down the cause of the problem. The regexp:s in |
63 | ;; `generic-x.el' does not take into account the way that folding | |
64 | ;; hides sections of the buffer. The technique is known as | |
65 | ;; `selective-display' and has been available for a very long time (I | |
66 | ;; started using it back in the good old' Emacs 18 days). Basically, a | |
67 | ;; section is hidden by creating one very long line were the newline | |
68 | ;; character (C-j) is replaced by a linefeed (C-m) character. | |
ffe0c7ef | 69 | ;; |
ca1e63a5 RS |
70 | ;; Many other hiding packages, besides folding, use the same technique, |
71 | ;; the problem should occur when using them as well. | |
ffe0c7ef | 72 | ;; |
ca1e63a5 RS |
73 | ;; The erroronous lines in `generic-extras' look like the following (this |
74 | ;; example is from the `ini' section): | |
ffe0c7ef PB |
75 | ;; |
76 | ;; '(("^\\(\\[.*\\]\\)" 1 'font-lock-constant-face) | |
ca1e63a5 | 77 | ;; ("^\\(.*\\)=" 1 'font-lock-variable-name-face) |
ffe0c7ef | 78 | ;; |
ca1e63a5 RS |
79 | ;; The intention of these lines is to highlight lines of the following |
80 | ;; form: | |
ffe0c7ef | 81 | ;; |
ca1e63a5 RS |
82 | ;; [foo] |
83 | ;; bar = xxx | |
ffe0c7ef | 84 | ;; |
ca1e63a5 RS |
85 | ;; However, since the `.' regexp symbol match the linefeed character the |
86 | ;; entire folded section is searched, resulting in a regexp stack | |
87 | ;; overflow. | |
ffe0c7ef | 88 | ;; |
ca1e63a5 RS |
89 | ;; Solution suggestion 2: Instead of using ".", use the sequence |
90 | ;; "[^\n\r]". This will make the rules behave just as before, but they | |
91 | ;; will work together with selective-display. | |
92 | ||
93 | ;;; Code: | |
94 | ||
ca1e63a5 RS |
95 | (require 'font-lock) |
96 | ||
ef1c5063 RS |
97 | (defgroup generic-x nil |
98 | "Extra modes for generic mode." | |
99 | :prefix "generic-" | |
10714c98 DN |
100 | :group 'generic |
101 | :version "20.3") | |
ef1c5063 | 102 | |
ca1e63a5 RS |
103 | (defcustom generic-extras-enable-list nil |
104 | "*List of generic modes to enable by default. | |
d8677156 LK |
105 | Each entry in the list should be a symbol. The variables |
106 | `generic-define-mswindows-modes' and `generic-define-unix-modes' | |
107 | also affect which generic modes are defined. Please note that if | |
108 | you set this variable after generic-x is loaded, you must reload | |
109 | generic-x to enable the specified modes." | |
ca1e63a5 | 110 | :group 'generic-x |
d8677156 | 111 | :type '(repeat sexp)) |
ca1e63a5 | 112 | |
ffe0c7ef | 113 | (defcustom generic-define-mswindows-modes |
d8677156 | 114 | (memq system-type '(windows-nt ms-dos)) |
ca1e63a5 RS |
115 | "*If non-nil, some MS-Windows specific generic modes will be defined." |
116 | :group 'generic-x | |
d8677156 | 117 | :type 'boolean) |
ca1e63a5 RS |
118 | |
119 | (defcustom generic-define-unix-modes | |
d8677156 | 120 | (not (memq system-type '(windows-nt ms-dos))) |
ca1e63a5 RS |
121 | "*If non-nil, some Unix specific generic modes will be defined." |
122 | :group 'generic-x | |
d8677156 | 123 | :type 'boolean) |
ca1e63a5 RS |
124 | |
125 | (and generic-define-mswindows-modes | |
d8677156 | 126 | (setq generic-extras-enable-list |
82e38f3e LK |
127 | (append '(bat-generic-mode |
128 | ini-generic-mode | |
129 | inf-generic-mode | |
130 | rc-generic-mode | |
131 | reg-generic-mode | |
132 | rul-generic-mode | |
133 | hosts-generic-mode | |
134 | apache-conf-generic-mode | |
135 | apache-log-generic-mode) | |
d8677156 | 136 | generic-extras-enable-list))) |
ca1e63a5 RS |
137 | |
138 | (and generic-define-unix-modes | |
139 | (setq generic-extras-enable-list | |
82e38f3e LK |
140 | (append '(apache-conf-generic-mode |
141 | apache-log-generic-mode | |
142 | samba-generic-mode | |
143 | hosts-generic-mode | |
144 | fvwm-generic-mode | |
145 | x-resource-generic-mode | |
146 | alias-generic-mode | |
147 | inetd-conf-generic-mode | |
148 | etc-services-generic-mode | |
149 | etc-passwd-generic-mode | |
150 | etc-fstab-generic-mode) | |
ca1e63a5 RS |
151 | generic-extras-enable-list))) |
152 | ||
153 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
154 | ;; Generic-modes | |
155 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
156 | ||
157 | ;;; Apache | |
d8677156 LK |
158 | (when (memq 'apache-conf-generic-mode generic-extras-enable-list) |
159 | ||
160 | (define-generic-mode apache-conf-generic-mode | |
82e38f3e | 161 | '(?#) |
d8677156 | 162 | nil |
82e38f3e LK |
163 | '(("^\\s-*\\(<.*>\\)" 1 font-lock-constant-face) |
164 | ("^\\s-*\\(\\sw+\\)\\s-" 1 font-lock-variable-name-face)) | |
165 | '("srm\\.conf\\'" "httpd\\.conf\\'" "access\\.conf\\'") | |
d8677156 LK |
166 | (list |
167 | (function | |
168 | (lambda () | |
ffe0c7ef PB |
169 | (setq imenu-generic-expression |
170 | '((nil "^\\([-A-Za-z0-9_]+\\)" 1) | |
171 | ("*Directories*" "^\\s-*<Directory\\s-*\\([^>]+\\)>" 1) | |
d8677156 LK |
172 | ("*Locations*" "^\\s-*<Location\\s-*\\([^>]+\\)>" 1)))))) |
173 | "Generic mode for Apache or HTTPD configuration files.")) | |
ffe0c7ef | 174 | |
d8677156 | 175 | (when (memq 'apache-log-generic-mode generic-extras-enable-list) |
ffe0c7ef | 176 | |
d8677156 | 177 | (define-generic-mode apache-log-generic-mode |
ffe0c7ef PB |
178 | nil |
179 | nil | |
180 | ;; Hostname ? user date request return-code number-of-bytes | |
181 | '(("^\\([-a-zA-z0-9.]+\\) - [-A-Za-z]+ \\(\\[.*\\]\\)" | |
182 | (1 font-lock-constant-face) | |
d8677156 | 183 | (2 font-lock-variable-name-face))) |
82e38f3e | 184 | '("access_log\\'") |
ffe0c7ef PB |
185 | nil |
186 | "Mode for Apache log files")) | |
187 | ||
ca1e63a5 | 188 | ;;; Samba |
d8677156 LK |
189 | (when (memq 'samba-generic-mode generic-extras-enable-list) |
190 | ||
191 | (define-generic-mode samba-generic-mode | |
82e38f3e | 192 | '(?\; ?#) |
d8677156 | 193 | nil |
82e38f3e | 194 | '(("^\\(\\[.*\\]\\)" 1 font-lock-constant-face) |
d8677156 | 195 | ("^\\s-*\\(.+\\)=\\([^\r\n]*\\)" |
82e38f3e LK |
196 | (1 font-lock-variable-name-face) |
197 | (2 font-lock-type-face))) | |
198 | '("smb\\.conf\\'") | |
199 | '(generic-bracket-support) | |
d8677156 | 200 | "Generic mode for Samba configuration files.")) |
ca1e63a5 RS |
201 | |
202 | ;;; Fvwm | |
203 | ;; This is pretty basic. Also, modes for other window managers could | |
204 | ;; be defined as well. | |
d8677156 | 205 | (when (memq 'fvwm-generic-mode generic-extras-enable-list) |
ca1e63a5 | 206 | |
d8677156 | 207 | (define-generic-mode fvwm-generic-mode |
82e38f3e LK |
208 | '(?#) |
209 | '("AddToMenu" | |
210 | "AddToFunc" | |
211 | "ButtonStyle" | |
212 | "EndFunction" | |
213 | "EndPopup" | |
214 | "Function" | |
215 | "IconPath" | |
216 | "Key" | |
217 | "ModulePath" | |
218 | "Mouse" | |
219 | "PixmapPath" | |
220 | "Popup" | |
221 | "Style") | |
d8677156 | 222 | nil |
82e38f3e | 223 | '("\\.fvwmrc\\'" "\\.fvwm2rc\\'") |
d8677156 LK |
224 | nil |
225 | "Generic mode for FVWM configuration files.")) | |
ca1e63a5 RS |
226 | |
227 | ;;; X Resource | |
228 | ;; I'm pretty sure I've seen an actual mode to do this, but I don't | |
229 | ;; think it's standard with Emacs | |
d8677156 | 230 | (when (memq 'x-resource-generic-mode generic-extras-enable-list) |
ca1e63a5 | 231 | |
d8677156 | 232 | (define-generic-mode x-resource-generic-mode |
82e38f3e | 233 | '(?!) |
d8677156 | 234 | nil |
82e38f3e LK |
235 | '(("^\\([^:\n]+:\\)" 1 font-lock-variable-name-face)) |
236 | '("\\.Xdefaults\\'" "\\.Xresources\\'" "\\.Xenvironment\\'" "\\.ad\\'") | |
d8677156 LK |
237 | nil |
238 | "Generic mode for X Resource configuration files.")) | |
ca1e63a5 RS |
239 | |
240 | ;;; Hosts | |
d8677156 | 241 | (when (memq 'hosts-generic-mode generic-extras-enable-list) |
ca1e63a5 | 242 | |
d8677156 | 243 | (define-generic-mode hosts-generic-mode |
82e38f3e LK |
244 | '(?#) |
245 | '("localhost") | |
246 | '(("\\([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\\)" 1 font-lock-constant-face)) | |
247 | '("[hH][oO][sS][tT][sS]\\'") | |
d8677156 LK |
248 | nil |
249 | "Generic mode for HOSTS files.")) | |
ca1e63a5 RS |
250 | |
251 | ;;; Windows INF files | |
d8677156 | 252 | (when (memq 'inf-generic-mode generic-extras-enable-list) |
ca1e63a5 | 253 | |
d8677156 | 254 | (define-generic-mode inf-generic-mode |
82e38f3e | 255 | '(?\;) |
d8677156 | 256 | nil |
82e38f3e LK |
257 | '(("^\\(\\[.*\\]\\)" 1 font-lock-constant-face)) |
258 | '("\\.[iI][nN][fF]\\'") | |
259 | '(generic-bracket-support) | |
d8677156 | 260 | "Generic mode for MS-Windows INF files.")) |
ca1e63a5 RS |
261 | |
262 | ;;; Windows INI files | |
263 | ;; Should define escape character as well! | |
d8677156 LK |
264 | (when (memq 'ini-generic-mode generic-extras-enable-list) |
265 | ||
266 | (define-generic-mode ini-generic-mode | |
82e38f3e | 267 | '(?\;) |
d8677156 | 268 | nil |
82e38f3e | 269 | '(("^\\(\\[.*\\]\\)" 1 font-lock-constant-face) |
d8677156 LK |
270 | ("^\\([^=\n\r]*\\)=\\([^\n\r]*\\)$" |
271 | (1 font-lock-function-name-face) | |
272 | (2 font-lock-variable-name-face))) | |
82e38f3e | 273 | '("\\.[iI][nN][iI]\\'") |
d8677156 LK |
274 | (list |
275 | (function | |
276 | (lambda () | |
277 | (setq imenu-generic-expression | |
278 | '((nil "^\\[\\(.*\\)\\]" 1) | |
279 | ("*Variables*" "^\\s-*\\([^=]+\\)\\s-*=" 1)))))) | |
280 | "Generic mode for MS-Windows INI files.")) | |
ca1e63a5 RS |
281 | |
282 | ;;; Windows REG files | |
283 | ;;; Unfortunately, Windows 95 and Windows NT have different REG file syntax! | |
d8677156 LK |
284 | (when (memq 'reg-generic-mode generic-extras-enable-list) |
285 | ||
286 | (define-generic-mode reg-generic-mode | |
287 | '(?\;) | |
288 | '("key" "classes_root" "REGEDIT" "REGEDIT4") | |
82e38f3e LK |
289 | '(("\\(\\[.*]\\)" 1 font-lock-constant-face) |
290 | ("^\\([^\n\r]*\\)\\s-*=" 1 font-lock-variable-name-face)) | |
d8677156 LK |
291 | '("\\.[rR][eE][gG]\\'") |
292 | (list | |
293 | (function | |
294 | (lambda () | |
295 | (setq imenu-generic-expression | |
296 | '((nil "^\\s-*\\(.*\\)\\s-*=" 1)))))) | |
297 | "Generic mode for MS-Windows Registry files.")) | |
ca1e63a5 | 298 | |
60bdd17f | 299 | ;;; DOS/Windows BAT files |
d8677156 LK |
300 | (when (memq 'bat-generic-mode generic-extras-enable-list) |
301 | ||
302 | (define-generic-mode bat-generic-mode | |
303 | nil | |
304 | nil | |
82e38f3e | 305 | (eval-when-compile |
ca1e63a5 | 306 | (list |
82e38f3e LK |
307 | ;; Make this one first in the list, otherwise comments will |
308 | ;; be over-written by other variables | |
309 | '("^[@ \t]*\\([rR][eE][mM][^\n\r]*\\)" 1 font-lock-comment-face t) | |
310 | '("^[ \t]*\\(::.*\\)" 1 font-lock-comment-face t) | |
311 | '("^[@ \t]*\\([bB][rR][eE][aA][kK]\\|[vV][eE][rR][iI][fF][yY]\\)[ \t]+\\([oO]\\([nN]\\|[fF][fF]\\)\\)" | |
312 | (1 font-lock-builtin-face) | |
313 | (2 font-lock-constant-face t t)) | |
314 | ;; Any text (except ON/OFF) following ECHO is a string. | |
315 | '("^[@ \t]*\\([eE][cC][hH][oO]\\)[ \t]+\\(\\([oO]\\([nN]\\|[fF][fF]\\)\\)\\|\\([^>|\r\n]+\\)\\)" | |
316 | (1 font-lock-builtin-face) | |
317 | (3 font-lock-constant-face t t) | |
318 | (5 font-lock-string-face t t)) | |
319 | ;; These keywords appear as the first word on a line. (Actually, they | |
320 | ;; can also appear after "if ..." or "for ..." clause, but since they | |
321 | ;; are frequently used in simple text, we punt.) | |
322 | ;; In `generic-bat-mode-setup-function' we make the keywords | |
323 | ;; case-insensitive | |
324 | (generic-make-keywords-list | |
325 | '("for" | |
326 | "if") | |
327 | 'font-lock-keyword-face "^[@ \t]*") | |
328 | ;; These keywords can be anywhere on a line | |
329 | ;; In `generic-bat-mode-setup-function' we make the keywords | |
330 | ;; case-insensitive | |
331 | (generic-make-keywords-list | |
332 | '("do" | |
333 | "exist" | |
334 | "errorlevel" | |
335 | "goto" | |
336 | "not") | |
337 | 'font-lock-keyword-face) | |
338 | ;; These are built-in commands. Only frequently-used ones are listed. | |
339 | (generic-make-keywords-list | |
340 | '("CALL" "call" "Call" | |
341 | "CD" "cd" "Cd" | |
342 | "CLS" "cls" "Cls" | |
343 | "COPY" "copy" "Copy" | |
344 | "DEL" "del" "Del" | |
345 | "ECHO" "echo" "Echo" | |
346 | "MD" "md" "Md" | |
347 | "PATH" "path" "Path" | |
348 | "PAUSE" "pause" "Pause" | |
349 | "PROMPT" "prompt" "Prompt" | |
350 | "RD" "rd" "Rd" | |
351 | "REN" "ren" "Ren" | |
352 | "SET" "set" "Set" | |
353 | "START" "start" "Start" | |
354 | "SHIFT" "shift" "Shift") | |
355 | 'font-lock-builtin-face "[ \t|\n]") | |
356 | '("^[ \t]*\\(:\\sw+\\)" 1 font-lock-function-name-face t) | |
357 | '("\\(%\\sw+%\\)" 1 font-lock-variable-name-face t) | |
358 | '("\\(%[0-9]\\)" 1 font-lock-variable-name-face t) | |
359 | '("\\(/[^/ \"\t\n]+\\)" 1 font-lock-type-face) | |
360 | '("[\t ]+\\([+-][^\t\n\" ]+\\)" 1 font-lock-type-face) | |
361 | '("[ \t\n|]\\<\\([gG][oO][tT][oO]\\)\\>[ \t]*\\(\\sw+\\)?" | |
362 | (1 font-lock-keyword-face) | |
363 | (2 font-lock-function-name-face nil t)) | |
364 | '("[ \t\n|]\\<\\([sS][eE][tT]\\)\\>[ \t]*\\(\\sw+\\)?[ \t]*=?" | |
365 | (1 font-lock-builtin-face) | |
366 | (2 font-lock-variable-name-face t t)))) | |
367 | '("\\.[bB][aA][tT]\\'" | |
368 | "\\`[cC][oO][nN][fF][iI][gG]\\." | |
369 | "\\`[aA][uU][tT][oO][eE][xX][eE][cC]\\.") | |
370 | '(generic-bat-mode-setup-function) | |
d8677156 LK |
371 | "Generic mode for MS-Windows BAT files.") |
372 | ||
373 | (defvar bat-generic-mode-syntax-table nil | |
374 | "Syntax table in use in bat-generic-mode buffers.") | |
375 | ||
376 | (defvar bat-generic-mode-keymap (make-sparse-keymap) | |
377 | "Keymap for bet-generic-mode.") | |
378 | ||
379 | (defun bat-generic-mode-compile () | |
380 | "Run the current BAT file in a compilation buffer." | |
381 | (interactive) | |
382 | (let ((compilation-buffer-name-function | |
383 | (function | |
384 | (lambda(ign) | |
385 | (concat "*" (buffer-file-name) "*"))))) | |
386 | (compile | |
387 | (concat (w32-shell-name) " -c " (buffer-file-name))))) | |
388 | ||
389 | (defun bat-generic-mode-run-as-comint () | |
390 | "Run the current BAT file in a comint buffer." | |
391 | (interactive) | |
392 | (require 'comint) | |
393 | (let* ((file (buffer-file-name)) | |
394 | (buf-name (concat "*" file "*"))) | |
395 | (save-excursion | |
396 | (set-buffer | |
397 | (get-buffer-create buf-name)) | |
398 | (erase-buffer) | |
399 | (comint-mode) | |
400 | (comint-exec | |
401 | buf-name | |
402 | file | |
403 | (w32-shell-name) | |
404 | nil | |
405 | (list "-c" file)) | |
406 | (display-buffer buf-name)))) | |
407 | ||
408 | (define-key bat-generic-mode-keymap "\C-c\C-c" 'bat-generic-mode-compile) | |
409 | ||
410 | ;; Make underscores count as words | |
411 | (unless bat-generic-mode-syntax-table | |
412 | (setq bat-generic-mode-syntax-table (make-syntax-table)) | |
82e38f3e | 413 | (modify-syntax-entry ?_ "w" bat-generic-mode-syntax-table)) |
d8677156 LK |
414 | |
415 | ;; bat-generic-mode doesn't use the comment functionality of generic-mode | |
416 | ;; because it has a three-letter comment-string, so we do it | |
417 | ;; here manually instead | |
418 | (defun generic-bat-mode-setup-function () | |
82e38f3e LK |
419 | (make-local-variable 'parse-sexp-ignore-comments) |
420 | (make-local-variable 'comment-start) | |
421 | (make-local-variable 'comment-start-skip) | |
422 | (make-local-variable 'comment-end) | |
423 | (setq imenu-generic-expression '((nil "^:\\(\\sw+\\)" 1)) | |
d8677156 | 424 | parse-sexp-ignore-comments t |
82e38f3e LK |
425 | comment-end "" |
426 | comment-start "REM " | |
427 | comment-start-skip "[Rr][Ee][Mm] *") | |
428 | (set-syntax-table bat-generic-mode-syntax-table) | |
d8677156 | 429 | ;; Make keywords case-insensitive |
82e38f3e | 430 | (setq font-lock-defaults '(generic-font-lock-defaults nil t)) |
d8677156 | 431 | (use-local-map bat-generic-mode-keymap))) |
ca1e63a5 RS |
432 | |
433 | ;;; Mailagent | |
82e38f3e LK |
434 | ;; Mailagent is a Unix mail filtering program. Anyone wanna do a |
435 | ;; generic mode for procmail? | |
d8677156 LK |
436 | (when (memq 'mailagent-rules-generic-mode generic-extras-enable-list) |
437 | ||
438 | (define-generic-mode mailagent-rules-generic-mode | |
82e38f3e LK |
439 | '(?#) |
440 | '("SAVE" "DELETE" "PIPE" "ANNOTATE" "REJECT") | |
441 | '(("^\\(\\sw+\\)\\s-*=" 1 font-lock-variable-name-face) | |
442 | ("\\s-/\\([^/]+\\)/[i, \t\n]" 1 font-lock-constant-face)) | |
443 | '("\\.rules\\'") | |
444 | '(mailagent-rules-setup-function) | |
d8677156 | 445 | "Mode for Mailagent rules files.") |
ffe0c7ef PB |
446 | |
447 | (defun mailagent-rules-setup-function () | |
d8677156 LK |
448 | (make-local-variable 'imenu-generic-expression) |
449 | (setq imenu-generic-expression | |
450 | '((nil "\\s-/\\([^/]+\\)/[i, \t\n]" 1))))) | |
ca1e63a5 RS |
451 | |
452 | ;; Solaris/Sys V prototype files | |
d8677156 LK |
453 | (when (memq 'prototype-generic-mode generic-extras-enable-list) |
454 | ||
455 | (define-generic-mode prototype-generic-mode | |
82e38f3e | 456 | '(?#) |
d8677156 LK |
457 | nil |
458 | '(("^\\([0-9]\\)?\\s-*\\([a-z]\\)\\s-+\\([A-Za-z_]+\\)\\s-+\\([^\n\r]*\\)$" | |
459 | (2 font-lock-constant-face) | |
460 | (3 font-lock-keyword-face)) | |
461 | ("^\\([a-z]\\) \\([A-Za-z_]+\\)=\\([^\n\r]*\\)$" | |
462 | (1 font-lock-constant-face) | |
463 | (2 font-lock-keyword-face) | |
464 | (3 font-lock-variable-name-face)) | |
465 | ("^\\(!\\s-*\\(search\\|include\\|default\\)\\)\\s-*\\([^\n\r]*\\)$" | |
466 | (1 font-lock-keyword-face) | |
467 | (3 font-lock-variable-name-face)) | |
468 | ("^\\(!\\s-*\\sw+\\)=\\([^\n\r]*\\)$" | |
469 | (1 font-lock-keyword-face) | |
470 | (2 font-lock-variable-name-face))) | |
82e38f3e | 471 | '("prototype\\'") |
d8677156 LK |
472 | nil |
473 | "Mode for Sys V prototype files.")) | |
ca1e63a5 RS |
474 | |
475 | ;; Solaris/Sys V pkginfo files | |
d8677156 LK |
476 | (when (memq 'pkginfo-generic-mode generic-extras-enable-list) |
477 | ||
478 | (define-generic-mode pkginfo-generic-mode | |
82e38f3e | 479 | '(?#) |
d8677156 LK |
480 | nil |
481 | '(("^\\([A-Za-z_]+\\)=\\([^\n\r]*\\)$" | |
482 | (1 font-lock-keyword-face) | |
483 | (2 font-lock-variable-name-face))) | |
82e38f3e | 484 | '("pkginfo\\'") |
d8677156 LK |
485 | nil |
486 | "Mode for Sys V pkginfo files.")) | |
ca1e63a5 RS |
487 | |
488 | ;; Javascript mode | |
ffe0c7ef | 489 | ;; Includes extra keywords from Armando Singer [asinger@MAIL.COLGATE.EDU] |
d8677156 | 490 | (define-generic-mode javascript-generic-mode |
82e38f3e LK |
491 | '("//" ("/*" . "*/")) |
492 | '("break" | |
493 | "case" | |
494 | "continue" | |
495 | "default" | |
496 | "delete" | |
497 | "do" | |
498 | "else" | |
499 | "export" | |
500 | "for" | |
501 | "function" | |
502 | "if" | |
503 | "import" | |
504 | "in" | |
505 | "new" | |
506 | "return" | |
507 | "switch" | |
508 | "this" | |
509 | "typeof" | |
510 | "var" | |
511 | "void" | |
512 | "while" | |
513 | "with" | |
514 | ;; words reserved for ECMA extensions below | |
515 | "catch" | |
516 | "class" | |
517 | "const" | |
518 | "debugger" | |
519 | "enum" | |
520 | "extends" | |
521 | "finally" | |
522 | "super" | |
523 | "throw" | |
524 | "try" | |
525 | ;; Java Keywords reserved by JavaScript | |
526 | "abstract" | |
527 | "boolean" | |
528 | "byte" | |
529 | "char" | |
530 | "double" | |
531 | "false" | |
532 | "final" | |
533 | "float" | |
534 | "goto" | |
535 | "implements" | |
536 | "instanceof" | |
537 | "int" | |
538 | "interface" | |
539 | "long" | |
540 | "native" | |
541 | "null" | |
542 | "package" | |
543 | "private" | |
544 | "protected" | |
545 | "public" | |
546 | "short" | |
547 | "static" | |
548 | "synchronized" | |
549 | "throws" | |
550 | "transient" | |
551 | "true") | |
552 | '(("^\\s-*function\\s-+\\([A-Za-z0-9_]+\\)" | |
553 | (1 font-lock-function-name-face)) | |
554 | ("^\\s-*var\\s-+\\([A-Za-z0-9_]+\\)" | |
555 | (1 font-lock-variable-name-face))) | |
556 | '("\\.js\\'") | |
ca1e63a5 | 557 | (list |
ffe0c7ef | 558 | (function |
ca1e63a5 | 559 | (lambda () |
ffe0c7ef PB |
560 | (setq imenu-generic-expression |
561 | '((nil "^function\\s-+\\([A-Za-z0-9_]+\\)" 1) | |
d8677156 | 562 | ("*Variables*" "^var\\s-+\\([A-Za-z0-9_]+\\)" 1)))))) |
ca1e63a5 RS |
563 | "Mode for JavaScript files.") |
564 | ||
565 | ;; VRML files | |
d8677156 | 566 | (define-generic-mode vrml-generic-mode |
82e38f3e LK |
567 | '(?#) |
568 | '("DEF" | |
569 | "NULL" | |
570 | "USE" | |
571 | "Viewpoint" | |
572 | "ambientIntensity" | |
573 | "appearance" | |
574 | "children" | |
575 | "color" | |
576 | "coord" | |
577 | "coordIndex" | |
578 | "creaseAngle" | |
579 | "diffuseColor" | |
580 | "emissiveColor" | |
581 | "fieldOfView" | |
582 | "geometry" | |
583 | "info" | |
584 | "material" | |
585 | "normal" | |
586 | "orientation" | |
587 | "position" | |
588 | "shininess" | |
589 | "specularColor" | |
590 | "texCoord" | |
591 | "texture" | |
592 | "textureTransform" | |
593 | "title" | |
594 | "transparency" | |
595 | "type") | |
596 | '(("USE\\s-+\\([-A-Za-z0-9_]+\\)" | |
597 | (1 font-lock-constant-face)) | |
598 | ("DEF\\s-+\\([-A-Za-z0-9_]+\\)\\s-+\\([A-Za-z0-9]+\\)\\s-*{" | |
599 | (1 font-lock-type-face) | |
600 | (2 font-lock-constant-face)) | |
601 | ("^\\s-*\\([-A-Za-z0-9_]+\\)\\s-*{" | |
602 | (1 font-lock-function-name-face)) | |
603 | ("^\\s-*\\(geometry\\|appearance\\|material\\)\\s-+\\([-A-Za-z0-9_]+\\)" | |
604 | (2 font-lock-variable-name-face))) | |
605 | '("\\.wrl\\'") | |
ca1e63a5 | 606 | (list |
ffe0c7ef | 607 | (function |
ca1e63a5 | 608 | (lambda () |
ffe0c7ef | 609 | (setq imenu-generic-expression |
ca1e63a5 | 610 | '((nil "^\\([A-Za-z0-9_]+\\)\\s-*{" 1) |
ffe0c7ef | 611 | ("*Definitions*" |
ca1e63a5 | 612 | "DEF\\s-+\\([-A-Za-z0-9_]+\\)\\s-+\\([A-Za-z0-9]+\\)\\s-*{" |
d8677156 | 613 | 1)))))) |
ca1e63a5 RS |
614 | "Generic Mode for VRML files.") |
615 | ||
616 | ;; Java Manifests | |
d8677156 | 617 | (define-generic-mode java-manifest-generic-mode |
82e38f3e LK |
618 | '(?#) |
619 | '("Name" | |
620 | "Digest-Algorithms" | |
621 | "Manifest-Version" | |
622 | "Required-Version" | |
623 | "Signature-Version" | |
624 | "Magic" | |
625 | "Java-Bean" | |
626 | "Depends-On") | |
ca1e63a5 RS |
627 | '(("^Name:\\s-+\\([^\n\r]*\\)$" |
628 | (1 font-lock-variable-name-face)) | |
629 | ("^\\(Manifest\\|Required\\|Signature\\)-Version:\\s-+\\([^\n\r]*\\)$" | |
d8677156 | 630 | (2 font-lock-constant-face))) |
82e38f3e | 631 | '("[mM][aA][nN][iI][fF][eE][sS][tT]\\.[mM][fF]\\'") |
ca1e63a5 RS |
632 | nil |
633 | "Mode for Java Manifest files") | |
634 | ||
635 | ;; Java properties files | |
d8677156 | 636 | (define-generic-mode java-properties-generic-mode |
82e38f3e | 637 | '(?! ?#) |
ca1e63a5 | 638 | nil |
82e38f3e LK |
639 | (eval-when-compile |
640 | (let ((java-properties-key | |
641 | "\\(\\([-A-Za-z0-9_\\./]\\|\\(\\\\[ =:]\\)\\)+\\)") | |
642 | (java-properties-value | |
643 | "\\([^\r\n]*\\)")) | |
644 | ;; Property and value can be separated in a number of different ways: | |
645 | ;; * whitespace | |
646 | ;; * an equal sign | |
647 | ;; * a colon | |
648 | (mapcar | |
649 | (function | |
650 | (lambda (elt) | |
651 | (list | |
652 | (concat "^" java-properties-key elt java-properties-value "$") | |
653 | '(1 font-lock-constant-face) | |
654 | '(4 font-lock-variable-name-face)))) | |
655 | ;; These are the separators | |
656 | '(":\\s-*" "\\s-+" "\\s-*=\\s-*")))) | |
ca1e63a5 | 657 | nil |
bb53e1ee RS |
658 | (list |
659 | (function | |
660 | (lambda () | |
ffe0c7ef | 661 | (setq imenu-generic-expression |
d8677156 | 662 | '((nil "^\\([^#! \t\n\r=:]+\\)" 1)))))) |
ca1e63a5 RS |
663 | "Mode for Java properties files.") |
664 | ||
665 | ;; C shell alias definitions | |
d8677156 | 666 | (when (memq 'alias-generic-mode generic-extras-enable-list) |
ef1c5063 | 667 | |
d8677156 | 668 | (define-generic-mode alias-generic-mode |
82e38f3e LK |
669 | '(?#) |
670 | '("alias" "unalias") | |
ca1e63a5 RS |
671 | '(("^alias\\s-+\\([-A-Za-z0-9_]+\\)\\s-+" |
672 | (1 font-lock-variable-name-face)) | |
673 | ("^unalias\\s-+\\([-A-Za-z0-9_]+\\)\\s-*$" | |
d8677156 | 674 | (1 font-lock-variable-name-face))) |
82e38f3e | 675 | '("alias\\'") |
ca1e63a5 RS |
676 | (list |
677 | (function | |
678 | (lambda () | |
ffe0c7ef | 679 | (setq imenu-generic-expression |
d8677156 LK |
680 | '((nil "^\\(alias\\|unalias\\)\\s-+\\([-a-zA-Z0-9_]+\\)" 2)))))) |
681 | "Mode for C Shell alias files.")) | |
ca1e63a5 RS |
682 | |
683 | ;;; Windows RC files | |
684 | ;; Contributed by ACorreir@pervasive-sw.com (Alfred Correira) | |
d8677156 LK |
685 | (when (memq 'rc-generic-mode generic-extras-enable-list) |
686 | ||
687 | (define-generic-mode rc-generic-mode | |
82e38f3e LK |
688 | ;; '(?\/) |
689 | '("//") | |
d8677156 LK |
690 | '("ACCELERATORS" |
691 | "AUTO3STATE" | |
692 | "AUTOCHECKBOX" | |
693 | "AUTORADIOBUTTON" | |
694 | "BITMAP" | |
695 | "BOTTOMMARGIN" | |
696 | "BUTTON" | |
697 | "CAPTION" | |
698 | "CHARACTERISTICS" | |
699 | "CHECKBOX" | |
700 | "CLASS" | |
701 | "COMBOBOX" | |
702 | "CONTROL" | |
703 | "CTEXT" | |
704 | "CURSOR" | |
705 | "DEFPUSHBUTTON" | |
706 | "DESIGNINFO" | |
707 | "DIALOG" | |
708 | "DISCARDABLE" | |
709 | "EDITTEXT" | |
710 | "EXSTYLE" | |
711 | "FONT" | |
712 | "GROUPBOX" | |
713 | "GUIDELINES" | |
714 | "ICON" | |
715 | "LANGUAGE" | |
716 | "LEFTMARGIN" | |
717 | "LISTBOX" | |
718 | "LTEXT" | |
719 | "MENUITEM SEPARATOR" | |
720 | "MENUITEM" | |
721 | "MENU" | |
722 | "MOVEABLE" | |
723 | "POPUP" | |
724 | "PRELOAD" | |
725 | "PURE" | |
726 | "PUSHBOX" | |
727 | "PUSHBUTTON" | |
728 | "RADIOBUTTON" | |
729 | "RCDATA" | |
730 | "RIGHTMARGIN" | |
731 | "RTEXT" | |
732 | "SCROLLBAR" | |
733 | "SEPARATOR" | |
734 | "STATE3" | |
735 | "STRINGTABLE" | |
736 | "STYLE" | |
737 | "TEXTINCLUDE" | |
738 | "TOOLBAR" | |
739 | "TOPMARGIN" | |
740 | "VERSIONINFO" | |
741 | "VERSION") | |
742 | ;; the choice of what tokens go where is somewhat arbitrary, | |
743 | ;; as is the choice of which value tokens are included, as | |
744 | ;; the choice of face for each token group | |
82e38f3e LK |
745 | (eval-when-compile |
746 | (list | |
d8677156 | 747 | (generic-make-keywords-list |
82e38f3e LK |
748 | '("FILEFLAGSMASK" |
749 | "FILEFLAGS" | |
750 | "FILEOS" | |
751 | "FILESUBTYPE" | |
752 | "FILETYPE" | |
753 | "FILEVERSION" | |
754 | "PRODUCTVERSION") | |
755 | 'font-lock-type-face) | |
d8677156 | 756 | (generic-make-keywords-list |
82e38f3e LK |
757 | '("BEGIN" |
758 | "BLOCK" | |
759 | "END" | |
760 | "VALUE") | |
761 | 'font-lock-function-name-face) | |
762 | '("^#[ \t]*include[ \t]+\\(<[^>\"\n]+>\\)" 1 font-lock-string-face) | |
763 | '("^#[ \t]*define[ \t]+\\(\\sw+\\)(" 1 font-lock-function-name-face) | |
764 | '("^#[ \t]*\\(elif\\|if\\)\\>" | |
765 | ("\\<\\(defined\\)\\>[ \t]*(?\\(\\sw+\\)?" nil nil | |
766 | (1 font-lock-constant-face) | |
767 | (2 font-lock-variable-name-face nil t))) | |
768 | '("^#[ \t]*\\(\\sw+\\)\\>[ \t]*\\(\\sw+\\)?" | |
769 | (1 font-lock-constant-face) | |
770 | (2 font-lock-variable-name-face nil t)))) | |
771 | '("\\.[rR][cC]$") | |
772 | nil | |
773 | "Generic mode for MS-Windows Resource files.")) | |
ca1e63a5 | 774 | |
ef1c5063 | 775 | ;; InstallShield RUL files |
ca1e63a5 | 776 | ;; Contributed by Alfred.Correira@Pervasive.Com |
9845e669 | 777 | ;; Bugfixes by "Rolf Sandau" <Rolf.Sandau@marconi.com> |
d8677156 LK |
778 | (when (memq 'rul-generic-mode generic-extras-enable-list) |
779 | ||
82e38f3e LK |
780 | (eval-when-compile |
781 | ||
ef1c5063 | 782 | ;;; build the regexp strings using regexp-opt |
82e38f3e LK |
783 | (defconst installshield-statement-keyword-list |
784 | '("abort" | |
785 | "begin" | |
786 | "call" | |
787 | "case" | |
788 | "declare" | |
789 | "default" | |
790 | "downto" | |
791 | "elseif" | |
792 | "else" | |
793 | "endfor" | |
794 | "endif" | |
795 | "endswitch" | |
796 | "endwhile" | |
797 | "end" | |
798 | "exit" | |
799 | "external" | |
800 | "for" | |
801 | "function" | |
802 | ;; "goto" -- handled elsewhere | |
803 | "if" | |
804 | "program" | |
805 | "prototype" | |
806 | "repeat" | |
807 | "return" | |
808 | "step" | |
809 | "switch" | |
810 | "then" | |
811 | "to" | |
812 | "typedef" | |
813 | "until" | |
814 | "void" | |
815 | "while") | |
ef1c5063 RS |
816 | "Statement keywords used in InstallShield 3 and 5.") |
817 | ||
82e38f3e LK |
818 | (defconst installshield-system-functions-list |
819 | '("AddFolderIcon" | |
820 | "AddProfString" | |
821 | "AddressString" | |
822 | "AppCommand" | |
823 | "AskDestPath" | |
824 | "AskOptions" | |
825 | "AskPath" | |
826 | "AskText" | |
827 | "AskYesNo" | |
828 | "BatchDeleteEx" | |
829 | "BatchFileLoad" | |
830 | "BatchFileSave" | |
831 | "BatchFind" | |
832 | "BatchGetFileName" | |
833 | "BatchMoveEx" | |
834 | "BatchSetFileName" | |
835 | "ChangeDirectory" | |
836 | "CloseFile" | |
837 | "CmdGetHwndDlg" | |
838 | "ComponentAddItem" ; differs between IS3 and IS5 | |
839 | "ComponentCompareSizeRequired" ; IS5 only | |
840 | "ComponentDialog" | |
841 | "ComponentError" ; IS5 only | |
842 | "ComponentFileEnum" ; IS5 only | |
843 | "ComponentFileInfo" ; IS5 only | |
844 | "ComponentFilterLanguage" ; IS5 only | |
845 | "ComponentFilterOS" ; IS5 only | |
846 | "ComponentGetData" ; IS5 only | |
847 | "ComponentGetItemInfo" ; IS3 only | |
848 | "ComponentGetItemSize" ; differs between IS3 and IS5 | |
849 | "ComponentIsItemSelected" ; differs between IS3 and IS5 | |
850 | "ComponentListItems" | |
851 | "ComponentMoveData" ; IS5 only | |
852 | "ComponentSelectItem" ; differs between IS3 and IS5 | |
853 | "ComponentSetData" ; IS5 only | |
854 | "ComponentSetItemInfo" ; IS3 only | |
855 | "ComponentSetTarget" ; IS5 only | |
856 | "ComponentSetupTypeEnum" ; IS5 only | |
857 | "ComponentSetupTypeGetData" ; IS5 only | |
858 | "ComponentSetupTypeSet" ; IS5 only | |
859 | "ComponentTotalSize" | |
860 | "ComponentValidate" ; IS5 only | |
861 | "CompressAdd" ; IS3 only | |
862 | "CompressDel" ; IS3 only | |
863 | "CompressEnum" ; IS3 only | |
864 | "CompressGet" ; IS3 only | |
865 | "CompressInfo" ; IS3 only | |
866 | "CopyFile" | |
867 | "CreateDir" | |
868 | "CreateFile" | |
869 | "CreateProgramFolder" | |
870 | "DeinstallSetReference" ; IS5 only | |
871 | "DeinstallStart" | |
872 | "Delay" | |
873 | "DeleteDir" | |
874 | "DeleteFile" | |
875 | "DialogSetInfo" | |
876 | "Disable" | |
877 | "DoInstall" | |
878 | "Do" | |
879 | "Enable" | |
880 | "EnterDisk" | |
881 | "ExistsDir" | |
882 | "ExistsDisk" | |
883 | "ExitProgMan" | |
884 | "EzBatchAddPath" | |
885 | "EzBatchAddString" | |
886 | "EzBatchReplace" | |
887 | "EzConfigAddDriver" | |
888 | "EzConfigAddString" | |
889 | "EzConfigGetValue" | |
890 | "EzConfigSetValue" | |
891 | "EzDefineDialog" | |
892 | "FileCompare" | |
893 | "FileDeleteLine" | |
894 | "FileGrep" | |
895 | "FileInsertLine" | |
896 | "FileSetBeginDefine" ; IS3 only | |
897 | "FileSetEndDefine" ; IS3 only | |
898 | "FileSetPerformEz" ; IS3 only | |
899 | "FileSetPerform" ; IS3 only | |
900 | "FileSetReset" ; IS3 only | |
901 | "FileSetRoot" ; IS3 only | |
902 | "FindAllDirs" | |
903 | "FindAllFiles" | |
904 | "FindFile" | |
905 | "FindWindow" | |
906 | "GetDiskSpace" | |
907 | "GetDisk" | |
908 | "GetEnvVar" | |
909 | "GetExtents" | |
910 | "GetFileInfo" | |
911 | "GetLine" | |
912 | "GetProfInt" | |
913 | "GetProfString" | |
914 | "GetSystemInfo" | |
915 | "GetValidDrivesList" | |
916 | "GetVersion" | |
917 | "GetWindowHandle" | |
918 | "InstallationInfo" | |
919 | "Is" | |
920 | "LaunchApp" | |
921 | "LaunchAppAndWait" | |
922 | "ListAddItem" | |
923 | "ListAddString" | |
924 | "ListCount" | |
925 | "ListCreate" | |
926 | "ListDestroy" | |
927 | "ListFindItem" | |
928 | "ListFindString" | |
929 | "ListGetFirstItem" | |
930 | "ListGetFirstString" | |
931 | "ListGetNextItem" | |
932 | "ListGetNextString" | |
933 | "ListReadFromFile" | |
934 | "ListSetCurrentItem" | |
935 | "ListSetNextItem" | |
936 | "ListSetNextString" | |
937 | "ListSetIndex" | |
938 | "ListWriteToFile" | |
939 | "LongPathToQuote" | |
940 | "LongPathToShortPath" | |
941 | "MessageBox" | |
942 | "NumToStr" | |
943 | "OpenFileMode" | |
944 | "OpenFile" | |
945 | "ParsePath" | |
946 | "PathAdd" | |
947 | "PathDelete" | |
948 | "PathFind" | |
949 | "PathGet" | |
950 | "PathMove" | |
951 | "PathSet" | |
952 | "Path" | |
953 | "PlaceBitmap" | |
954 | "PlaceWindow" | |
955 | "PlayMMedia" ; IS5 only | |
956 | "ProgDefGroupType" | |
957 | "RegDBCreateKeyEx" | |
958 | "RegDBDeleteValue" | |
959 | "RegDBGetItem" | |
960 | "RegDBKeyExist" | |
961 | "RegDBSetItem" | |
962 | "RegDBGetKeyValueEx" | |
963 | "RegDBSetKeyValueEx" | |
964 | "RegDBSetDefaultRoot" | |
965 | "RenameFile" | |
966 | "ReplaceFolderIcon" | |
967 | "ReplaceProfString" | |
968 | "SdAskDestPath" | |
969 | "SdAskOptions" | |
970 | "SdAskOptionsList" | |
971 | "SdBitmap" | |
972 | "SdCloseDlg" | |
973 | "SdComponentAdvCheckSpace" | |
974 | "SdComponentAdvInit" | |
975 | "SdComponentAdvUpdateSpace" | |
976 | "SdComponentDialog" | |
977 | "SdComponentDialog2" | |
978 | "SdComponentDialogAdv" | |
979 | "SdComponentDialogEx" | |
980 | "SdComponentDlgCheckSpace" | |
981 | "SdComponentMult" | |
982 | "SdConfirmNewDir" | |
983 | "SdConfirmRegistration" | |
984 | "SdDiskSpace" | |
985 | "SdDisplayTopics" | |
986 | "SdDoStdButton" | |
987 | "SdEnablement" | |
988 | "SdError" | |
989 | "SdFinish" | |
990 | "SdFinishInit32" | |
991 | "SdFinishReboot" | |
992 | "SdGeneralInit" | |
993 | "SdGetItemName" | |
994 | "SdGetTextExtent" | |
995 | "SdGetUserCompanyInfo" | |
996 | "SdInit" | |
997 | "SdIsShellExplorer" | |
998 | "SdIsStdButton" | |
999 | "SdLicense" | |
1000 | "SdMakeName" | |
1001 | "SdOptionInit" | |
1002 | "SdOptionSetState" | |
1003 | "SdOptionsButtons" | |
1004 | "SdOptionsButtonsInit" | |
1005 | "SdPlugInProductName" | |
1006 | "SdProductName" | |
1007 | "SdRegEnableButton" | |
1008 | "SdRegExEnableButton" | |
1009 | "SdRegisterUser" | |
1010 | "SdRegisterUserEx" | |
1011 | "SdRemoveEndSpace" | |
1012 | "SdSelectFolder" | |
1013 | "SdSetSequentialItems" | |
1014 | "SdSetStatic" | |
1015 | "SdSetupTypeEx" ; IS5 only | |
1016 | "SdSetupType" | |
1017 | "SdShowAnyDialog" | |
1018 | "SdShowDlgEdit1" | |
1019 | "SdShowDlgEdit2" | |
1020 | "SdShowDlgEdit3" | |
1021 | "SdShowFileMods" | |
1022 | "SdShowInfoList" | |
1023 | "SdShowMsg" | |
1024 | "SdStartCopy" | |
1025 | "SdUnInit" | |
1026 | "SdUpdateComponentSelection" | |
1027 | "SdWelcome" | |
1028 | "SendMessage" | |
1029 | "SetColor" | |
1030 | "SetFont" | |
1031 | "SetDialogTitle" | |
1032 | "SetDisplayEffect" ; IS5 only | |
1033 | "SetFileInfo" | |
1034 | "SetForegroundWindow" | |
1035 | "SetStatusWindow" | |
1036 | "SetTitle" | |
1037 | "SetupType" | |
1038 | "ShowProgramFolder" | |
1039 | "Split" ; IS3 only | |
1040 | "SprintfBox" | |
1041 | "Sprintf" | |
1042 | "StatusUpdate" | |
1043 | "StrCompare" | |
1044 | "StrFind" | |
1045 | "StrGetTokens" | |
1046 | "StrLength" | |
1047 | "StrRemoveLastSlash" | |
1048 | "StrToLower" | |
1049 | "StrToNum" | |
1050 | "StrToUpper" | |
1051 | "StrSub" | |
1052 | "VarRestore" | |
1053 | "VarSave" | |
1054 | "VerCompare" | |
1055 | "VerGetFileVersion" | |
1056 | "WaitOnDialog" | |
1057 | "Welcome" | |
1058 | "WriteLine" | |
1059 | "WriteProfString" | |
1060 | "XCopyFile") | |
ef1c5063 RS |
1061 | "System functions defined in InstallShield 3 and 5.") |
1062 | ||
82e38f3e LK |
1063 | (defconst installshield-system-variables-list |
1064 | '("BATCH_INSTALL" | |
1065 | "CMDLINE" | |
1066 | "COMMONFILES" | |
1067 | "CORECOMPONENTHANDLING" | |
1068 | "DIALOGCACHE" | |
1069 | "ERRORFILENAME" | |
1070 | "FOLDER_DESKTOP" | |
1071 | "FOLDER_PROGRAMS" | |
1072 | "FOLDER_STARTMENU" | |
1073 | "FOLDER_STARTUP" | |
1074 | "INFOFILENAME" | |
1075 | "ISRES" | |
1076 | "ISUSER" | |
1077 | "ISVERSION" | |
1078 | "MEDIA" | |
1079 | "MODE" | |
1080 | "PROGRAMFILES" | |
1081 | "SELECTED_LANGUAGE" | |
1082 | "SRCDIR" | |
1083 | "SRCDISK" | |
1084 | "SUPPORTDIR" | |
1085 | "TARGETDIR" | |
1086 | "TARGETDISK" | |
1087 | "UNINST" | |
1088 | "WINDIR" | |
1089 | "WINDISK" | |
1090 | "WINMAJOR" | |
1091 | "WINSYSDIR" | |
1092 | "WINSYSDISK") | |
ef1c5063 RS |
1093 | "System variables used in InstallShield 3 and 5.") |
1094 | ||
82e38f3e LK |
1095 | (defconst installshield-types-list |
1096 | '("BOOL" | |
1097 | "BYREF" | |
1098 | "CHAR" | |
1099 | "HIWORD" | |
1100 | "HWND" | |
1101 | "INT" | |
1102 | "LIST" | |
1103 | "LONG" | |
1104 | "LOWORD" | |
1105 | "LPSTR" | |
1106 | "NUMBER" | |
1107 | "NUMBERLIST" | |
1108 | "POINTER" | |
1109 | "QUAD" | |
1110 | "RGB" | |
1111 | "SHORT" | |
1112 | "STRINGLIST" | |
1113 | "STRING") | |
ef1c5063 RS |
1114 | "Type keywords used in InstallShield 3 and 5.") |
1115 | ||
1116 | ;;; some might want to skip highlighting these to improve performance | |
82e38f3e LK |
1117 | (defconst installshield-funarg-constants-list |
1118 | '("AFTER" | |
1119 | "APPEND" | |
1120 | "ALLCONTENTS" | |
1121 | "BACKBUTTON" | |
1122 | "BACKGROUNDCAPTION" | |
1123 | "BACKGROUND" | |
1124 | "BACK" | |
1125 | "BASEMEMORY" | |
1126 | "BEFORE" | |
1127 | "BIOS" | |
1128 | "BITMAPICON" | |
1129 | "BK_BLUE" | |
1130 | "BK_GREEN" | |
1131 | "BK_RED" | |
1132 | "BLUE" | |
1133 | "BOOTUPDRIVE" | |
1134 | "CANCEL" | |
1135 | "CDROM_DRIVE" | |
1136 | "CDROM" | |
1137 | "CHECKBOX95" | |
1138 | "CHECKBOX" | |
1139 | "CHECKLINE" | |
1140 | "CHECKMARK" | |
1141 | "COLORS" | |
1142 | "COMMANDEX" | |
1143 | "COMMAND" | |
1144 | "COMP_NORMAL" | |
1145 | "COMP_UPDATE_DATE" | |
1146 | "COMP_UPDATE_SAME" | |
1147 | "COMP_UPDATE_VERSION" | |
1148 | "COMPACT" | |
1149 | "CONTINUE" | |
1150 | "CPU" | |
1151 | "CUSTOM" | |
1152 | "DATE" | |
1153 | "DEFWINDOWMODE" | |
1154 | "DIR_WRITEABLE" | |
1155 | "DIRECTORY" | |
1156 | "DISABLE" | |
1157 | "DISK_TOTALSPACE" | |
1158 | "DISK" | |
1159 | "DLG_OPTIONS" | |
1160 | "DLG_PATH" | |
1161 | "DLG_TEXT" | |
1162 | "DLG_ASK_YESNO" | |
1163 | "DLG_ENTER_DISK" | |
1164 | "DLG_ERR" | |
1165 | "DLG_INFO_ALTIMAGE" | |
1166 | "DLG_INFO_CHECKSELECTION" | |
1167 | "DLG_INFO_KUNITS" | |
1168 | "DLG_INFO_USEDECIMAL" | |
1169 | "DLG_MSG_INFORMATION" | |
1170 | "DLG_MSG_SEVERE" | |
1171 | "DLG_MSG_WARNING" | |
1172 | "DLG_STATUS" | |
1173 | "DLG_WARNING" | |
1174 | "DLG_USER_CAPTION" | |
1175 | "DRIVE" | |
1176 | "ENABLE" | |
1177 | "END_OF_FILE" | |
1178 | "END_OF_LIST" | |
1179 | "ENVSPACE" | |
1180 | "EQUALS" | |
1181 | "EXCLUDE_SUBDIR" | |
1182 | "EXCLUSIVE" | |
1183 | "EXISTS" | |
1184 | "EXIT" | |
1185 | "EXTENDED_MEMORY" | |
1186 | "EXTENSION_ONLY" | |
1187 | "FAILIFEXISTS" | |
1188 | "FALSE" | |
1189 | "FEEDBACK_FULL" | |
1190 | "FILE_ATTR_ARCHIVED" | |
1191 | "FILE_ATTR_DIRECTORY" | |
1192 | "FILE_ATTR_HIDDEN" | |
1193 | "FILE_ATTR_NORMAL" | |
1194 | "FILE_ATTR_READONLY" | |
1195 | "FILE_ATTR_SYSTEM" | |
1196 | "FILE_ATTRIBUTE" | |
1197 | "FILE_DATE" | |
1198 | "FILE_LINE_LENGTH" | |
1199 | "FILE_MODE_APPEND" | |
1200 | "FILE_MODE_BINARYREADONLY" | |
1201 | "FILE_MODE_BINARY" | |
1202 | "FILE_MODE_NORMAL" | |
1203 | "FILE_NO_VERSION" | |
1204 | "FILE_NOT_FOUND" | |
1205 | "FILE_SIZE" | |
1206 | "FILE_TIME" | |
1207 | "FILENAME_ONLY" | |
1208 | "FILENAME" | |
1209 | "FIXED_DRIVE" | |
1210 | "FOLDER_DESKTOP" | |
1211 | "FOLDER_PROGRAMS" | |
1212 | "FOLDER_STARTMENU" | |
1213 | "FOLDER_STARTUP" | |
1214 | "FREEENVSPACE" | |
1215 | "FULLWINDOWMODE" | |
1216 | "FULL" | |
1217 | "FONT_TITLE" | |
1218 | "GREATER_THAN" | |
1219 | "GREEN" | |
1220 | "HKEY_CLASSES_ROOT" | |
1221 | "HKEY_CURRENT_USER" | |
1222 | "HKEY_LOCAL_MACHINE" | |
1223 | "HKEY_USERS" | |
1224 | "HOURGLASS" | |
1225 | "INCLUDE_SUBDIR" | |
1226 | "INDVFILESTATUS" | |
1227 | "INFORMATION" | |
1228 | "IS_WINDOWSNT" | |
1229 | "IS_WINDOWS95" | |
1230 | "IS_WINDOWS" | |
1231 | "IS_WIN32S" | |
1232 | "ISTYPE" | |
1233 | "LANGUAGE_DRV" | |
1234 | "LANGUAGE" | |
1235 | "LESS_THAN" | |
1236 | "LIST_NULL" | |
1237 | "LISTFIRST" | |
1238 | "LISTNEXT" | |
1239 | "LOCKEDFILE" | |
1240 | "LOGGING" | |
1241 | "LOWER_LEFT" | |
1242 | "LOWER_RIGHT" | |
1243 | "MAGENTA" | |
1244 | "MOUSE_DRV" | |
1245 | "MOUSE" | |
1246 | "NETWORK_DRV" | |
1247 | "NETWORK" | |
1248 | "NEXT" | |
1249 | "NONEXCLUSIVE" | |
1250 | "NORMALMODE" | |
1251 | "NOSET" | |
1252 | "NOTEXISTS" | |
1253 | "NOWAIT" | |
1254 | "NO" | |
1255 | "OFF" | |
1256 | "ONLYDIR" | |
1257 | "ON" | |
1258 | "OSMAJOR" | |
1259 | "OSMINOR" | |
1260 | "OS" | |
1261 | "OTHER_FAILURE" | |
1262 | "PARALLEL" | |
1263 | "PARTIAL" | |
1264 | "PATH_EXISTS" | |
1265 | "PATH" | |
1266 | "RED" | |
1267 | "REGDB_APPPATH_DEFAULT" | |
1268 | "REGDB_APPPATH" | |
1269 | "REGDB_BINARY" | |
1270 | "REGDB_ERR_CONNECTIONEXISTS" | |
1271 | "REGDB_ERR_CORRUPTEDREGSITRY" | |
1272 | "REGDB_ERR_INITIALIZATION" | |
1273 | "REGDB_ERR_INVALIDHANDLE" | |
1274 | "REGDB_ERR_INVALIDNAME" | |
1275 | "REGDB_NUMBER" | |
1276 | "REGDB_STRING_EXPAND" | |
1277 | "REGDB_STRING_MULTI" | |
1278 | "REGDB_STRING" | |
1279 | "REGDB_UNINSTALL_NAME" | |
1280 | "REMOTE_DRIVE" | |
1281 | "REMOVALE_DRIVE" | |
1282 | "REPLACE_ITEM" | |
1283 | "REPLACE" | |
1284 | "RESET" | |
1285 | "RESTART" | |
1286 | "ROOT" | |
1287 | "SELFREGISTER" | |
1288 | "SERIAL" | |
1289 | "SET" | |
1290 | "SEVERE" | |
1291 | "SHAREDFILE" | |
1292 | "SHARE" | |
1293 | "SILENTMODE" | |
1294 | "SRCTARGETDIR" | |
1295 | "STATUSBAR" | |
1296 | "STATUSDLG" | |
1297 | "STATUSOLD" | |
1298 | "STATUS" | |
1299 | "STYLE_NORMAL" | |
1300 | "SW_MAXIMIZE" | |
1301 | "SW_MINIMIZE" | |
1302 | "SW_RESTORE" | |
1303 | "SW_SHOW" | |
1304 | "SYS_BOOTMACHINE" | |
1305 | "TIME" | |
1306 | "TRUE" | |
1307 | "TYPICAL" | |
1308 | "UPPER_LEFT" | |
1309 | "UPPER_RIGHT" | |
1310 | "VALID_PATH" | |
1311 | "VERSION" | |
1312 | "VIDEO" | |
1313 | "VOLUMELABEL" | |
1314 | "YELLOW" | |
1315 | "YES" | |
1316 | "WAIT" | |
1317 | "WARNING" | |
1318 | "WINMAJOR" | |
1319 | "WINMINOR" | |
1320 | "WIN32SINSTALLED" | |
1321 | "WIN32SMAJOR" | |
1322 | "WIN32SMINOR") | |
1323 | "Function argument constants used in InstallShield 3 and 5.")) | |
ca1e63a5 | 1324 | |
d8677156 LK |
1325 | (defvar rul-generic-mode-syntax-table nil |
1326 | "Syntax table to use in rul-generic-mode buffers.") | |
1327 | ||
1328 | (setq rul-generic-mode-syntax-table | |
1329 | (make-syntax-table c++-mode-syntax-table)) | |
1330 | ||
82e38f3e LK |
1331 | (modify-syntax-entry ?\r "> b" rul-generic-mode-syntax-table) |
1332 | (modify-syntax-entry ?\n "> b" rul-generic-mode-syntax-table) | |
d8677156 LK |
1333 | |
1334 | (modify-syntax-entry ?/ ". 124b" rul-generic-mode-syntax-table) | |
1335 | (modify-syntax-entry ?* ". 23" rul-generic-mode-syntax-table) | |
1336 | ||
1337 | ;; here manually instead | |
1338 | (defun generic-rul-mode-setup-function () | |
82e38f3e LK |
1339 | (make-local-variable 'parse-sexp-ignore-comments) |
1340 | (make-local-variable 'comment-start) | |
1341 | (make-local-variable 'comment-start-skip) | |
1342 | (make-local-variable 'comment-end) | |
d8677156 LK |
1343 | (setq imenu-generic-expression |
1344 | '((nil "^function\\s-+\\([A-Za-z0-9_]+\\)" 1)) | |
1345 | parse-sexp-ignore-comments t | |
1346 | comment-end "*/" | |
1347 | comment-start "/*" | |
1348 | ;;; comment-end "" | |
1349 | ;;; comment-start "//" | |
1350 | ;;; comment-start-skip "" | |
1351 | ) | |
82e38f3e | 1352 | ;; (set-syntax-table rul-generic-mode-syntax-table) |
d8677156 LK |
1353 | (setq font-lock-syntax-table rul-generic-mode-syntax-table)) |
1354 | ||
1355 | ;; moved mode-definition behind defun-definition to be warning-free - 15.11.02/RSan | |
1356 | (define-generic-mode rul-generic-mode | |
1357 | ;; Using "/*" and "*/" doesn't seem to be working right | |
82e38f3e LK |
1358 | '("//" ("/*" . "*/" )) |
1359 | (eval-when-compile installshield-statement-keyword-list) | |
1360 | (eval-when-compile | |
1361 | (list | |
1362 | ;; preprocessor constructs | |
1363 | '("#[ \t]*include[ \t]+\\(<[^>\"\n]+>\\)" | |
1364 | 1 font-lock-string-face) | |
1365 | '("#[ \t]*\\(\\sw+\\)\\>[ \t]*\\(\\sw+\\)?" | |
1366 | (1 font-lock-reference-face) | |
1367 | (2 font-lock-variable-name-face nil t)) | |
1368 | ;; indirect string constants | |
1369 | '("\\(@[A-Za-z][A-Za-z0-9_]+\\)" 1 font-lock-builtin-face) | |
1370 | ;; gotos | |
1371 | '("[ \t]*\\(\\sw+:\\)" 1 font-lock-reference-face) | |
1372 | '("\\<\\(goto\\)\\>[ \t]*\\(\\sw+\\)?" | |
1373 | (1 font-lock-keyword-face) | |
1374 | (2 font-lock-reference-face nil t)) | |
1375 | ;; system variables | |
1376 | (generic-make-keywords-list | |
1377 | installshield-system-variables-list | |
1378 | 'font-lock-variable-name-face "[^_]" "[^_]") | |
1379 | ;; system functions | |
1380 | (generic-make-keywords-list | |
1381 | installshield-system-functions-list | |
1382 | 'font-lock-function-name-face "[^_]" "[^_]") | |
1383 | ;; type keywords | |
1384 | (generic-make-keywords-list | |
1385 | installshield-types-list | |
1386 | 'font-lock-type-face "[^_]" "[^_]") | |
1387 | ;; function argument constants | |
1388 | (generic-make-keywords-list | |
1389 | installshield-funarg-constants-list | |
1390 | 'font-lock-variable-name-face "[^_]" "[^_]"))) ; is this face the best choice? | |
1391 | '("\\.[rR][uU][lL]$") | |
1392 | '(generic-rul-mode-setup-function) | |
d8677156 LK |
1393 | "Generic mode for InstallShield RUL files.") |
1394 | ||
ca1e63a5 | 1395 | (define-skeleton rul-if |
d8677156 LK |
1396 | "Insert an if statement." |
1397 | "condition: " | |
1398 | "if(" str ") then" \n | |
1399 | > _ \n | |
1400 | ( "other condition, %s: " | |
1401 | > "elseif(" str ") then" \n | |
1402 | > \n) | |
1403 | > "else" \n | |
1404 | > \n | |
1405 | resume: | |
1406 | > "endif;") | |
ca1e63a5 RS |
1407 | |
1408 | (define-skeleton rul-function | |
1409 | "Insert a function statement." | |
1410 | "function: " | |
1411 | "function " str " ()" \n | |
1412 | ( "local variables, %s: " | |
d8677156 | 1413 | > " " str ";" \n) |
ca1e63a5 RS |
1414 | > "begin" \n |
1415 | > _ \n | |
1416 | resume: | |
d8677156 | 1417 | > "end;")) |
ca1e63a5 RS |
1418 | |
1419 | ;; Additions by ACorreir@pervasive-sw.com (Alfred Correira) | |
d8677156 | 1420 | (define-generic-mode mailrc-generic-mode |
82e38f3e LK |
1421 | '(?#) |
1422 | '("alias" | |
1423 | "else" | |
1424 | "endif" | |
1425 | "group" | |
1426 | "if" | |
1427 | "ignore" | |
1428 | "set" | |
1429 | "source" | |
1430 | "unset") | |
ca1e63a5 | 1431 | '(("^\\s-*\\(alias\\|group\\)\\s-+\\([-A-Za-z0-9_]+\\)\\s-+\\([^\n\r#]*\\)\\(#.*\\)?$" |
ffe0c7ef | 1432 | (2 font-lock-constant-face) (3 font-lock-variable-name-face)) |
ca1e63a5 | 1433 | ("^\\s-*\\(unset\\|set\\|ignore\\)\\s-+\\([-A-Za-z0-9_]+\\)=?\\([^\n\r#]*\\)\\(#.*\\)?$" |
5d1c5247 FP |
1434 | (2 font-lock-constant-face) (3 font-lock-variable-name-face)) |
1435 | ("^\\s-*\\(source\\)\\s-+\\([^\n\r#]*\\)\\(#.*\\)?$" | |
1436 | (2 font-lock-variable-name-face))) | |
82e38f3e | 1437 | '("\\.mailrc\\'") |
ca1e63a5 RS |
1438 | nil |
1439 | "Mode for mailrc files.") | |
1440 | ||
bb53e1ee | 1441 | ;; Inetd.conf |
d8677156 | 1442 | (when (memq 'inetd-conf-generic-mode generic-extras-enable-list) |
bb53e1ee | 1443 | |
d8677156 | 1444 | (define-generic-mode inetd-conf-generic-mode |
82e38f3e LK |
1445 | '(?#) |
1446 | '("stream" | |
1447 | "dgram" | |
1448 | "tcp" | |
1449 | "udp" | |
1450 | "wait" | |
1451 | "nowait" | |
1452 | "internal") | |
1453 | '(("^\\([-A-Za-z0-9_]+\\)" 1 font-lock-type-face)) | |
bb53e1ee | 1454 | '("/etc/inetd.conf\\'") |
ffe0c7ef | 1455 | (list |
bb53e1ee RS |
1456 | (function |
1457 | (lambda () | |
ffe0c7ef | 1458 | (setq imenu-generic-expression |
d8677156 | 1459 | '((nil "^\\([-A-Za-z0-9_]+\\)" 1)))))))) |
bb53e1ee RS |
1460 | |
1461 | ;; Services | |
d8677156 | 1462 | (when (memq 'etc-services-generic-mode generic-extras-enable-list) |
bb53e1ee | 1463 | |
d8677156 | 1464 | (define-generic-mode etc-services-generic-mode |
82e38f3e LK |
1465 | '(?#) |
1466 | '("tcp" | |
1467 | "udp" | |
1468 | "ddp") | |
d8677156 | 1469 | '(("^\\([-A-Za-z0-9_]+\\)\\s-+\\([0-9]+\\)/" |
82e38f3e LK |
1470 | (1 font-lock-type-face) |
1471 | (2 font-lock-variable-name-face))) | |
bb53e1ee | 1472 | '("/etc/services\\'") |
ffe0c7ef | 1473 | (list |
bb53e1ee RS |
1474 | (function |
1475 | (lambda () | |
ffe0c7ef | 1476 | (setq imenu-generic-expression |
d8677156 | 1477 | '((nil "^\\([-A-Za-z0-9_]+\\)" 1)))))))) |
bb53e1ee RS |
1478 | |
1479 | ;; Password and Group files | |
d8677156 | 1480 | (when (memq 'etc-passwd-generic-mode generic-extras-enable-list) |
bb53e1ee | 1481 | |
d8677156 | 1482 | (define-generic-mode etc-passwd-generic-mode |
bb53e1ee | 1483 | nil ;; No comment characters |
82e38f3e LK |
1484 | '("root") ;; Only one keyword |
1485 | (eval-when-compile | |
1486 | (list | |
1487 | (list | |
1488 | (concat | |
1489 | "^" | |
1490 | ;; User name -- Never blank! | |
1491 | "\\([^:]+\\)" | |
1492 | ":" | |
1493 | ;; Password, UID and GID | |
1494 | (mapconcat | |
1495 | 'identity | |
1496 | (make-list 3 "\\([^:]+\\)") | |
1497 | ":") | |
1498 | ":" | |
1499 | ;; GECOS/Name -- might be blank | |
1500 | "\\([^:]*\\)" | |
1501 | ":" | |
1502 | ;; Home directory and shell | |
1503 | "\\([^:]+\\)" | |
1504 | ":?" | |
1505 | "\\([^:]*\\)" | |
1506 | "$") | |
1507 | '(1 font-lock-type-face) | |
1508 | '(5 font-lock-variable-name-face) | |
1509 | '(6 font-lock-constant-face) | |
1510 | '(7 font-lock-warning-face)) | |
1511 | '("^\\([^:]+\\):\\([^:]*\\):\\([0-9]+\\):\\(.*\\)$" | |
1512 | (1 font-lock-type-face) | |
1513 | (4 font-lock-variable-name-face)))) | |
bb53e1ee | 1514 | '("/etc/passwd\\'" "/etc/group\\'") |
ffe0c7ef | 1515 | (list |
bb53e1ee RS |
1516 | (function |
1517 | (lambda () | |
ffe0c7ef | 1518 | (setq imenu-generic-expression |
d8677156 | 1519 | '((nil "^\\([-A-Za-z0-9_]+\\):" 1)))))))) |
bb53e1ee | 1520 | |
7aeb9d6f | 1521 | ;; Fstab |
d8677156 | 1522 | (when (memq 'etc-fstab-generic-mode generic-extras-enable-list) |
7aeb9d6f | 1523 | |
d8677156 | 1524 | (define-generic-mode etc-fstab-generic-mode |
82e38f3e LK |
1525 | '(?#) |
1526 | '("adfs" | |
1527 | "affs" | |
1528 | "autofs" | |
1529 | "coda" | |
1530 | "coherent" | |
1531 | "cramfs" | |
1532 | "devpts" | |
1533 | "efs" | |
1534 | "ext2" | |
1535 | "ext3" | |
1536 | "hfs" | |
1537 | "hpfs" | |
1538 | "iso9660" | |
1539 | "jfs" | |
1540 | "minix" | |
1541 | "msdos" | |
1542 | "ncpfs" | |
1543 | "nfs" | |
1544 | "ntfs" | |
1545 | "proc" | |
1546 | "qnx4" | |
1547 | "reiserfs" | |
1548 | "romfs" | |
1549 | "smbfs" | |
1550 | "sysv" | |
1551 | "tmpfs" | |
1552 | "udf" | |
1553 | "ufs" | |
1554 | "umsdos" | |
1555 | "vfat" | |
1556 | "xenix" | |
1557 | "xfs" | |
1558 | "swap" | |
1559 | "auto" | |
1560 | "ignore") | |
d8677156 | 1561 | '(("^\\([/-A-Za-z0-9_]+\\)\\s-+\\([/-A-Za-z0-9_]+\\)" |
82e38f3e LK |
1562 | (1 font-lock-type-face) |
1563 | (2 font-lock-variable-name-face))) | |
7aeb9d6f PB |
1564 | '("/etc/[v]*fstab\\'") |
1565 | (list | |
1566 | (function | |
1567 | (lambda () | |
1568 | (setq imenu-generic-expression | |
d8677156 | 1569 | '((nil "^\\([/-A-Za-z0-9_]+\\)\\s-+" 1)))))))) |
bb53e1ee RS |
1570 | |
1571 | ;; From Jacques Duthen <jacques.duthen@sncf.fr> | |
1572 | (defvar show-tabs-generic-mode-font-lock-defaults-1 | |
82e38f3e LK |
1573 | '(;; trailing spaces must come before... |
1574 | ("[ \t]+$" . show-tabs-space-face) | |
d8677156 | 1575 | ;; ...embedded tabs |
82e38f3e | 1576 | ("[^\n\t]\\(\t+\\)" (1 show-tabs-tab-face)))) |
bb53e1ee RS |
1577 | |
1578 | (defvar show-tabs-generic-mode-font-lock-defaults-2 | |
82e38f3e LK |
1579 | '(;; trailing spaces must come before... |
1580 | ("[ \t]+$" . show-tabs-space-face) | |
d8677156 | 1581 | ;; ...tabs |
82e38f3e | 1582 | ("\t+" . show-tabs-tab-face))) |
bb53e1ee RS |
1583 | |
1584 | (defface show-tabs-tab-face | |
1fd714a4 RS |
1585 | '((((class grayscale) (background light)) (:foreground "LightGray" :weight bold)) |
1586 | (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold)) | |
bb53e1ee RS |
1587 | (((class color) (background light)) (:foreground "red")) |
1588 | (((class color) (background dark)) (:foreground "red")) | |
1fd714a4 | 1589 | (t (:weight bold))) |
bb53e1ee RS |
1590 | "Font Lock mode face used to highlight TABs." |
1591 | :group 'show-tabs) | |
1592 | ||
1593 | (defface show-tabs-space-face | |
1fd714a4 RS |
1594 | '((((class grayscale) (background light)) (:foreground "LightGray" :weight bold)) |
1595 | (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold)) | |
bb53e1ee RS |
1596 | (((class color) (background light)) (:foreground "yellow")) |
1597 | (((class color) (background dark)) (:foreground "yellow")) | |
1fd714a4 | 1598 | (t (:weight bold))) |
bb53e1ee RS |
1599 | "Font Lock mode face used to highlight spaces." |
1600 | :group 'show-tabs) | |
1601 | ||
d8677156 | 1602 | (define-generic-mode show-tabs-generic-mode |
82e38f3e LK |
1603 | nil ;; no comment char |
1604 | nil ;; no keywords | |
d8677156 | 1605 | show-tabs-generic-mode-font-lock-defaults-1 |
82e38f3e LK |
1606 | nil ;; no auto-mode-alist |
1607 | ;; '(show-tabs-generic-mode-hook-fun) | |
bb53e1ee RS |
1608 | nil |
1609 | "Generic mode to show tabs and trailing spaces") | |
1610 | ||
ffe0c7ef PB |
1611 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1612 | ;; DNS modes | |
1613 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
1614 | ||
d8677156 LK |
1615 | (define-generic-mode named-boot-generic-mode |
1616 | ;; List of comment characters | |
82e38f3e | 1617 | '(?\;) |
d8677156 | 1618 | ;; List of keywords |
82e38f3e LK |
1619 | '("cache" "primary" "secondary" "forwarders" "limit" "options" |
1620 | "directory" "check-names") | |
d8677156 | 1621 | ;; List of additional font-lock-expressions |
82e38f3e LK |
1622 | '(("\\([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\\)" 1 font-lock-constant-face) |
1623 | ("^directory\\s-+\\(.*\\)" 1 font-lock-variable-name-face) | |
1624 | ("^\\(primary\\|cache\\)\\s-+\\([.A-Za-z]+\\)\\s-+\\(.*\\)" | |
1625 | (2 font-lock-variable-name-face) | |
1626 | (3 font-lock-constant-face))) | |
d8677156 | 1627 | ;; List of additional automode-alist expressions |
82e38f3e | 1628 | '("/etc/named.boot\\'") |
d8677156 LK |
1629 | ;; List of set up functions to call |
1630 | nil) | |
ffe0c7ef | 1631 | |
d8677156 LK |
1632 | (define-generic-mode named-database-generic-mode |
1633 | ;; List of comment characters | |
82e38f3e | 1634 | '(?\;) |
d8677156 | 1635 | ;; List of keywords |
82e38f3e | 1636 | '("IN" "NS" "CNAME" "SOA" "PTR" "MX" "A") |
d8677156 | 1637 | ;; List of additional font-lock-expressions |
82e38f3e LK |
1638 | '(("\\([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\\)" 1 font-lock-constant-face) |
1639 | ("^\\([.A-Za-z0-9]+\\)" 1 font-lock-variable-name-face)) | |
d8677156 | 1640 | ;; List of additional automode-alist expressions |
ffe0c7ef | 1641 | nil |
d8677156 LK |
1642 | ;; List of set up functions to call |
1643 | nil) | |
ffe0c7ef PB |
1644 | |
1645 | (defvar named-database-time-string "%Y%m%d%H" | |
1646 | "Timestring for named serial numbers.") | |
1647 | ||
1648 | (defun named-database-print-serial () | |
1649 | "Print a serial number based on the current date." | |
1650 | (interactive) | |
d8677156 | 1651 | (insert (format-time-string named-database-time-string (current-time)))) |
ffe0c7ef | 1652 | |
d8677156 LK |
1653 | (define-generic-mode resolve-conf-generic-mode |
1654 | ;; List of comment characters | |
82e38f3e | 1655 | '(?#) |
d8677156 | 1656 | ;; List of keywords |
82e38f3e | 1657 | '("nameserver" "domain" "search" "sortlist" "options") |
d8677156 | 1658 | ;; List of additional font-lock-expressions |
ffe0c7ef | 1659 | nil |
d8677156 | 1660 | ;; List of additional automode-alist expressions |
82e38f3e | 1661 | '("/etc/resolv[e]?.conf\\'") |
d8677156 LK |
1662 | ;; List of set up functions to call |
1663 | nil) | |
ffe0c7ef PB |
1664 | |
1665 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
1666 | ;; Modes for spice and common electrical engineering circuit netlist formats | |
1667 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
1668 | ||
d8677156 | 1669 | (define-generic-mode spice-generic-mode |
ffe0c7ef | 1670 | nil |
82e38f3e LK |
1671 | '("and" |
1672 | "cccs" | |
1673 | "ccvs" | |
1674 | "delay" | |
1675 | "nand" | |
1676 | "nor" | |
1677 | "npwl" | |
1678 | "or" | |
1679 | "par" | |
1680 | "ppwl" | |
1681 | "pwl" | |
1682 | "vccap" | |
1683 | "vccs" | |
1684 | "vcr" | |
1685 | "vcvs") | |
1686 | '(("^\\s-*\\([*].*\\)" 1 font-lock-comment-face) | |
1687 | (" \\(\\$ .*\\)$" 1 font-lock-comment-face) | |
1688 | ("^\\(\\$ .*\\)$" 1 font-lock-comment-face) | |
1689 | ("\\([*].*\\)" 1 font-lock-comment-face) | |
1690 | ("^\\([+]\\)" 1 font-lock-string-face) | |
1691 | ("^\\s-*\\([.]\\w+\\>\\)" 1 font-lock-keyword-face) | |
1692 | ("\\(\\([.]\\|_\\|\\w\\)+\\)\\s-*=" 1 font-lock-variable-name-face) | |
1693 | ("\\('[^']+'\\)" 1 font-lock-string-face) | |
1694 | ("\\(\"[^\"]+\"\\)" 1 font-lock-string-face)) | |
1695 | '("\\.[sS][pP]\\'" | |
1696 | "\\.[sS][pP][iI]\\'" | |
1697 | "\\.[sS][pP][iI][cC][eE]\\'" | |
1698 | "\\.[iI][nN][cC]\\'") | |
ffe0c7ef PB |
1699 | (list |
1700 | 'generic-bracket-support | |
1701 | ;; Make keywords case-insensitive | |
1702 | (function | |
1703 | (lambda() | |
82e38f3e | 1704 | (setq font-lock-defaults '(generic-font-lock-defaults nil t))))) |
d8677156 | 1705 | "Generic mode for SPICE circuit netlist files.") |
ffe0c7ef | 1706 | |
d8677156 | 1707 | (define-generic-mode ibis-generic-mode |
82e38f3e | 1708 | '(?|) |
ffe0c7ef | 1709 | nil |
82e38f3e LK |
1710 | '(("[[]\\([^]]*\\)[]]" 1 font-lock-keyword-face) |
1711 | ("\\(\\(_\\|\\w\\)+\\)\\s-*=" 1 font-lock-variable-name-face)) | |
1712 | '("\\.[iI][bB][sS]\\'") | |
1713 | '(generic-bracket-support) | |
d8677156 | 1714 | "Generic mode for IBIS circuit netlist files.") |
ffe0c7ef | 1715 | |
d8677156 | 1716 | (define-generic-mode astap-generic-mode |
ffe0c7ef | 1717 | nil |
82e38f3e LK |
1718 | '("analyze" |
1719 | "description" | |
1720 | "elements" | |
1721 | "execution" | |
1722 | "features" | |
1723 | "functions" | |
1724 | "ground" | |
1725 | "model" | |
1726 | "outputs" | |
1727 | "print" | |
1728 | "run" | |
1729 | "controls" | |
1730 | "table") | |
1731 | '(("^\\s-*\\([*].*\\)" 1 font-lock-comment-face) | |
1732 | (";\\s-*\\([*].*\\)" 1 font-lock-comment-face) | |
1733 | ("^\\s-*\\([.]\\w+\\>\\)" 1 font-lock-keyword-face) | |
1734 | ("\\('[^']+'\\)" 1 font-lock-string-face) | |
1735 | ("\\(\"[^\"]+\"\\)" 1 font-lock-string-face) | |
1736 | ("[(,]\\s-*\\(\\([.]\\|_\\|\\w\\)+\\)\\s-*=" 1 font-lock-variable-name-face)) | |
1737 | '("\\.[aA][pP]\\'" | |
1738 | "\\.[aA][sS][xX]\\'" | |
1739 | "\\.[aA][sS][tT][aA][pP]\\'" | |
1740 | "\\.[pP][sS][pP]\\'" | |
1741 | "\\.[dD][eE][cC][kK]\\'" | |
1742 | "\\.[gG][oO][dD][aA][tT][aA]") | |
ffe0c7ef PB |
1743 | (list |
1744 | 'generic-bracket-support | |
1745 | ;; Make keywords case-insensitive | |
1746 | (function | |
1747 | (lambda() | |
82e38f3e | 1748 | (setq font-lock-defaults '(generic-font-lock-defaults nil t))))) |
d8677156 | 1749 | "Generic mode for ASTAP circuit netlist files.") |
ffe0c7ef | 1750 | |
d8677156 LK |
1751 | (define-generic-mode etc-modules-conf-generic-mode |
1752 | ;; List of comment characters | |
82e38f3e | 1753 | '(?#) |
d8677156 | 1754 | ;; List of keywords |
82e38f3e LK |
1755 | '("above" |
1756 | "alias" | |
1757 | "below" | |
1758 | "define" | |
1759 | "depfile" | |
1760 | "else" | |
1761 | "elseif" | |
1762 | "endif" | |
1763 | "if" | |
1764 | "include" | |
1765 | "insmod_opt" | |
1766 | "install" | |
1767 | "keep" | |
1768 | "options" | |
1769 | "path" | |
1770 | "generic_stringfile" | |
1771 | "pcimapfile" | |
1772 | "isapnpmapfile" | |
1773 | "usbmapfile" | |
1774 | "parportmapfile" | |
1775 | "ieee1394mapfile" | |
1776 | "pnpbiosmapfile" | |
1777 | "probe" | |
1778 | "probeall" | |
1779 | "prune" | |
1780 | "post-install" | |
1781 | "post-remove" | |
1782 | "pre-install" | |
1783 | "pre-remove" | |
1784 | "remove" | |
1785 | "persistdir") | |
d8677156 | 1786 | ;; List of additional font-lock-expressions |
9845e669 | 1787 | nil |
d8677156 | 1788 | ;; List of additional automode-alist expressions |
82e38f3e | 1789 | '("/etc/modules.conf" "/etc/conf.modules") |
d8677156 LK |
1790 | ;; List of set up functions to call |
1791 | nil) | |
ffe0c7ef | 1792 | |
ca1e63a5 RS |
1793 | (provide 'generic-x) |
1794 | ||
ab5796a9 | 1795 | ;;; arch-tag: cde692a5-9ff6-4506-9999-c67999c2bdb5 |
ca1e63a5 | 1796 | ;;; generic-x.el ends here |