comparison lisp/packages/font-lock.el @ 195:a2f645c6b9f8 r20-3b24

Import from CVS: tag r20-3b24
author cvs
date Mon, 13 Aug 2007 09:59:05 +0200
parents f53b5ca2e663
children 41ff10fd062f
comparison
equal deleted inserted replaced
194:2947057885e5 195:a2f645c6b9f8
107 ;; the whole file when it's first loaded in. 107 ;; the whole file when it's first loaded in.
108 108
109 ;; Further comments from the FSF: 109 ;; Further comments from the FSF:
110 110
111 ;; Nasty regexps of the form "bar\\(\\|lo\\)\\|f\\(oo\\|u\\(\\|bar\\)\\)\\|lo" 111 ;; Nasty regexps of the form "bar\\(\\|lo\\)\\|f\\(oo\\|u\\(\\|bar\\)\\)\\|lo"
112 ;; are made thusly: (make-regexp '("foo" "fu" "fubar" "bar" "barlo" "lo")) for 112 ;; are made thusly: (regexp-opt '("foo" "fu" "fubar" "bar" "barlo" "lo")) for
113 ;; efficiency. See /pub/gnu/emacs/elisp-archive/functions/make-regexp.el.Z on 113 ;; efficiency.
114 ;; archive.cis.ohio-state.edu for this and other functions.
115 114
116 ;; What is fontification for? You might say, "It's to make my code look nice." 115 ;; What is fontification for? You might say, "It's to make my code look nice."
117 ;; I think it should be for adding information in the form of cues. These cues 116 ;; I think it should be for adding information in the form of cues. These cues
118 ;; should provide you with enough information to both (a) distinguish between 117 ;; should provide you with enough information to both (a) distinguish between
119 ;; different items, and (b) identify the item meanings, without having to read 118 ;; different items, and (b) identify the item meanings, without having to read
1621 (append lisp-font-lock-keywords-1 1620 (append lisp-font-lock-keywords-1
1622 (list 1621 (list
1623 ;; 1622 ;;
1624 ;; Control structures. ELisp and CLisp combined. 1623 ;; Control structures. ELisp and CLisp combined.
1625 ;; 1624 ;;
1626 ;;(make-regexp 1625 ;;(regexp-opt
1627 ;; '("cond" "if" "while" "let\\*?" "prog[nv12*]?" "catch" "throw" 1626 ;; '("cond" "if" "while" "let" "let*" "prog" "progn" "prog1"
1628 ;; "save-restriction" "save-excursion" "save-window-excursion" 1627 ;; "prog2" "progv" "catch" "throw" "save-restriction"
1628 ;; "save-excursion" "save-window-excursion"
1629 ;; "save-current-buffer" "with-current-buffer" 1629 ;; "save-current-buffer" "with-current-buffer"
1630 ;; "with-temp-file" "with-output-to-.+" 1630 ;; "with-temp-file" "with-temp-buffer" "with-output-to-string"
1631 ;; "with-string-as-buffer-contents"
1631 ;; "save-selected-window" "save-match-data" "unwind-protect" 1632 ;; "save-selected-window" "save-match-data" "unwind-protect"
1632 ;; "condition-case" "track-mouse" "autoload" 1633 ;; "condition-case" "track-mouse" "autoload"
1633 ;; "eval-after-load" "eval-and-compile" "eval-when-compile" 1634 ;; "eval-after-load" "eval-and-compile" "eval-when-compile"
1634 ;; "when" "unless" "do" "flet" "labels" "lambda" 1635 ;; "when" "unless" "do" "dolist" "dotimes" "flet" "labels"
1635 ;; "return" "return-from")) 1636 ;; "lambda" "return" "return-from"))
1636 ;;
1637 (cons 1637 (cons
1638 (concat 1638 (concat
1639 "(\\(" 1639 "(\\("
1640 "autoload\\|c\\(atch\\|ond\\(\\|ition-case\\)\\)\\|do\\|" 1640 "autoload\\|c\\(atch\\|ond\\(ition-case\\)?\\)\\|do\\(list\\|"
1641 "eval-\\(a\\(fter-load\\|nd-compile\\)\\|when-compile\\)\\|" 1641 "times\\)?\\|eval-\\(a\\(fter-load\\|nd-compile\\)\\|when-compile\\)\\|"
1642 "flet\\|if\\|l\\(a\\(bels\\|mbda\\)\\|et\\*?\\)\\|prog[nv12*]?\\|" 1642 "flet\\|if\\|l\\(a\\(bels\\|mbda\\)\\|et\\*?\\)\\|"
1643 "return\\(\\|-from\\)\\|save-\\(current-buffer\\|excursion\\|" 1643 "prog[nv12\\*]?\\|return\\(-from\\)?\\|save-\\(current-buffer\\|"
1644 "match-data\\|restriction\\|selected-window\\|window-excursion\\)\\|" 1644 "excursion\\|match-data\\|restriction\\|selected-window\\|"
1645 "t\\(hrow\\|rack-mouse\\)\\|un\\(less\\|wind-protect\\)\\|" 1645 "window-excursion\\)\\|t\\(hrow\\|rack-mouse\\)\\|un\\(less\\|"
1646 "w\\(h\\(en\\|ile\\)\\|ith-\\(current-buffer\\|output-to-.+\\|" 1646 "wind-protect\\)\\|w\\(h\\(en\\|ile\\)\\|ith-\\(current-buffer\\|"
1647 "temp-file\\)\\)" 1647 "output-to-string\\|string-as-buffer-contents\\|temp-\\(buffer\\|"
1648 "file\\)\\)\\)"
1648 "\\)\\>") 1) 1649 "\\)\\>") 1)
1649 ;; 1650 ;;
1650 ;; Words inside \\[] tend to be for `substitute-command-keys'. 1651 ;; Words inside \\[] tend to be for `substitute-command-keys'.
1651 '("\\\\\\\\\\[\\(\\sw+\\)]" 1 font-lock-reference-face prepend) 1652 '("\\\\\\\\\\[\\(\\sw+\\)]" 1 font-lock-reference-face prepend)
1652 ;; 1653 ;;
1730 ((match-beginning 6) 'font-lock-variable-name-face) 1731 ((match-beginning 6) 'font-lock-variable-name-face)
1731 (t 'font-lock-type-face)) 1732 (t 'font-lock-type-face))
1732 nil t)) 1733 nil t))
1733 ;; 1734 ;;
1734 ;; Control structures. 1735 ;; Control structures.
1735 ;(make-regexp '("begin" "call-with-current-continuation" "call/cc" 1736 ;(regexp-opt '("begin" "call-with-current-continuation" "call/cc"
1736 ; "call-with-input-file" "call-with-output-file" "case" "cond" 1737 ; "call-with-input-file" "call-with-output-file" "case" "cond"
1737 ; "do" "else" "for-each" "if" "lambda" 1738 ; "do" "else" "for-each" "if" "lambda"
1738 ; "let\\*?" "let-syntax" "letrec" "letrec-syntax" 1739 ; "let\\*?" "let-syntax" "letrec" "letrec-syntax"
1739 ; ;; Hannes Haug <hannes.haug@student.uni-tuebingen.de> wants: 1740 ; ;; Hannes Haug <hannes.haug@student.uni-tuebingen.de> wants:
1740 ; "and" "or" "delay" 1741 ; "and" "or" "delay"