aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Breton2003-03-22 13:00:38 +0000
committerPeter Breton2003-03-22 13:00:38 +0000
commit9845e6697b5ed3739bcd78de13428db4173f0e97 (patch)
tree07601643a7bce4a7d1c3b718d790392c176b8a58
parentb9e316dd7fab2adca0cd51b51332d708852d6c30 (diff)
downloademacs-9845e6697b5ed3739bcd78de13428db4173f0e97.tar.gz
emacs-9845e6697b5ed3739bcd78de13428db4173f0e97.zip
Use fixes to rul-generic-mode, contributed by "Rolf Sandau" <Rolf.Sandau@marconi.com>
Add etc-modules-conf-generic-mode
-rw-r--r--lisp/generic-x.el139
1 files changed, 96 insertions, 43 deletions
diff --git a/lisp/generic-x.el b/lisp/generic-x.el
index 6a878e79950..bb2d3513f89 100644
--- a/lisp/generic-x.el
+++ b/lisp/generic-x.el
@@ -845,6 +845,7 @@ you must reload generic-x to enable the specified modes."
845 845
846;; InstallShield RUL files 846;; InstallShield RUL files
847;; Contributed by Alfred.Correira@Pervasive.Com 847;; Contributed by Alfred.Correira@Pervasive.Com
848;; Bugfixes by "Rolf Sandau" <Rolf.Sandau@marconi.com>
848(and 849(and
849(memq 'rul-generic-mode generic-extras-enable-list) 850(memq 'rul-generic-mode generic-extras-enable-list)
850;;; build the regexp strings using regexp-opt 851;;; build the regexp strings using regexp-opt
@@ -1400,50 +1401,90 @@ you must reload generic-x to enable the specified modes."
1400 ) 1401 )
1401 "Function argument constants used in InstallShield 3 and 5.") 1402 "Function argument constants used in InstallShield 3 and 5.")
1402 1403
1403(define-generic-mode 'rul-generic-mode 1404(progn
1404 ;; Using "/*" and "*/" doesn't seem to be working right 1405 (defvar rul-generic-mode-syntax-table nil
1405 (list "//") 1406 "Syntax table to use in rul-generic-mode buffers.")
1406 installshield-statement-keyword-list 1407
1407 (list 1408 (setq rul-generic-mode-syntax-table
1408 ;; preprocessor constructs 1409 (make-syntax-table c++-mode-syntax-table))
1409 '("#[ \t]*include[ \t]+\\(<[^>\"\n]+>\\)" 1410
1410 1 font-lock-string-face) 1411 (modify-syntax-entry ?\r "> b" rul-generic-mode-syntax-table)
1411 '("#[ \t]*\\(\\sw+\\)\\>[ \t]*\\(\\sw+\\)?" 1412 (modify-syntax-entry ?\n "> b" rul-generic-mode-syntax-table)
1412 (1 font-lock-constant-face) 1413
1413 (2 font-lock-variable-name-face nil t)) 1414 (cond
1414 ;; indirect string constants 1415 ;; XEmacs 19 & 20 & 21
1415 '("\\(@[A-Za-z][A-Za-z0-9_]+\\)" 1 font-lock-builtin-face) 1416 ((memq '8-bit c-emacs-features)
1416 ;; gotos 1417 (modify-syntax-entry ?/ ". 1456" rul-generic-mode-syntax-table)
1417 '("[ \t]*\\(\\sw+:\\)" 1 font-lock-constant-face) 1418 (modify-syntax-entry ?* ". 23" rul-generic-mode-syntax-table)
1418 '("\\<\\(goto\\)\\>[ \t]*\\(\\sw+\\)?" 1419 )
1419 (1 font-lock-keyword-face) 1420 ;; Emacs 19 & 20
1420 (2 font-lock-constant-face nil t)) 1421 ((memq '1-bit c-emacs-features)
1421 ;; system variables 1422 (modify-syntax-entry ?/ ". 124b" rul-generic-mode-syntax-table)
1422 (generic-make-keywords-list 1423 (modify-syntax-entry ?* ". 23" rul-generic-mode-syntax-table)
1423 installshield-system-variables-list 1424 )
1424 'font-lock-variable-name-face "[^_]" "[^_]") 1425 ;; incompatible
1425 ;; system functions 1426 (t (error "Run Mode is incompatible with this version of Emacs"))
1426 (generic-make-keywords-list 1427 )
1427 installshield-system-functions-list 1428
1428 'font-lock-function-name-face "[^_]" "[^_]") 1429 ;; here manually instead
1429 ;; type keywords 1430 (defun generic-rul-mode-setup-function ()
1430 (generic-make-keywords-list 1431 (make-local-variable 'parse-sexp-ignore-comments)
1431 installshield-types-list 1432 (make-local-variable 'comment-start)
1432 'font-lock-type-face "[^_]" "[^_]") 1433 (make-local-variable 'comment-start-skip)
1433 ;; function argument constants 1434 (make-local-variable 'comment-end)
1434 (generic-make-keywords-list 1435 (setq imenu-generic-expression
1435 installshield-funarg-constants-list 1436 '((nil "^function\\s-+\\([A-Za-z0-9_]+\\)" 1))
1436 'font-lock-variable-name-face "[^_]" "[^_]") ; is this face the best choice? 1437 parse-sexp-ignore-comments t
1437 ) 1438 comment-end "*/"
1438 (list "\\.[rR][uU][lL]$") 1439 comment-start "/*"
1439 (list 1440;; comment-end ""
1440 (function 1441;; comment-start "//"
1441 (lambda () 1442;; comment-start-skip ""
1442 (setq imenu-generic-expression 1443 )
1443 '((nil "^function\\s-+\\([A-Za-z0-9_]+\\)" 1))) 1444;; (set-syntax-table rul-generic-mode-syntax-table)
1444 ))) 1445 (setq font-lock-syntax-table rul-generic-mode-syntax-table)
1445 "Generic mode for InstallShield RUL files.") 1446 )
1446 1447
1448 ;; moved mode-definition behind defun-definition to be warning-free - 15.11.02/RSan
1449 (define-generic-mode 'rul-generic-mode
1450 ;; Using "/*" and "*/" doesn't seem to be working right
1451 (list "//" '("/*" . "*/" ))
1452 installshield-statement-keyword-list
1453 (list
1454 ;; preprocessor constructs
1455 '("#[ \t]*include[ \t]+\\(<[^>\"\n]+>\\)"
1456 1 font-lock-string-face)
1457 '("#[ \t]*\\(\\sw+\\)\\>[ \t]*\\(\\sw+\\)?"
1458 (1 font-lock-reference-face)
1459 (2 font-lock-variable-name-face nil t))
1460 ;; indirect string constants
1461 '("\\(@[A-Za-z][A-Za-z0-9_]+\\)" 1 font-lock-builtin-face)
1462 ;; gotos
1463 '("[ \t]*\\(\\sw+:\\)" 1 font-lock-reference-face)
1464 '("\\<\\(goto\\)\\>[ \t]*\\(\\sw+\\)?"
1465 (1 font-lock-keyword-face)
1466 (2 font-lock-reference-face nil t))
1467 ;; system variables
1468 (generic-make-keywords-list
1469 installshield-system-variables-list
1470 'font-lock-variable-name-face "[^_]" "[^_]")
1471 ;; system functions
1472 (generic-make-keywords-list
1473 installshield-system-functions-list
1474 'font-lock-function-name-face "[^_]" "[^_]")
1475 ;; type keywords
1476 (generic-make-keywords-list
1477 installshield-types-list
1478 'font-lock-type-face "[^_]" "[^_]")
1479 ;; function argument constants
1480 (generic-make-keywords-list
1481 installshield-funarg-constants-list
1482 'font-lock-variable-name-face "[^_]" "[^_]") ; is this face the best choice?
1483 )
1484 (list "\\.[rR][uU][lL]$")
1485 (list 'generic-rul-mode-setup-function)
1486 "Generic mode for InstallShield RUL files.")
1487)
1447(define-skeleton rul-if 1488(define-skeleton rul-if
1448 "Insert an if statement." 1489 "Insert an if statement."
1449 "condition: " 1490 "condition: "
@@ -1835,6 +1876,18 @@ you must reload generic-x to enable the specified modes."
1835 "Generic mode for ASTAP circuit netlist files." 1876 "Generic mode for ASTAP circuit netlist files."
1836 ) 1877 )
1837 1878
1879(define-generic-mode 'etc-modules-conf-generic-mode
1880 ;;List of comment characters
1881 (list ?#)
1882 ;;List of keywords
1883 (list "alias" "pre-install" "post-install" "options" "probeall")
1884 ;;List of additional font-lock-expressions
1885 nil
1886 ;;List of additional automode-alist expressions
1887 (list "/etc/modules.conf" "/etc/conf.modules")
1888 ;;List of set up functions to call
1889 nil
1890 )
1838 1891
1839(provide 'generic-x) 1892(provide 'generic-x)
1840 1893