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