mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-16 19:00:55 -08:00
Use fixes to rul-generic-mode, contributed by "Rolf Sandau" <Rolf.Sandau@marconi.com>
Add etc-modules-conf-generic-mode
This commit is contained in:
parent
b9e316dd7f
commit
9845e6697b
1 changed files with 96 additions and 43 deletions
|
|
@ -845,6 +845,7 @@ you must reload generic-x to enable the specified modes."
|
||||||
|
|
||||||
;; InstallShield RUL files
|
;; InstallShield RUL files
|
||||||
;; Contributed by Alfred.Correira@Pervasive.Com
|
;; Contributed by Alfred.Correira@Pervasive.Com
|
||||||
|
;; Bugfixes by "Rolf Sandau" <Rolf.Sandau@marconi.com>
|
||||||
(and
|
(and
|
||||||
(memq 'rul-generic-mode generic-extras-enable-list)
|
(memq 'rul-generic-mode generic-extras-enable-list)
|
||||||
;;; build the regexp strings using regexp-opt
|
;;; build the regexp strings using regexp-opt
|
||||||
|
|
@ -1400,24 +1401,69 @@ you must reload generic-x to enable the specified modes."
|
||||||
)
|
)
|
||||||
"Function argument constants used in InstallShield 3 and 5.")
|
"Function argument constants used in InstallShield 3 and 5.")
|
||||||
|
|
||||||
|
(progn
|
||||||
|
(defvar rul-generic-mode-syntax-table nil
|
||||||
|
"Syntax table to use in rul-generic-mode buffers.")
|
||||||
|
|
||||||
|
(setq rul-generic-mode-syntax-table
|
||||||
|
(make-syntax-table c++-mode-syntax-table))
|
||||||
|
|
||||||
|
(modify-syntax-entry ?\r "> b" rul-generic-mode-syntax-table)
|
||||||
|
(modify-syntax-entry ?\n "> b" rul-generic-mode-syntax-table)
|
||||||
|
|
||||||
|
(cond
|
||||||
|
;; XEmacs 19 & 20 & 21
|
||||||
|
((memq '8-bit c-emacs-features)
|
||||||
|
(modify-syntax-entry ?/ ". 1456" rul-generic-mode-syntax-table)
|
||||||
|
(modify-syntax-entry ?* ". 23" rul-generic-mode-syntax-table)
|
||||||
|
)
|
||||||
|
;; Emacs 19 & 20
|
||||||
|
((memq '1-bit c-emacs-features)
|
||||||
|
(modify-syntax-entry ?/ ". 124b" rul-generic-mode-syntax-table)
|
||||||
|
(modify-syntax-entry ?* ". 23" rul-generic-mode-syntax-table)
|
||||||
|
)
|
||||||
|
;; incompatible
|
||||||
|
(t (error "Run Mode is incompatible with this version of Emacs"))
|
||||||
|
)
|
||||||
|
|
||||||
|
;; here manually instead
|
||||||
|
(defun generic-rul-mode-setup-function ()
|
||||||
|
(make-local-variable 'parse-sexp-ignore-comments)
|
||||||
|
(make-local-variable 'comment-start)
|
||||||
|
(make-local-variable 'comment-start-skip)
|
||||||
|
(make-local-variable 'comment-end)
|
||||||
|
(setq imenu-generic-expression
|
||||||
|
'((nil "^function\\s-+\\([A-Za-z0-9_]+\\)" 1))
|
||||||
|
parse-sexp-ignore-comments t
|
||||||
|
comment-end "*/"
|
||||||
|
comment-start "/*"
|
||||||
|
;; comment-end ""
|
||||||
|
;; comment-start "//"
|
||||||
|
;; comment-start-skip ""
|
||||||
|
)
|
||||||
|
;; (set-syntax-table rul-generic-mode-syntax-table)
|
||||||
|
(setq font-lock-syntax-table rul-generic-mode-syntax-table)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; moved mode-definition behind defun-definition to be warning-free - 15.11.02/RSan
|
||||||
(define-generic-mode 'rul-generic-mode
|
(define-generic-mode 'rul-generic-mode
|
||||||
;; Using "/*" and "*/" doesn't seem to be working right
|
;; Using "/*" and "*/" doesn't seem to be working right
|
||||||
(list "//")
|
(list "//" '("/*" . "*/" ))
|
||||||
installshield-statement-keyword-list
|
installshield-statement-keyword-list
|
||||||
(list
|
(list
|
||||||
;; preprocessor constructs
|
;; preprocessor constructs
|
||||||
'("#[ \t]*include[ \t]+\\(<[^>\"\n]+>\\)"
|
'("#[ \t]*include[ \t]+\\(<[^>\"\n]+>\\)"
|
||||||
1 font-lock-string-face)
|
1 font-lock-string-face)
|
||||||
'("#[ \t]*\\(\\sw+\\)\\>[ \t]*\\(\\sw+\\)?"
|
'("#[ \t]*\\(\\sw+\\)\\>[ \t]*\\(\\sw+\\)?"
|
||||||
(1 font-lock-constant-face)
|
(1 font-lock-reference-face)
|
||||||
(2 font-lock-variable-name-face nil t))
|
(2 font-lock-variable-name-face nil t))
|
||||||
;; indirect string constants
|
;; indirect string constants
|
||||||
'("\\(@[A-Za-z][A-Za-z0-9_]+\\)" 1 font-lock-builtin-face)
|
'("\\(@[A-Za-z][A-Za-z0-9_]+\\)" 1 font-lock-builtin-face)
|
||||||
;; gotos
|
;; gotos
|
||||||
'("[ \t]*\\(\\sw+:\\)" 1 font-lock-constant-face)
|
'("[ \t]*\\(\\sw+:\\)" 1 font-lock-reference-face)
|
||||||
'("\\<\\(goto\\)\\>[ \t]*\\(\\sw+\\)?"
|
'("\\<\\(goto\\)\\>[ \t]*\\(\\sw+\\)?"
|
||||||
(1 font-lock-keyword-face)
|
(1 font-lock-keyword-face)
|
||||||
(2 font-lock-constant-face nil t))
|
(2 font-lock-reference-face nil t))
|
||||||
;; system variables
|
;; system variables
|
||||||
(generic-make-keywords-list
|
(generic-make-keywords-list
|
||||||
installshield-system-variables-list
|
installshield-system-variables-list
|
||||||
|
|
@ -1436,14 +1482,9 @@ you must reload generic-x to enable the specified modes."
|
||||||
'font-lock-variable-name-face "[^_]" "[^_]") ; is this face the best choice?
|
'font-lock-variable-name-face "[^_]" "[^_]") ; is this face the best choice?
|
||||||
)
|
)
|
||||||
(list "\\.[rR][uU][lL]$")
|
(list "\\.[rR][uU][lL]$")
|
||||||
(list
|
(list 'generic-rul-mode-setup-function)
|
||||||
(function
|
|
||||||
(lambda ()
|
|
||||||
(setq imenu-generic-expression
|
|
||||||
'((nil "^function\\s-+\\([A-Za-z0-9_]+\\)" 1)))
|
|
||||||
)))
|
|
||||||
"Generic mode for InstallShield RUL files.")
|
"Generic mode for InstallShield RUL files.")
|
||||||
|
)
|
||||||
(define-skeleton rul-if
|
(define-skeleton rul-if
|
||||||
"Insert an if statement."
|
"Insert an if statement."
|
||||||
"condition: "
|
"condition: "
|
||||||
|
|
@ -1835,6 +1876,18 @@ you must reload generic-x to enable the specified modes."
|
||||||
"Generic mode for ASTAP circuit netlist files."
|
"Generic mode for ASTAP circuit netlist files."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
(define-generic-mode 'etc-modules-conf-generic-mode
|
||||||
|
;;List of comment characters
|
||||||
|
(list ?#)
|
||||||
|
;;List of keywords
|
||||||
|
(list "alias" "pre-install" "post-install" "options" "probeall")
|
||||||
|
;;List of additional font-lock-expressions
|
||||||
|
nil
|
||||||
|
;;List of additional automode-alist expressions
|
||||||
|
(list "/etc/modules.conf" "/etc/conf.modules")
|
||||||
|
;;List of set up functions to call
|
||||||
|
nil
|
||||||
|
)
|
||||||
|
|
||||||
(provide 'generic-x)
|
(provide 'generic-x)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue