1 ;;; generic-x.el --- Extra Modes for generic-mode
3 ;; Copyright (C) 1997, 1998 Free Software Foundation, Inc.
5 ;; Author: Peter Breton <pbreton@cs.umb.edu>
6 ;; Created: Tue Oct 08 1996
7 ;; Keywords: generic, comment, font-lock
9 ;; This file is part of GNU Emacs.
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)
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.
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.
28 ;; This file contains some pre-defined generic-modes.
32 ;; Add this line to your .emacs file:
34 ;; (require 'generic-x)
36 ;; You can decide which modes to load by setting the variable
37 ;; `generic-extras-enable-list'. Some platform-specific modes are
38 ;; affected by the variables `generic-define-mswindows-modes' and
39 ;; `generic-define-unix-modes' (which see).
41 ;; You can also send in new modes; if the file types a reasonably common,
42 ;; we would like to install them.
44 ;; PROBLEMS WHEN USED WITH FOLDING MODE:
46 ;; From Anders Lindgren <andersl@csd.uu.se>
48 ;; Problem summary: Wayne Adams has found a problem when using folding
49 ;; mode in conjuction with font-lock for a mode defined in
52 ;; The problem, as Wayne described it, was that error messages of the
53 ;; following form appeared when both font-lock and folding are used:
55 ;; > - various msgs including "Fontifying region...(error Stack
56 ;; > overflow in regexp matcher)" appear
58 ;; I have just tracked down the cause of the problem. The regexp:s in
59 ;; `generic-x.el' does not take into account the way that folding
60 ;; hides sections of the buffer. The technique is known as
61 ;; `selective-display' and has been available for a very long time (I
62 ;; started using it back in the good old' Emacs 18 days). Basically, a
63 ;; section is hidden by creating one very long line were the newline
64 ;; character (C-j) is replaced by a linefeed (C-m) character.
66 ;; Many other hiding packages, besides folding, use the same technique,
67 ;; the problem should occur when using them as well.
69 ;; The erroronous lines in `generic-extras' look like the following (this
70 ;; example is from the `ini' section):
72 ;; '(("^\\(\\[.*\\]\\)" 1 'font-lock-reference-face)
73 ;; ("^\\(.*\\)=" 1 'font-lock-variable-name-face)
75 ;; The intention of these lines is to highlight lines of the following
81 ;; However, since the `.' regexp symbol match the linefeed character the
82 ;; entire folded section is searched, resulting in a regexp stack
85 ;; Solution suggestion 2: Instead of using ".", use the sequence
86 ;; "[^\n\r]". This will make the rules behave just as before, but they
87 ;; will work together with selective-display.
94 (defgroup generic-x nil
95 "Extra modes for generic mode."
100 (defcustom generic-extras-enable-list nil
101 "*List of generic modes to enable by default.
102 Each entry in the list should be a symbol.
103 The variables `generic-define-mswindows-modes' and `generic-define-unix-modes'
104 also affect which generic modes are defined.
105 Please note that if you set this variable after generic-x is loaded,
106 you must reload generic-x to enable the specified modes."
111 (defcustom generic-define-mswindows-modes
112 (memq system-type
(list 'windows-nt
'ms-dos
))
113 "*If non-nil, some MS-Windows specific generic modes will be defined."
118 (defcustom generic-define-unix-modes
119 (not (memq system-type
(list 'windows-nt
'ms-dos
)))
120 "*If non-nil, some Unix specific generic modes will be defined."
125 (and generic-define-mswindows-modes
126 (setq generic-extras-enable-list
127 (append (list 'bat-generic-mode
'ini-generic-mode
128 'inf-generic-mode
'rc-generic-mode
129 'reg-generic-mode
'rul-generic-mode
130 'hosts-generic-mode
'apache-generic-mode
)
131 generic-extras-enable-list
)))
133 (and generic-define-unix-modes
134 (setq generic-extras-enable-list
135 (append (list 'apache-generic-mode
'samba-generic-mode
136 'hosts-generic-mode
'fvwm-generic-mode
137 'x-resource-generic-mode
140 generic-extras-enable-list
)))
142 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
144 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
148 (memq 'apache-generic-mode generic-extras-enable-list
)
150 (define-generic-mode 'apache-generic-mode
153 '(("^\\(<.*>\\)" 1 'font-lock-reference-face
)
154 ("^\\(\\sw+\\)\\s-" 1 'font-lock-variable-name-face
))
155 (list "srm\\.conf\\'" "httpd\\.conf\\'" "access\\.conf\\'")
157 "Generic mode for Apache or HTTPD configuration files."))
161 (memq 'samba-generic-mode generic-extras-enable-list
)
163 (define-generic-mode 'samba-generic-mode
166 '(("^\\(\\[.*\\]\\)" 1 'font-lock-reference-face
))
167 (list "smb\\.conf\\'")
168 (list 'generic-bracket-support
)
169 "Generic mode for Samba configuration files."))
172 ;; This is pretty basic. Also, modes for other window managers could
173 ;; be defined as well.
175 (memq 'fvwm-generic-mode generic-extras-enable-list
)
177 (define-generic-mode 'fvwm-generic-mode
195 (list "\\.fvwmrc\\'" "\\.fvwm2rc\\'")
197 "Generic mode for FVWM configuration files."))
200 ;; I'm pretty sure I've seen an actual mode to do this, but I don't
201 ;; think it's standard with Emacs
203 (memq 'x-resource-generic-mode generic-extras-enable-list
)
205 (define-generic-mode 'x-resource-generic-mode
208 '(("^\\([^:\n]+:\\)" 1 'font-lock-variable-name-face
))
209 (list "\\.Xdefaults\\'" "\\.Xresources\\'")
211 "Generic mode for X Resource configuration files."))
215 (memq 'hosts-generic-mode generic-extras-enable-list
)
217 (define-generic-mode 'hosts-generic-mode
220 '(("\\([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\\)" 1 'font-lock-reference-face
))
221 (list "[hH][oO][sS][tT][sS]\\'")
223 "Generic mode for HOSTS files."))
225 ;;; Windows INF files
227 (memq 'inf-generic-mode generic-extras-enable-list
)
229 (define-generic-mode 'inf-generic-mode
232 '(("^\\(\\[.*\\]\\)" 1 'font-lock-reference-face
))
233 (list "\\.[iI][nN][fF]\\'")
234 (list 'generic-bracket-support
)
235 "Generic mode for MS-Windows INF files."))
237 ;;; Windows INI files
238 ;; Should define escape character as well!
240 (memq 'ini-generic-mode generic-extras-enable-list
)
242 (define-generic-mode 'ini-generic-mode
245 '(("^\\(\\[.*\\]\\)" 1 'font-lock-reference-face
)
246 ("^\\([^=\n\r]*\\)=\\([^\n\r]*\\)$"
247 (1 font-lock-function-name-face
)
248 (2 font-lock-variable-name-face
)))
249 (list "\\.[iI][nN][iI]\\'")
253 (setq imenu-generic-expression
254 '((nil "^\\[\\(.*\\)\\]" 1)
255 ("*Variables*" "^\\s-*\\([^=]+\\)\\s-*=" 1)))
257 "Generic mode for MS-Windows INI files."))
259 ;;; Windows REG files
260 ;;; Unfortunately, Windows 95 and Windows NT have different REG file syntax!
262 (memq 'reg-generic-mode generic-extras-enable-list
)
264 (define-generic-mode 'reg-generic-mode
266 '("key" "classes_root" "REGEDIT" "REGEDIT4")
267 '(("\\(\\[.*]\\)" 1 'font-lock-reference-face
)
268 ("^\\([^\n\r]*\\)\\s-*=" 1 'font-lock-variable-name-face
))
269 '("\\.[rR][eE][gG]\\'")
273 (setq imenu-generic-expression
274 '((nil "^\\s-*\\(.*\\)\\s-*=" 1))))))
275 "Generic mode for MS-Windows Registry files."))
277 ;;; DOS/Windows BAT files
278 (if (not (memq 'bat-generic-mode generic-extras-enable-list
))
280 (define-generic-mode 'bat-generic-mode
284 ;; Make this one first in the list, otherwise comments will
285 ;; be over-written by other variables
286 (list "^[@ \t]*\\([rR][eE][mM][^\n\r]*\\)" 1 'font-lock-comment-face t
)
287 (list "^[ \t]*\\(::-.*\\)" 1 'font-lock-comment-face t
)
289 "^[@ \t]*\\([bB][rR][eE][aA][kK]\\|[vV][eE][rR][iI][fF][yY]\\)[ \t]+\\([oO]\\([nN]\\|[fF][fF]\\)\\)"
290 '(1 font-lock-builtin-face
)
291 '(2 font-lock-constant-face
'append t
))
292 ;; Any text (except ON/OFF) following ECHO is a string.
294 "^[@ \t]*\\([eE][cC][hH][oO]\\)[ \t]+\\(\\([oO]\\([nN]\\|[fF][fF]\\)\\)\\|\\([^>|\r\n]+\\)\\)"
295 '(1 font-lock-builtin-face
)
296 '(3 font-lock-constant-face t t
)
297 '(5 font-lock-string-face t t
))
298 ;; These keywords appear as the first word on a line. (Actually, they
299 ;; can also appear after "if ..." or "for ..." clause, but since they
300 ;; are frequently used in simple text, we punt.)
301 (generic-make-keywords-list
306 'font-lock-keyword-face
"^[@ \t]*")
307 ;; These keywords can be anywhere on a line
308 (generic-make-keywords-list
311 "EXIST" "exist" "Exist"
312 "ERRORLEVEL" "errorlevel" "ErrorLevel" "Errorlevel"
313 "GOTO" "goto" "GoTo" "Goto"
315 ) 'font-lock-keyword-face
"[ \t|\n]")
316 ; These are built-in commands. Only frequently-used ones are listed.
317 (generic-make-keywords-list
327 "PAUSE" "pause" "Pause"
328 "PROMPT" "prompt" "Prompt"
332 "START" "start" "Start"
333 "SHIFT" "shift" "Shift"
334 ) 'font-lock-builtin-face
"[ \t|\n]")
335 (list "^[ \t]*\\(:\\sw+\\)" 1 'font-lock-function-name-face t
)
336 (list "\\(%\\sw+%\\)" 1 'font-lock-variable-name-face t
)
337 (list "\\(%[0-9]\\)" 1 'font-lock-variable-name-face t
)
338 (list "\\(/[^/ \"\t\n]+\\)" 1 'font-lock-type-face
)
339 (list "[\t ]+\\([+-][^\t\n\" ]+\\)" 1 'font-lock-type-face
)
340 (list "[ \t\n|]\\<\\([gG][oO][tT][oO]\\)\\>[ \t]*\\(\\sw+\\)?"
341 '(1 font-lock-keyword-face
)
342 '(2 font-lock-function-name-face nil t
))
343 (list "[ \t\n|]\\<\\([sS][eE][tT]\\)\\>[ \t]*\\(\\sw+\\)?[ \t]*=?"
344 '(1 font-lock-builtin-face
)
345 '(2 font-lock-variable-name-face t t
))
350 "\\`[cC][oO][nN][fF][iI][gG]\\."
351 "\\`[aA][uU][tT][oO][eE][xX][eE][cC]\\." )
352 (list 'generic-bat-mode-setup-function
)
353 "Generic mode for MS-Windows BAT files.")
355 (defvar bat-generic-mode-syntax-table nil
356 "Syntax table in use in bat-generic-mode buffers.")
358 ;; Make underscores count as words
359 (if bat-generic-mode-syntax-table
361 (setq bat-generic-mode-syntax-table
(make-syntax-table))
362 (modify-syntax-entry ?_
"w" bat-generic-mode-syntax-table
))
364 ;; bat-generic-mode doesn't use the comment functionality of generic-mode
365 ;; because it has a three-letter comment-string, so we do it
366 ;; here manually instead
367 (defun generic-bat-mode-setup-function ()
368 (make-local-variable 'parse-sexp-ignore-comments
)
369 (make-local-variable 'comment-start
)
370 (make-local-variable 'comment-start-skip
)
371 (make-local-variable 'comment-end
)
372 (setq imenu-generic-expression
'((nil "^:\\(\\sw+\\)" 1))
373 parse-sexp-ignore-comments t
376 comment-start-skip
"[Rr][Ee][Mm] *"
378 (set-syntax-table bat-generic-mode-syntax-table
)
383 ;; Mailagent is a Unix mail filtering program. Anyone wanna do a generic mode
386 (memq 'mailagent-rules-generic-mode generic-extras-enable-list
)
388 (define-generic-mode 'mailagent-rules-generic-mode
390 (list "SAVE" "DELETE" "PIPE" "ANNOTATE" "REJECT")
391 '(("^\\(\\sw+\\)\\s-*=" 1 'font-lock-variable-name-face
)
392 ("\\s-/\\([^/]+\\)/[i, \t\n]" 1 'font-lock-reference-face
))
394 (list 'mailagent-rules-setup-function
)
395 "Mode for Mailagent rules files.")
397 (defun mailagent-rules-setup-function ()
398 (make-local-variable 'imenu-generic-expression
)
399 (setq imenu-generic-expression
400 '((nil "\\s-/\\([^/]+\\)/[i, \t\n]" 1))))
403 ;; Solaris/Sys V prototype files
405 (memq 'prototype-generic-mode generic-extras-enable-list
)
407 (define-generic-mode 'prototype-generic-mode
411 ("^\\([0-9]\\)?\\s-*\\([a-z]\\)\\s-+\\([A-Za-z_]+\\)\\s-+\\([^\n\r]*\\)$"
412 (2 font-lock-reference-face
)
413 (3 font-lock-keyword-face
))
414 ("^\\([a-z]\\) \\([A-Za-z_]+\\)=\\([^\n\r]*\\)$"
415 (1 font-lock-reference-face
)
416 (2 font-lock-keyword-face
)
417 (3 font-lock-variable-name-face
))
418 ("^\\(!\\s-*\\(search\\|include\\|default\\)\\)\\s-*\\([^\n\r]*\\)$"
419 (1 font-lock-keyword-face
)
420 (3 font-lock-variable-name-face
))
421 ("^\\(!\\s-*\\sw+\\)=\\([^\n\r]*\\)$"
422 (1 font-lock-keyword-face
)
423 (2 font-lock-variable-name-face
))
425 (list "prototype\\'")
427 "Mode for Sys V prototype files."))
429 ;; Solaris/Sys V pkginfo files
431 (memq 'pkginfo-generic-mode generic-extras-enable-list
)
433 (define-generic-mode 'pkginfo-generic-mode
437 ("^\\([A-Za-z_]+\\)=\\([^\n\r]*\\)$"
438 (1 font-lock-keyword-face
)
439 (2 font-lock-variable-name-face
))
443 "Mode for Sys V pkginfo files."))
446 (define-generic-mode 'javascript-generic-mode
458 (list "^\\s-*function\\s-+\\([A-Za-z0-9]+\\)"
459 '(1 font-lock-function-name-face
))
460 (list "^\\s-*var\\s-+\\([A-Za-z0-9]+\\)"
461 '(1 font-lock-variable-name-face
))
467 (setq imenu-generic-expression
468 '((nil "^function\\s-+\\([A-Za-z0-9_]+\\)" 1)))
470 "Mode for JavaScript files.")
473 (define-generic-mode 'vrml-generic-mode
506 (list "USE\\s-+\\([-A-Za-z0-9_]+\\)"
507 '(1 font-lock-reference-face
))
508 (list "DEF\\s-+\\([-A-Za-z0-9_]+\\)\\s-+\\([A-Za-z0-9]+\\)\\s-*{"
509 '(1 font-lock-type-face
)
510 '(2 font-lock-reference-face
))
511 (list "^\\s-*\\([-A-Za-z0-9_]+\\)\\s-*{"
512 '(1 font-lock-function-name-face
))
514 "^\\s-*\\(geometry\\|appearance\\|material\\)\\s-+\\([-A-Za-z0-9_]+\\)"
515 '(2 font-lock-variable-name-face
))
521 (setq imenu-generic-expression
522 '((nil "^\\([A-Za-z0-9_]+\\)\\s-*{" 1)
524 "DEF\\s-+\\([-A-Za-z0-9_]+\\)\\s-+\\([A-Za-z0-9]+\\)\\s-*{"
527 "Generic Mode for VRML files.")
530 (define-generic-mode 'java-manifest-generic-mode
542 '(("^Name:\\s-+\\([^\n\r]*\\)$"
543 (1 font-lock-variable-name-face
))
544 ("^\\(Manifest\\|Required\\|Signature\\)-Version:\\s-+\\([^\n\r]*\\)$"
545 (2 font-lock-reference-face
))
547 (list "manifest\\.mf\\'")
549 "Mode for Java Manifest files")
551 ;; Java properties files
552 (define-generic-mode 'java-properties-generic-mode
555 ;; Property and value can be separated with whitespace or an equal sign
556 '(("^\\([\\.A-Za-z0-9_]+\\)\\(\\s-+\\|\\(\\s-*=\\s-*\\)\\)\\([^\r\n]*\\)$"
557 (1 font-lock-reference-face
) (4 font-lock-variable-name-face
)))
560 "Mode for Java properties files.")
562 ;; C shell alias definitions
564 (memq 'alias-generic-mode generic-extras-enable-list
)
566 (define-generic-mode 'alias-generic-mode
568 (list "alias" "unalias")
569 '(("^alias\\s-+\\([-A-Za-z0-9_]+\\)\\s-+"
570 (1 font-lock-variable-name-face
))
571 ("^unalias\\s-+\\([-A-Za-z0-9_]+\\)\\s-*$"
572 (1 font-lock-variable-name-face
))
578 (setq imenu-generic-expression
579 '((nil "^\\(alias\\|unalias\\)\\s-+\\([-a-zA-Z0-9_]+\\)" 2)))
581 "Mode for C Shell alias files.")
585 ;; Contributed by ACorreir@pervasive-sw.com (Alfred Correira)
587 (memq 'rc-generic-mode generic-extras-enable-list
)
589 (define-generic-mode 'rc-generic-mode
645 ;; the choice of what tokens go where is somewhat arbitrary,
646 ;; as is the choice of which value tokens are included, as
647 ;; the choice of face for each token group
649 (generic-make-keywords-list
658 ) 'font-lock-type-face
)
659 (generic-make-keywords-list
665 ) 'font-lock-function-name-face
)
666 '("^#[ \t]*include[ \t]+\\(<[^>\"\n]+>\\)" 1 font-lock-string-face
)
667 '("^#[ \t]*define[ \t]+\\(\\sw+\\)(" 1 font-lock-function-name-face
)
668 '("^#[ \t]*\\(elif\\|if\\)\\>"
669 ("\\<\\(defined\\)\\>[ \t]*(?\\(\\sw+\\)?" nil nil
670 (1 font-lock-reference-face
) (2 font-lock-variable-name-face nil t
)))
671 '("^#[ \t]*\\(\\sw+\\)\\>[ \t]*\\(\\sw+\\)?"
672 (1 font-lock-reference-face
) (2 font-lock-variable-name-face nil t
)))
673 (list "\\.[rR][cC]$")
675 "Generic mode for MS-Windows Resource files."))
677 ;; InstallShield RUL files
678 ;; Contributed by Alfred.Correira@Pervasive.Com
680 (memq 'rul-generic-mode generic-extras-enable-list
)
681 ;;; build the regexp strings using regexp-opt
682 (defvar installshield-statement-keyword-list
702 ;; "goto" -- handled elsewhere
717 "Statement keywords used in InstallShield 3 and 5.")
719 (defvar installshield-system-functions-list
739 "ComponentAddItem" ; differs between IS3 and IS5
740 "ComponentCompareSizeRequired" ; IS5 only
742 "ComponentError" ; IS5 only
743 "ComponentFileEnum" ; IS5 only
744 "ComponentFileInfo" ; IS5 only
745 "ComponentFilterLanguage" ; IS5 only
746 "ComponentFilterOS" ; IS5 only
747 "ComponentGetData" ; IS5 only
748 "ComponentGetItemInfo" ; IS3 only
749 "ComponentGetItemSize" ; differs between IS3 and IS5
750 "ComponentIsItemSelected" ; differs between IS3 and IS5
752 "ComponentMoveData" ; IS5 only
753 "ComponentSelectItem" ; differs between IS3 and IS5
754 "ComponentSetData" ; IS5 only
755 "ComponentSetItemInfo" ; IS3 only
756 "ComponentSetTarget" ; IS5 only
757 "ComponentSetupTypeEnum" ; IS5 only
758 "ComponentSetupTypeGetData" ; IS5 only
759 "ComponentSetupTypeSet" ; IS5 only
761 "ComponentValidate" ; IS5 only
762 "CompressAdd" ; IS3 only
763 "CompressDel" ; IS3 only
764 "CompressEnum" ; IS3 only
765 "CompressGet" ; IS3 only
766 "CompressInfo" ; IS3 only
770 "CreateProgramFolder"
771 "DeinstallSetReference" ; IS5 only
797 "FileSetBeginDefine" ; IS3 only
798 "FileSetEndDefine" ; IS3 only
799 "FileSetPerformEz" ; IS3 only
800 "FileSetPerform" ; IS3 only
801 "FileSetReset" ; IS3 only
802 "FileSetRoot" ; IS3 only
838 "LongPathToShortPath"
853 "PlayMMedia" ; IS5 only
862 "RegDBSetDefaultRoot"
871 "SdComponentAdvCheckSpace"
873 "SdComponentAdvUpdateSpace"
876 "SdComponentDialogAdv"
877 "SdComponentDialogEx"
878 "SdComponentDlgCheckSpace"
881 "SdConfirmRegistration"
893 "SdGetUserCompanyInfo"
902 "SdOptionsButtonsInit"
903 "SdPlugInProductName"
906 "SdRegExEnableButton"
911 "SdSetSequentialItems"
913 "SdSetupTypeEx" ; IS5 only
924 "SdUpdateComponentSelection"
930 "SetDisplayEffect" ; IS5 only
932 "SetForegroundWindow"
959 "System functions defined in InstallShield 3 and 5.")
961 (defvar installshield-system-variables-list
964 "CORECOMPONENTHANDLING"
982 "System variables used in InstallShield 3 and 5.")
984 (defvar installshield-types-list
1003 "Type keywords used in InstallShield 3 and 5.")
1005 ;;; some might want to skip highlighting these to improve performance
1006 (defvar installshield-funarg-constants-list
1037 "COMP_UPDATE_VERSION"
1056 "DLG_INFO_CHECKSELECTION"
1058 "DLG_INFO_USEDECIMAL"
1059 "DLG_MSG_INFORMATION"
1080 "FILE_ATTR_ARCHIVED"
1081 "FILE_ATTR_DIRECTORY"
1084 "FILE_ATTR_READONLY"
1090 "FILE_MODE_BINARYREADONLY"
1152 "REGDB_APPPATH_DEFAULT"
1155 "REGDB_ERR_CONNECTIONEXISTS"
1156 "REGDB_ERR_CORRUPTEDREGSITRY"
1157 "REGDB_ERR_INITIALIZATION"
1158 "REGDB_ERR_INVALIDHANDLE"
1159 "REGDB_ERR_INVALIDNAME"
1161 "REGDB_STRING_EXPAND"
1162 "REGDB_STRING_MULTI"
1164 "REGDB_UNINSTALL_NAME"
1208 "Function argument constants used in InstallShield 3 and 5.")
1210 (define-generic-mode 'rul-generic-mode
1211 ;; Using "/*" and "*/" doesn't seem to be working right
1213 installshield-statement-keyword-list
1215 ;; preprocessor constructs
1216 '("#[ \t]*include[ \t]+\\(<[^>\"\n]+>\\)"
1217 1 font-lock-string-face
)
1218 '("#[ \t]*\\(\\sw+\\)\\>[ \t]*\\(\\sw+\\)?"
1219 (1 font-lock-reference-face
)
1220 (2 font-lock-variable-name-face nil t
))
1221 ;; indirect string constants
1222 '("\\(@[A-Za-z][A-Za-z0-9_]+\\)" 1 font-lock-builtin-face
)
1224 '("[ \t]*\\(\\sw+:\\)" 1 font-lock-reference-face
)
1225 '("\\<\\(goto\\)\\>[ \t]*\\(\\sw+\\)?"
1226 (1 font-lock-keyword-face
)
1227 (2 font-lock-reference-face nil t
))
1229 (generic-make-keywords-list
1230 installshield-system-variables-list
1231 'font-lock-variable-name-face
"[^_]" "[^_]")
1233 (generic-make-keywords-list
1234 installshield-system-functions-list
1235 'font-lock-function-name-face
"[^_]" "[^_]")
1237 (generic-make-keywords-list
1238 installshield-types-list
1239 'font-lock-type-face
"[^_]" "[^_]")
1240 ;; function argument constants
1241 (generic-make-keywords-list
1242 installshield-funarg-constants-list
1243 'font-lock-variable-name-face
"[^_]" "[^_]") ; is this face the best choice?
1245 (list "\\.[rR][uU][lL]$")
1249 (setq imenu-generic-expression
1250 '((nil "^function\\s-+\\([A-Za-z0-9_]+\\)" 1)))
1252 "Generic mode for InstallShield RUL files.")
1254 (define-skeleton rul-if
1255 "Insert an if statement."
1257 "if(" str
") then" \n
1259 ( "other condition, %s: "
1260 > "elseif(" str
") then" \n
1268 (define-skeleton rul-function
1269 "Insert a function statement."
1271 "function " str
" ()" \n
1272 ( "local variables, %s: "
1281 ;; Additions by ACorreir@pervasive-sw.com (Alfred Correira)
1282 (define-generic-mode 'mailrc-generic-mode
1294 '(("^\\s-*\\(alias\\|group\\)\\s-+\\([-A-Za-z0-9_]+\\)\\s-+\\([^\n\r#]*\\)\\(#.*\\)?$"
1295 (2 font-lock-reference-face
) (3 font-lock-variable-name-face
))
1296 ("^\\s-*\\(unset\\|set\\|ignore\\)\\s-+\\([-A-Za-z0-9_]+\\)=?\\([^\n\r#]*\\)\\(#.*\\)?$"
1297 (2 font-lock-reference-face
) (3 font-lock-variable-name-face
)))
1298 (list "\\.mailrc\\'")
1300 "Mode for mailrc files.")
1302 (provide 'generic-x
)
1304 ;;; generic-x.el ends here