Commit ffe0c7ef authored by Peter Breton's avatar Peter Breton
Browse files

Added new InstallShield keywords.

Change font-lock-reference-face to font-lock-constant-face throughout.

(resolve-conf-generic-mode): Added this mode.
(named-database-generic-mode): Added this mode.
(named-boot-generic-mode): Added this mode.
(apache-conf-generic-mode): Added Directories and Locations to imenu-generic-expression.
(generic-define-mswindows-modes): Added apache-conf-generic-mode and apache-log-generic-mode.
(generic-define-unix-modes): Added apache-conf-generic-mode and apache-log-generic-mode.
(apache-conf-generic-mode): This new mode replaces apache-generic-mode.
(apache-log-generic-mode): Added this generic-mode
parent 83346ee8
......@@ -73,7 +73,7 @@
;; The erroronous lines in `generic-extras' look like the following (this
;; example is from the `ini' section):
;;
;; '(("^\\(\\[.*\\]\\)" 1 'font-lock-reference-face)
;; '(("^\\(\\[.*\\]\\)" 1 'font-lock-constant-face)
;; ("^\\(.*\\)=" 1 'font-lock-variable-name-face)
;;
;; The intention of these lines is to highlight lines of the following
......@@ -131,18 +131,24 @@ you must reload generic-x to enable the specified modes."
(append (list 'bat-generic-mode 'ini-generic-mode
'inf-generic-mode 'rc-generic-mode
'reg-generic-mode 'rul-generic-mode
'hosts-generic-mode 'apache-generic-mode)
'hosts-generic-mode
'apache-conf-generic-mode
'apache-log-generic-mode
)
generic-extras-enable-list)))
(and generic-define-unix-modes
(setq generic-extras-enable-list
(append (list 'apache-generic-mode 'samba-generic-mode
(append (list 'apache-conf-generic-mode
'apache-log-generic-mode
'samba-generic-mode
'hosts-generic-mode 'fvwm-generic-mode
'x-resource-generic-mode
'alias-generic-mode
'inetd-conf-generic-mode
'etc-services-generic-mode
'etc-passwd-generic-mode
'etc-fstab-generic-mode
)
generic-extras-enable-list)))
......@@ -152,22 +158,40 @@ you must reload generic-x to enable the specified modes."
;;; Apache
(and
(memq 'apache-generic-mode generic-extras-enable-list)
(memq 'apache-conf-generic-mode generic-extras-enable-list)
(define-generic-mode 'apache-generic-mode
(define-generic-mode 'apache-conf-generic-mode
(list ?#)
nil
'(("^\\(<.*>\\)" 1 'font-lock-reference-face)
'(("^\\(<.*>\\)" 1 'font-lock-constant-face)
("^\\(\\sw+\\)\\s-" 1 'font-lock-variable-name-face))
(list "srm\\.conf\\'" "httpd\\.conf\\'" "access\\.conf\\'")
(list
(function
(lambda ()
(setq imenu-generic-expression
'((nil "^\\([-A-Za-z0-9_]+\\)" 1)))
'((nil "^\\([-A-Za-z0-9_]+\\)" 1)
("*Directories*" "^\\s-*<Directory\\s-*\\([^>]+\\)>" 1)
("*Locations*" "^\\s-*<Location\\s-*\\([^>]+\\)>" 1)
))
)))
"Generic mode for Apache or HTTPD configuration files."))
(and
(memq 'apache-log-generic-mode generic-extras-enable-list)
(define-generic-mode 'apache-log-generic-mode
nil
nil
;; Hostname ? user date request return-code number-of-bytes
'(("^\\([-a-zA-z0-9.]+\\) - [-A-Za-z]+ \\(\\[.*\\]\\)"
(1 font-lock-constant-face)
(2 font-lock-variable-name-face))
)
(list "access_log\\'")
nil
"Mode for Apache log files"))
;;; Samba
(and
(memq 'samba-generic-mode generic-extras-enable-list)
......@@ -176,7 +200,7 @@ you must reload generic-x to enable the specified modes."
(list ?\; ?#)
nil
'(
("^\\(\\[.*\\]\\)" 1 'font-lock-reference-face)
("^\\(\\[.*\\]\\)" 1 'font-lock-constant-face)
("^\\s-*\\(.+\\)=\\([^\r\n]*\\)"
(1 'font-lock-variable-name-face)
(2 'font-lock-type-face))
......@@ -223,7 +247,7 @@ you must reload generic-x to enable the specified modes."
(list ?!)
nil
'(("^\\([^:\n]+:\\)" 1 'font-lock-variable-name-face))
(list "\\.Xdefaults\\'" "\\.Xresources\\'")
(list "\\.Xdefaults\\'" "\\.Xresources\\'" "\\.Xenvironment\\'" "\\.ad\\'")
nil
"Generic mode for X Resource configuration files."))
......@@ -234,7 +258,7 @@ you must reload generic-x to enable the specified modes."
(define-generic-mode 'hosts-generic-mode
(list ?#)
(list "localhost")
'(("\\([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\\)" 1 'font-lock-reference-face))
'(("\\([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\\)" 1 'font-lock-constant-face))
(list "[hH][oO][sS][tT][sS]\\'")
nil
"Generic mode for HOSTS files."))
......@@ -246,7 +270,7 @@ you must reload generic-x to enable the specified modes."
(define-generic-mode 'inf-generic-mode
(list ?\;)
nil
'(("^\\(\\[.*\\]\\)" 1 'font-lock-reference-face))
'(("^\\(\\[.*\\]\\)" 1 'font-lock-constant-face))
(list "\\.[iI][nN][fF]\\'")
(list 'generic-bracket-support)
"Generic mode for MS-Windows INF files."))
......@@ -259,7 +283,7 @@ you must reload generic-x to enable the specified modes."
(define-generic-mode 'ini-generic-mode
(list ?\;)
nil
'(("^\\(\\[.*\\]\\)" 1 'font-lock-reference-face)
'(("^\\(\\[.*\\]\\)" 1 'font-lock-constant-face)
("^\\([^=\n\r]*\\)=\\([^\n\r]*\\)$"
(1 font-lock-function-name-face)
(2 font-lock-variable-name-face)))
......@@ -281,7 +305,7 @@ you must reload generic-x to enable the specified modes."
(define-generic-mode 'reg-generic-mode
'(?\;)
'("key" "classes_root" "REGEDIT" "REGEDIT4")
'(("\\(\\[.*]\\)" 1 'font-lock-reference-face)
'(("\\(\\[.*]\\)" 1 'font-lock-constant-face)
("^\\([^\n\r]*\\)\\s-*=" 1 'font-lock-variable-name-face))
'("\\.[rR][eE][gG]\\'")
(list
......@@ -412,7 +436,7 @@ you must reload generic-x to enable the specified modes."
(list ?#)
(list "SAVE" "DELETE" "PIPE" "ANNOTATE" "REJECT")
'(("^\\(\\sw+\\)\\s-*=" 1 'font-lock-variable-name-face)
("\\s-/\\([^/]+\\)/[i, \t\n]" 1 'font-lock-reference-face))
("\\s-/\\([^/]+\\)/[i, \t\n]" 1 'font-lock-constant-face))
(list "\\.rules\\'")
(list 'mailagent-rules-setup-function)
"Mode for Mailagent rules files.")
......@@ -432,10 +456,10 @@ you must reload generic-x to enable the specified modes."
nil
'(
("^\\([0-9]\\)?\\s-*\\([a-z]\\)\\s-+\\([A-Za-z_]+\\)\\s-+\\([^\n\r]*\\)$"
(2 font-lock-reference-face)
(2 font-lock-constant-face)
(3 font-lock-keyword-face))
("^\\([a-z]\\) \\([A-Za-z_]+\\)=\\([^\n\r]*\\)$"
(1 font-lock-reference-face)
(1 font-lock-constant-face)
(2 font-lock-keyword-face)
(3 font-lock-variable-name-face))
("^\\(!\\s-*\\(search\\|include\\|default\\)\\)\\s-*\\([^\n\r]*\\)$"
......@@ -466,21 +490,75 @@ you must reload generic-x to enable the specified modes."
"Mode for Sys V pkginfo files."))
;; Javascript mode
;; Includes extra keywords from Armando Singer [asinger@MAIL.COLGATE.EDU]
(define-generic-mode 'javascript-generic-mode
(list "//")
(list
"document"
"break"
"case"
"continue"
"default"
"delete"
"do"
"else"
"function"
"export"
"for"
"function"
"if"
"then"
"import"
"in"
"new"
"return"
"switch"
"this"
"typeof"
"var"
"void"
"while"
"with"
;; words reserved for ECMA extensions below
"catch"
"class"
"const"
"debugger"
"enum"
"extends"
"finally"
"super"
"throw"
"try"
;; Java Keywords reserved by JavaScript
"abstract"
"boolean"
"byte"
"char"
"double"
"false"
"final"
"float"
"goto"
"implements"
"instanceof"
"int"
"interface"
"long"
"native"
"null"
"package"
"private"
"protected"
"public"
"short"
"static"
"synchronized"
"throws"
"transient"
"true"
)
(list
(list "^\\s-*function\\s-+\\([A-Za-z0-9]+\\)"
(list "^\\s-*function\\s-+\\([A-Za-z0-9_]+\\)"
'(1 font-lock-function-name-face))
(list "^\\s-*var\\s-+\\([A-Za-z0-9]+\\)"
(list "^\\s-*var\\s-+\\([A-Za-z0-9_]+\\)"
'(1 font-lock-variable-name-face))
)
(list "\\.js\\'")
......@@ -488,7 +566,9 @@ you must reload generic-x to enable the specified modes."
(function
(lambda ()
(setq imenu-generic-expression
'((nil "^function\\s-+\\([A-Za-z0-9_]+\\)" 1)))
'((nil "^function\\s-+\\([A-Za-z0-9_]+\\)" 1)
("*Variables*" "^var\\s-+\\([A-Za-z0-9_]+\\)" 1)
))
)))
"Mode for JavaScript files.")
......@@ -527,10 +607,10 @@ you must reload generic-x to enable the specified modes."
)
(list
(list "USE\\s-+\\([-A-Za-z0-9_]+\\)"
'(1 font-lock-reference-face))
'(1 font-lock-constant-face))
(list "DEF\\s-+\\([-A-Za-z0-9_]+\\)\\s-+\\([A-Za-z0-9]+\\)\\s-*{"
'(1 font-lock-type-face)
'(2 font-lock-reference-face))
'(2 font-lock-constant-face))
(list "^\\s-*\\([-A-Za-z0-9_]+\\)\\s-*{"
'(1 font-lock-function-name-face))
(list
......@@ -565,9 +645,9 @@ you must reload generic-x to enable the specified modes."
'(("^Name:\\s-+\\([^\n\r]*\\)$"
(1 font-lock-variable-name-face))
("^\\(Manifest\\|Required\\|Signature\\)-Version:\\s-+\\([^\n\r]*\\)$"
(2 font-lock-reference-face))
(2 font-lock-constant-face))
)
(list "manifest\\.mf\\'")
(list "[mM][aA][nN][iI][fF][eE][sS][tT]\\.[mM][fF]\\'")
nil
"Mode for Java Manifest files")
......@@ -589,11 +669,11 @@ you must reload generic-x to enable the specified modes."
(lambda (elt)
(list
(concat "^" java-properties-key elt java-properties-value "$")
'(1 font-lock-reference-face)
'(1 font-lock-constant-face)
'(4 font-lock-variable-name-face)
)))
;; These are the separators
(list ":\\s-+" "\\s-+" "\\s-*=\\s-*")
(list ":\\s-*" "\\s-+" "\\s-*=\\s-*")
)
)
nil
......@@ -713,9 +793,9 @@ you must reload generic-x to enable the specified modes."
'("^#[ \t]*define[ \t]+\\(\\sw+\\)(" 1 font-lock-function-name-face)
'("^#[ \t]*\\(elif\\|if\\)\\>"
("\\<\\(defined\\)\\>[ \t]*(?\\(\\sw+\\)?" nil nil
(1 font-lock-reference-face) (2 font-lock-variable-name-face nil t)))
(1 font-lock-constant-face) (2 font-lock-variable-name-face nil t)))
'("^#[ \t]*\\(\\sw+\\)\\>[ \t]*\\(\\sw+\\)?"
(1 font-lock-reference-face) (2 font-lock-variable-name-face nil t)))
(1 font-lock-constant-face) (2 font-lock-variable-name-face nil t)))
(list "\\.[rR][cC]$")
nil
"Generic mode for MS-Windows Resource files."))
......@@ -780,6 +860,7 @@ you must reload generic-x to enable the specified modes."
"BatchGetFileName"
"BatchMoveEx"
"BatchSetFileName"
"ChangeDirectory"
"CloseFile"
"CmdGetHwndDlg"
"ComponentAddItem" ; differs between IS3 and IS5
......@@ -856,6 +937,7 @@ you must reload generic-x to enable the specified modes."
"GetExtents"
"GetFileInfo"
"GetLine"
"GetProfInt"
"GetProfString"
"GetSystemInfo"
"GetValidDrivesList"
......@@ -864,6 +946,7 @@ you must reload generic-x to enable the specified modes."
"InstallationInfo"
"Is"
"LaunchApp"
"LaunchAppAndWait"
"ListAddItem"
"ListAddString"
"ListCount"
......@@ -876,6 +959,7 @@ you must reload generic-x to enable the specified modes."
"ListGetNextItem"
"ListGetNextString"
"ListReadFromFile"
"ListSetCurrentItem"
"ListSetNextItem"
"ListSetNextString"
"ListSetIndex"
......@@ -899,7 +983,7 @@ you must reload generic-x to enable the specified modes."
"PlayMMedia" ; IS5 only
"ProgDefGroupType"
"RegDBCreateKeyEx"
"RegDbDeleteValue"
"RegDBDeleteValue"
"RegDBGetItem"
"RegDBKeyExist"
"RegDBSetItem"
......@@ -990,6 +1074,7 @@ you must reload generic-x to enable the specified modes."
"StrLength"
"StrRemoveLastSlash"
"StrToLower"
"StrToNum"
"StrToUpper"
"StrSub"
"VarRestore"
......@@ -1006,19 +1091,30 @@ you must reload generic-x to enable the specified modes."
(defvar installshield-system-variables-list
(list
"BATCH_INSTALL"
"CMDLINE"
"COMMONFILES"
"CORECOMPONENTHANDLING"
"DIALOGCACHE"
"ERRORFILENAME"
"FOLDER_DESKTOP"
"FOLDER_PROGRAMS"
"FOLDER_STARTMENU"
"FOLDER_STARTUP"
"INFOFILENAME"
"ISRES"
"ISUSER"
"ISVERSION"
"MEDIA"
"MODE"
"PROGRAMFILES"
"SELECTED_LANGUAGE"
"SRCDIR"
"SRCDISK"
"SUPPORTDIR"
"TARGETDIR"
"TARGETDISK"
"UNINST"
"WINDIR"
"WINDISK"
"WINMAJOR"
......@@ -1038,7 +1134,9 @@ you must reload generic-x to enable the specified modes."
"LIST"
"LONG"
"LOWORD"
"LPSTR"
"NUMBER"
"NUMBERLIST"
"POINTER"
"QUAD"
"RGB"
......@@ -1144,6 +1242,7 @@ you must reload generic-x to enable the specified modes."
"FILENAME"
"FIXED_DRIVE"
"FOLDER_DESKTOP"
"FOLDER_PROGRAMS"
"FOLDER_STARTMENU"
"FOLDER_STARTUP"
"FREEENVSPACE"
......@@ -1152,6 +1251,10 @@ you must reload generic-x to enable the specified modes."
"FONT_TITLE"
"GREATER_THAN"
"GREEN"
"HKEY_CLASSES_ROOT"
"HKEY_CURRENT_USER"
"HKEY_LOCAL_MACHINE"
"HKEY_USERS"
"HOURGLASS"
"INCLUDE_SUBDIR"
"INDVFILESTATUS"
......@@ -1232,6 +1335,7 @@ you must reload generic-x to enable the specified modes."
"SW_MINIMIZE"
"SW_RESTORE"
"SW_SHOW"
"SYS_BOOTMACHINE"
"TIME"
"TRUE"
"TYPICAL"
......@@ -1262,15 +1366,15 @@ you must reload generic-x to enable the specified modes."
'("#[ \t]*include[ \t]+\\(<[^>\"\n]+>\\)"
1 font-lock-string-face)
'("#[ \t]*\\(\\sw+\\)\\>[ \t]*\\(\\sw+\\)?"
(1 font-lock-reference-face)
(1 font-lock-constant-face)
(2 font-lock-variable-name-face nil t))
;; indirect string constants
'("\\(@[A-Za-z][A-Za-z0-9_]+\\)" 1 font-lock-builtin-face)
;; gotos
'("[ \t]*\\(\\sw+:\\)" 1 font-lock-reference-face)
'("[ \t]*\\(\\sw+:\\)" 1 font-lock-constant-face)
'("\\<\\(goto\\)\\>[ \t]*\\(\\sw+\\)?"
(1 font-lock-keyword-face)
(2 font-lock-reference-face nil t))
(2 font-lock-constant-face nil t))
;; system variables
(generic-make-keywords-list
installshield-system-variables-list
......@@ -1338,9 +1442,9 @@ you must reload generic-x to enable the specified modes."
"unset"
)
'(("^\\s-*\\(alias\\|group\\)\\s-+\\([-A-Za-z0-9_]+\\)\\s-+\\([^\n\r#]*\\)\\(#.*\\)?$"
(2 font-lock-reference-face) (3 font-lock-variable-name-face))
(2 font-lock-constant-face) (3 font-lock-variable-name-face))
("^\\s-*\\(unset\\|set\\|ignore\\)\\s-+\\([-A-Za-z0-9_]+\\)=?\\([^\n\r#]*\\)\\(#.*\\)?$"
(2 font-lock-reference-face) (3 font-lock-variable-name-face)))
(2 font-lock-constant-face) (3 font-lock-variable-name-face)))
(list "\\.mailrc\\'")
nil
"Mode for mailrc files.")
......@@ -1433,7 +1537,7 @@ you must reload generic-x to enable the specified modes."
)
'(1 'font-lock-type-face)
'(5 'font-lock-variable-name-face)
'(6 'font-lock-reference-face)
'(6 'font-lock-constant-face)
'(7 'font-lock-warning-face)
)
'("^\\([^:]+\\):\\([^:]*\\):\\([0-9]+\\):\\(.*\\)$"
......@@ -1492,7 +1596,170 @@ you must reload generic-x to enable the specified modes."
nil
"Generic mode to show tabs and trailing spaces")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; DNS modes
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-generic-mode 'named-boot-generic-mode
;;List of comment characters
(list ?\;)
;;List of keywords
(list "cache" "primary" "secondary" "forwarders" "limit" "options"
"directory" "check-names")
;;List of additional font-lock-expressions
(list
(list "\\([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\\)" 1 'font-lock-constant-face)
(list "^directory\\s-+\\(.*\\)" 1 'font-lock-variable-name-face)
(list "^\\(primary\\|cache\\)\\s-+\\([.A-Za-z]+\\)\\s-+\\(.*\\)"
(list 2 'font-lock-variable-name-face)
(list 3 'font-lock-constant-face))
)
;;List of additional automode-alist expressions
(list "/etc/named.boot\\'")
;;List of set up functions to call
nil
)
(define-generic-mode 'named-database-generic-mode
;;List of comment characters
(list ?\;)
;;List of keywords
(list "IN" "NS" "CNAME" "SOA" "PTR" "MX" "A")
;;List of additional font-lock-expressions
(list
(list "\\([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\\)" 1 'font-lock-constant-face)
(list "^\\([.A-Za-z0-9]+\\)" 1 'font-lock-variable-name-face)
)
;;List of additional automode-alist expressions
nil
;;List of set up functions to call
nil
)
(defvar named-database-time-string "%Y%m%d%H"
"Timestring for named serial numbers.")
(defun named-database-print-serial ()
"Print a serial number based on the current date."
(interactive)
(insert (format-time-string named-database-time-string (current-time)))
)
(define-generic-mode 'resolve-conf-generic-mode
;;List of comment characters
(list ?#)
;;List of keywords
(list "nameserver" "domain" "search" "sortlist" "options")
;;List of additional font-lock-expressions
nil
;;List of additional automode-alist expressions
(list "/etc/resolv[e]?.conf\\'")
;;List of set up functions to call
nil
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Modes for spice and common electrical engineering circuit netlist formats
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-generic-mode 'spice-generic-mode
nil
(list
"and"
"cccs"
"ccvs"
"delay"
"nand"
"nor"
"npwl"
"or"
"par"
"ppwl"
"pwl"
"vccap"
"vccs"
"vcr"
"vcvs"
)
'(
("^\\s-*\\([*].*\\)" 1 'font-lock-comment-face)
(" \\(\\$ .*\\)$" 1 'font-lock-comment-face)
("^\\(\\$ .*\\)$" 1 'font-lock-comment-face)
("\\([*].*\\)" 1 'font-lock-comment-face)
("^\\([+]\\)" 1 'font-lock-string-face)
("^\\s-*\\([.]\\w+\\>\\)" 1 'font-lock-keyword-face)
("\\(\\([.]\\|_\\|\\w\\)+\\)\\s-*=" 1 'font-lock-variable-name-face)
("\\('[^']+'\\)" 1 'font-lock-string-face)
("\\(\"[^\"]+\"\\)" 1 'font-lock-string-face)
)
(list "\\.[sS][pP]\\'"
"\\.[sS][pP][iI]\\'"
"\\.[sS][pP][iI][cC][eE]\\'"
"\\.[iI][nN][cC]\\'")
(list
'generic-bracket-support
;; Make keywords case-insensitive
(function
(lambda()
(setq font-lock-defaults (list 'generic-font-lock-defaults nil t))))
)
"Generic mode for SPICE circuit netlist files."
)
(define-generic-mode 'ibis-generic-mode
(list ?|)
nil
'(
("[[]\\([^]]*\\)[]]" 1 'font-lock-keyword-face)
("\\(\\(_\\|\\w\\)+\\)\\s-*=" 1 'font-lock-variable-name-face)
)
(list "\\.[iI][bB][sS]\\'")
(list 'generic-bracket-support)
"Generic mode for IBIS circuit netlist files."
)
(define-generic-mode 'astap-generic-mode
nil
(list
"analyze"
"description"
"elements"
"execution"
"features"
"functions"
"ground"
"model"
"outputs"
"print"
"run"
"controls"
"table"
)
'(
("^\\s-*\\([*].*\\)" 1 'font-lock-comment-face)
(";\\s-*\\([*].*\\)" 1 'font-lock-comment-face)
("^\\s-*\\([.]\\w+\\>\\)" 1 'font-lock-keyword-face)
("\\('[^']+'\\)" 1 'font-lock-string-face)
("\\(\"[^\"]+\"\\)" 1 'font-lock-string-face)
("[(,]\\s-*\\(\\([.]\\|_\\|\\w\\)+\\)\\s-*=" 1 'font-lock-variable-name-face)
)
(list "\\.[aA][pP]\\'"
"\\.[aA][sS][xX]\\'"
"\\.[aA][sS][tT][aA][pP]\\'"
"\\.[pP][sS][pP]\\'"
"\\.[dD][eE][cC][kK]\\'"
"\\.[gG][oO][dD][aA][tT][aA]")
(list
'generic-bracket-support
;; Make keywords case-insensitive
(function
(lambda()
(setq font-lock-defaults (list 'generic-font-lock-defaults nil t))))
)
"Generic mode for ASTAP circuit netlist files."
)
(provide 'generic-x)
;;; generic-x.el ends here
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment