/[emacs]/emacs/lisp/generic-x.el
ViewVC logotype

Diff of /emacs/lisp/generic-x.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16 by pot, Mon Jan 21 12:48:53 2002 UTC revision 1.16.4.1 by miles, Fri Apr 4 06:20:06 2003 UTC
# Line 1  Line 1 
1  ;;; generic-x.el --- Extra Modes for generic-mode  ;;; generic-x.el --- Extra Modes for generic-mode -*- no-byte-compile: t -*-
2    
3  ;; Copyright (C) 1997, 1998 Free Software Foundation, Inc.  ;; Copyright (C) 1997, 1998 Free Software Foundation, Inc.
4    
# Line 533  you must reload generic-x to enable the Line 533  you must reload generic-x to enable the
533  ;; Javascript mode  ;; Javascript mode
534  ;; Includes extra keywords from Armando Singer [asinger@MAIL.COLGATE.EDU]  ;; Includes extra keywords from Armando Singer [asinger@MAIL.COLGATE.EDU]
535  (define-generic-mode 'javascript-generic-mode  (define-generic-mode 'javascript-generic-mode
536    (list "//")    (list "//" '("/*" . "*/"))
537    (list    (list
538     "break"     "break"
539     "case"     "case"
# Line 845  you must reload generic-x to enable the Line 845  you must reload generic-x to enable the
845    
846  ;; InstallShield RUL files  ;; InstallShield RUL files
847  ;; Contributed by  Alfred.Correira@Pervasive.Com  ;; Contributed by  Alfred.Correira@Pervasive.Com
848    ;; Bugfixes by "Rolf Sandau" <Rolf.Sandau@marconi.com>
849  (and  (and
850  (memq 'rul-generic-mode generic-extras-enable-list)  (memq 'rul-generic-mode generic-extras-enable-list)
851  ;;; build the regexp strings using regexp-opt  ;;; build the regexp strings using regexp-opt
# Line 1400  you must reload generic-x to enable the Line 1401  you must reload generic-x to enable the
1401     )     )
1402    "Function argument constants used in InstallShield 3 and 5.")    "Function argument constants used in InstallShield 3 and 5.")
1403    
1404  (define-generic-mode 'rul-generic-mode  (progn
1405    ;; Using "/*" and "*/" doesn't seem to be working right    (defvar rul-generic-mode-syntax-table nil
1406    (list "//")       "Syntax table to use in rul-generic-mode buffers.")
1407    installshield-statement-keyword-list  
1408    (list     (setq rul-generic-mode-syntax-table
1409     ;; preprocessor constructs           (make-syntax-table c++-mode-syntax-table))
1410     '("#[ \t]*include[ \t]+\\(<[^>\"\n]+>\\)"  
1411       1 font-lock-string-face)     (modify-syntax-entry ?\r "> b"   rul-generic-mode-syntax-table)
1412     '("#[ \t]*\\(\\sw+\\)\\>[ \t]*\\(\\sw+\\)?"     (modify-syntax-entry ?\n "> b"   rul-generic-mode-syntax-table)
1413       (1 font-lock-constant-face)  
1414       (2 font-lock-variable-name-face nil t))     (cond
1415     ;; indirect string constants         ;; XEmacs 19 & 20 & 21
1416     '("\\(@[A-Za-z][A-Za-z0-9_]+\\)" 1 font-lock-builtin-face)      ((memq '8-bit c-emacs-features)
1417     ;; gotos       (modify-syntax-entry ?/  ". 1456" rul-generic-mode-syntax-table)
1418     '("[ \t]*\\(\\sw+:\\)" 1 font-lock-constant-face)         (modify-syntax-entry ?*  ". 23"   rul-generic-mode-syntax-table)
1419     '("\\<\\(goto\\)\\>[ \t]*\\(\\sw+\\)?"         )
1420       (1 font-lock-keyword-face)      ;; Emacs 19 & 20
1421       (2 font-lock-constant-face nil t))      ((memq '1-bit c-emacs-features)
1422     ;; system variables       (modify-syntax-entry ?/  ". 124b" rul-generic-mode-syntax-table)
1423     (generic-make-keywords-list         (modify-syntax-entry ?*  ". 23"   rul-generic-mode-syntax-table)
1424      installshield-system-variables-list         )
1425      'font-lock-variable-name-face "[^_]" "[^_]")      ;; incompatible
1426     ;; system functions      (t (error "Run Mode is incompatible with this version of Emacs"))
1427     (generic-make-keywords-list      )
     installshield-system-functions-list  
     'font-lock-function-name-face "[^_]" "[^_]")  
    ;; type keywords  
    (generic-make-keywords-list  
     installshield-types-list  
     'font-lock-type-face "[^_]" "[^_]")  
    ;; function argument constants  
    (generic-make-keywords-list  
     installshield-funarg-constants-list  
     'font-lock-variable-name-face "[^_]" "[^_]") ; is this face the best choice?  
    )  
   (list "\\.[rR][uU][lL]$")  
   (list  
    (function  
     (lambda ()  
       (setq imenu-generic-expression  
     '((nil "^function\\s-+\\([A-Za-z0-9_]+\\)" 1)))  
       )))  
   "Generic mode for InstallShield RUL files.")  
1428    
1429       ;; here manually instead
1430       (defun generic-rul-mode-setup-function ()
1431         (make-local-variable            'parse-sexp-ignore-comments)
1432         (make-local-variable            'comment-start)
1433         (make-local-variable            'comment-start-skip)
1434         (make-local-variable            'comment-end)
1435         (setq imenu-generic-expression
1436               '((nil "^function\\s-+\\([A-Za-z0-9_]+\\)" 1))
1437               parse-sexp-ignore-comments t
1438               comment-end               "*/"
1439               comment-start             "/*"
1440    ;;         comment-end               ""
1441    ;;         comment-start             "//"
1442    ;;         comment-start-skip        ""
1443               )
1444    ;;     (set-syntax-table              rul-generic-mode-syntax-table)
1445         (setq font-lock-syntax-table rul-generic-mode-syntax-table)
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    )
1488  (define-skeleton rul-if  (define-skeleton rul-if
1489     "Insert an if statement."     "Insert an if statement."
1490     "condition: "     "condition: "
# Line 1835  you must reload generic-x to enable the Line 1876  you must reload generic-x to enable the
1876    "Generic mode for ASTAP circuit netlist files."    "Generic mode for ASTAP circuit netlist files."
1877    )    )
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      )
1891    
1892  (provide 'generic-x)  (provide 'generic-x)
1893    

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.16.4.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26