diff options
| author | Daniel Pfeiffer | 2005-05-16 20:36:45 +0000 |
|---|---|---|
| committer | Daniel Pfeiffer | 2005-05-16 20:36:45 +0000 |
| commit | 71994ae7da4568098dcad8608edb4be6350ab14c (patch) | |
| tree | 342b0ec280f7c54cbe712dd7635ad629b2513fc6 | |
| parent | 92984345bcd7d07d6527de73f4e66af5b7386d64 (diff) | |
| download | emacs-71994ae7da4568098dcad8608edb4be6350ab14c.tar.gz emacs-71994ae7da4568098dcad8608edb4be6350ab14c.zip | |
(lisp-font-lock-keywords-1): Set `font-lock-negation-char-face' for [^...] char group.
(lisp-font-lock-keywords-2): Highlight regexp's \\( \\| \\).
| -rw-r--r-- | lisp/ChangeLog | 26 | ||||
| -rw-r--r-- | lisp/font-lock.el | 185 |
2 files changed, 117 insertions, 94 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 73002253e66..b5383896cde 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,29 @@ | |||
| 1 | 2005-05-16 Daniel Pfeiffer <occitan@esperanto.org> | ||
| 2 | |||
| 3 | * font-lock.el (lisp-font-lock-keywords-1): Set | ||
| 4 | `font-lock-negation-char-face' for [^...] char group. | ||
| 5 | (lisp-font-lock-keywords-2): Highlight regexp's \\( \\| \\). | ||
| 6 | |||
| 7 | * progmodes/make-mode.el (makefile-dependency-regex): Turn it into | ||
| 8 | a var, and refine it to mask one more level of nested vars. | ||
| 9 | (makefile-rule-action-regex): Turn it into a var, and refine it so | ||
| 10 | it recognizes backslashed continuation lines as belonging to the | ||
| 11 | same command. | ||
| 12 | (makefile-macroassign-regex): Refine it so it recognizes | ||
| 13 | backslashed continuation lines as belonging to the same command. | ||
| 14 | (makefile-var-use-regex): Don't look at the next char, because it | ||
| 15 | might be the same one to be skipped by the initial [^$], leading | ||
| 16 | to an overlooked variable use. | ||
| 17 | (makefile-make-font-lock-keywords): Remove two parameters, which | ||
| 18 | are now variables that some of the modes set locally. Handle | ||
| 19 | dependency and rule action matching through functions, because | ||
| 20 | regexps alone match too often. Dependency matching now comes | ||
| 21 | last, so it can check, whether a colon already matched something | ||
| 22 | else. | ||
| 23 | (makefile-mode): Inform that font-lock improves makefile parsing | ||
| 24 | capabilities. | ||
| 25 | (makefile-match-dependency, makefile-match-action): New functions. | ||
| 26 | |||
| 1 | 2005-05-16 Juanma Barranquero <lekktu@gmail.com> | 27 | 2005-05-16 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 28 | ||
| 3 | * emacs-lisp/cl-extra.el (equalp): Doc fix. | 29 | * emacs-lisp/cl-extra.el (equalp): Doc fix. |
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index b71e5a3136f..ee1fc1a515e 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -1967,109 +1967,106 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item." | |||
| 1967 | 1967 | ||
| 1968 | (defconst lisp-font-lock-keywords-1 | 1968 | (defconst lisp-font-lock-keywords-1 |
| 1969 | (eval-when-compile | 1969 | (eval-when-compile |
| 1970 | (list | 1970 | `(;; Definitions. |
| 1971 | ;; | 1971 | (,(concat "(\\(def\\(" |
| 1972 | ;; Definitions. | 1972 | ;; Function declarations. |
| 1973 | (list (concat "(\\(def\\(" | 1973 | "\\(advice\\|varalias\\|alias\\|generic\\|macro\\*?\\|method\\|" |
| 1974 | ;; Function declarations. | 1974 | "setf\\|subst\\*?\\|un\\*?\\|" |
| 1975 | "\\(advice\\|varalias\\|alias\\|generic\\|macro\\*?\\|method\\|" | 1975 | "ine-\\(condition\\|\\(?:derived\\|minor\\|generic\\)-mode\\|" |
| 1976 | "setf\\|subst\\*?\\|un\\*?\\|" | 1976 | "method-combination\\|setf-expander\\|skeleton\\|widget\\|" |
| 1977 | "ine-\\(condition\\|\\(?:derived\\|minor\\|generic\\)-mode\\|" | 1977 | "function\\|\\(compiler\\|modify\\|symbol\\)-macro\\)\\)\\|" |
| 1978 | "method-combination\\|setf-expander\\|skeleton\\|widget\\|" | 1978 | ;; Variable declarations. |
| 1979 | "function\\|\\(compiler\\|modify\\|symbol\\)-macro\\)\\)\\|" | 1979 | "\\(const\\(ant\\)?\\|custom\\|face\\|parameter\\|var\\)\\|" |
| 1980 | ;; Variable declarations. | 1980 | ;; Structure declarations. |
| 1981 | "\\(const\\(ant\\)?\\|custom\\|face\\|parameter\\|var\\)\\|" | 1981 | "\\(class\\|group\\|theme\\|package\\|struct\\|type\\)" |
| 1982 | ;; Structure declarations. | 1982 | "\\)\\)\\>" |
| 1983 | "\\(class\\|group\\|theme\\|package\\|struct\\|type\\)" | 1983 | ;; Any whitespace and defined object. |
| 1984 | "\\)\\)\\>" | 1984 | "[ \t'\(]*" |
| 1985 | ;; Any whitespace and defined object. | 1985 | "\\(setf[ \t]+\\sw+)\\|\\sw+\\)?") |
| 1986 | "[ \t'\(]*" | 1986 | (1 font-lock-keyword-face) |
| 1987 | "\\(setf[ \t]+\\sw+)\\|\\sw+\\)?") | 1987 | (9 (cond ((match-beginning 3) font-lock-function-name-face) |
| 1988 | '(1 font-lock-keyword-face) | 1988 | ((match-beginning 6) font-lock-variable-name-face) |
| 1989 | '(9 (cond ((match-beginning 3) font-lock-function-name-face) | 1989 | (t font-lock-type-face)) |
| 1990 | ((match-beginning 6) font-lock-variable-name-face) | 1990 | nil t)) |
| 1991 | (t font-lock-type-face)) | 1991 | ;; Emacs Lisp autoload cookies. |
| 1992 | nil t)) | 1992 | ("^;;;###\\(autoload\\)" 1 font-lock-warning-face prepend) |
| 1993 | ;; | 1993 | ;; Regexp negated char group. |
| 1994 | ;; Emacs Lisp autoload cookies. | 1994 | ("\\[\\(\\^\\)" 1 font-lock-negation-char-face prepend))) |
| 1995 | '("^;;;###\\(autoload\\)" 1 font-lock-warning-face prepend) | ||
| 1996 | )) | ||
| 1997 | "Subdued level highlighting for Lisp modes.") | 1995 | "Subdued level highlighting for Lisp modes.") |
| 1998 | 1996 | ||
| 1999 | (defconst lisp-font-lock-keywords-2 | 1997 | (defconst lisp-font-lock-keywords-2 |
| 2000 | (append lisp-font-lock-keywords-1 | 1998 | (append lisp-font-lock-keywords-1 |
| 2001 | (eval-when-compile | 1999 | (eval-when-compile |
| 2002 | (list | 2000 | `(;; Control structures. Emacs Lisp forms. |
| 2003 | ;; | 2001 | (,(concat |
| 2004 | ;; Control structures. Emacs Lisp forms. | 2002 | "(" (regexp-opt |
| 2005 | (cons (concat | 2003 | '("cond" "if" "while" "let" "let*" |
| 2006 | "(" (regexp-opt | 2004 | "prog" "progn" "progv" "prog1" "prog2" "prog*" |
| 2007 | '("cond" "if" "while" "let" "let*" | 2005 | "inline" "lambda" "save-restriction" "save-excursion" |
| 2008 | "prog" "progn" "progv" "prog1" "prog2" "prog*" | 2006 | "save-window-excursion" "save-selected-window" |
| 2009 | "inline" "lambda" "save-restriction" "save-excursion" | 2007 | "save-match-data" "save-current-buffer" "unwind-protect" |
| 2010 | "save-window-excursion" "save-selected-window" | 2008 | "condition-case" "track-mouse" |
| 2011 | "save-match-data" "save-current-buffer" "unwind-protect" | 2009 | "eval-after-load" "eval-and-compile" "eval-when-compile" |
| 2012 | "condition-case" "track-mouse" | 2010 | "eval-when" |
| 2013 | "eval-after-load" "eval-and-compile" "eval-when-compile" | 2011 | "with-category-table" |
| 2014 | "eval-when" | 2012 | "with-current-buffer" "with-electric-help" |
| 2015 | "with-category-table" | 2013 | "with-local-quit" "with-no-warnings" |
| 2016 | "with-current-buffer" "with-electric-help" | 2014 | "with-output-to-string" "with-output-to-temp-buffer" |
| 2017 | "with-local-quit" "with-no-warnings" | 2015 | "with-selected-window" "with-syntax-table" |
| 2018 | "with-output-to-string" "with-output-to-temp-buffer" | 2016 | "with-temp-buffer" "with-temp-file" "with-temp-message" |
| 2019 | "with-selected-window" "with-syntax-table" | 2017 | "with-timeout" "with-timeout-handler") t) |
| 2020 | "with-temp-buffer" "with-temp-file" "with-temp-message" | 2018 | "\\>") |
| 2021 | "with-timeout" "with-timeout-handler") t) | 2019 | . 1) |
| 2022 | "\\>") | 2020 | ;; Control structures. Common Lisp forms. |
| 2023 | 1) | 2021 | (,(concat |
| 2024 | ;; | 2022 | "(" (regexp-opt |
| 2025 | ;; Control structures. Common Lisp forms. | 2023 | '("when" "unless" "case" "ecase" "typecase" "etypecase" |
| 2026 | (cons (concat | 2024 | "ccase" "ctypecase" "handler-case" "handler-bind" |
| 2027 | "(" (regexp-opt | 2025 | "restart-bind" "restart-case" "in-package" |
| 2028 | '("when" "unless" "case" "ecase" "typecase" "etypecase" | 2026 | "break" "ignore-errors" |
| 2029 | "ccase" "ctypecase" "handler-case" "handler-bind" | 2027 | "loop" "do" "do*" "dotimes" "dolist" "the" "locally" |
| 2030 | "restart-bind" "restart-case" "in-package" | 2028 | "proclaim" "declaim" "declare" "symbol-macrolet" |
| 2031 | "break" "ignore-errors" | 2029 | "lexical-let" "lexical-let*" "flet" "labels" "compiler-let" |
| 2032 | "loop" "do" "do*" "dotimes" "dolist" "the" "locally" | 2030 | "destructuring-bind" "macrolet" "tagbody" "block" "go" |
| 2033 | "proclaim" "declaim" "declare" "symbol-macrolet" | 2031 | "multiple-value-bind" "multiple-value-prog1" |
| 2034 | "lexical-let" "lexical-let*" "flet" "labels" "compiler-let" | 2032 | "return" "return-from" |
| 2035 | "destructuring-bind" "macrolet" "tagbody" "block" "go" | 2033 | "with-accessors" "with-compilation-unit" |
| 2036 | "multiple-value-bind" "multiple-value-prog1" | 2034 | "with-condition-restarts" "with-hash-table-iterator" |
| 2037 | "return" "return-from" | 2035 | "with-input-from-string" "with-open-file" |
| 2038 | "with-accessors" "with-compilation-unit" | 2036 | "with-open-stream" "with-output-to-string" |
| 2039 | "with-condition-restarts" "with-hash-table-iterator" | 2037 | "with-package-iterator" "with-simple-restart" |
| 2040 | "with-input-from-string" "with-open-file" | 2038 | "with-slots" "with-standard-io-syntax") t) |
| 2041 | "with-open-stream" "with-output-to-string" | 2039 | "\\>") |
| 2042 | "with-package-iterator" "with-simple-restart" | 2040 | . 1) |
| 2043 | "with-slots" "with-standard-io-syntax") t) | 2041 | ;; Exit/Feature symbols as constants. |
| 2044 | "\\>") | 2042 | (,(concat "(\\(catch\\|throw\\|featurep\\|provide\\|require\\)\\>" |
| 2045 | 1) | 2043 | "[ \t']*\\(\\sw+\\)?") |
| 2046 | ;; | 2044 | (1 font-lock-keyword-face) |
| 2047 | ;; Exit/Feature symbols as constants. | 2045 | (2 font-lock-constant-face nil t)) |
| 2048 | (list (concat "(\\(catch\\|throw\\|featurep\\|provide\\|require\\)\\>" | 2046 | ;; Erroneous structures. |
| 2049 | "[ \t']*\\(\\sw+\\)?") | 2047 | ("(\\(abort\\|assert\\|warn\\|check-type\\|cerror\\|error\\|signal\\)\\>" 1 font-lock-warning-face) |
| 2050 | '(1 font-lock-keyword-face) | 2048 | ;; Words inside \\[] tend to be for `substitute-command-keys'. |
| 2051 | '(2 font-lock-constant-face nil t)) | 2049 | ("\\\\\\\\\\[\\(\\sw+\\)]" 1 font-lock-constant-face prepend) |
| 2052 | ;; | 2050 | ;; Words inside `' tend to be symbol names. |
| 2053 | ;; Erroneous structures. | 2051 | ("`\\(\\sw\\sw+\\)'" 1 font-lock-constant-face prepend) |
| 2054 | '("(\\(abort\\|assert\\|warn\\|check-type\\|cerror\\|error\\|signal\\)\\>" 1 font-lock-warning-face) | 2052 | ;; Constant values. |
| 2055 | ;; | 2053 | ("\\<:\\sw+\\>" 0 font-lock-builtin-face) |
| 2056 | ;; Words inside \\[] tend to be for `substitute-command-keys'. | 2054 | ;; ELisp and CLisp `&' keywords as types. |
| 2057 | '("\\\\\\\\\\[\\(\\sw+\\)]" 1 font-lock-constant-face prepend) | 2055 | ("\\&\\sw+\\>" . font-lock-type-face) |
| 2058 | ;; | 2056 | ;; Make regexp grouping constructs bold, so they stand out. |
| 2059 | ;; Words inside `' tend to be symbol names. | 2057 | ("\\([\\][\\]\\)\\([(|)]\\)\\(\\?:\\)?" |
| 2060 | '("`\\(\\sw\\sw+\\)'" 1 font-lock-constant-face prepend) | 2058 | (1 font-lock-comment-face prepend) |
| 2061 | ;; | 2059 | (2 'bold prepend) |
| 2062 | ;; Constant values. | 2060 | (3 font-lock-type-face prepend t)) |
| 2063 | '("\\<:\\sw+\\>" 0 font-lock-builtin-face) | 2061 | ;; Underline innermost grouping, so that you can more easily see what belongs together. |
| 2064 | ;; | 2062 | ;; 2005-05-12: Font-lock can go into an unbreakable endless loop on this -- something's broken. |
| 2065 | ;; ELisp and CLisp `&' keywords as types. | 2063 | ;;("[\\][\\][(]\\(?:\\?:\\)?\\(\\(?:[^\\\"]+\\|[\\]\\(?:[^\\]\\|[\\][^(]\\)\\)+?\\)[\\][\\][)]" |
| 2066 | '("\\&\\sw+\\>" . font-lock-type-face) | 2064 | ;;1 'underline prepend) |
| 2067 | ;; | ||
| 2068 | ;;; This is too general -- rms. | 2065 | ;;; This is too general -- rms. |
| 2069 | ;;; A user complained that he has functions whose names start with `do' | 2066 | ;;; A user complained that he has functions whose names start with `do' |
| 2070 | ;;; and that they get the wrong color. | 2067 | ;;; and that they get the wrong color. |
| 2071 | ;;; ;; CL `with-' and `do-' constructs | 2068 | ;;; ;; CL `with-' and `do-' constructs |
| 2072 | ;;; '("(\\(\\(do-\\|with-\\)\\(\\s_\\|\\w\\)*\\)" 1 font-lock-keyword-face) | 2069 | ;;; ("(\\(\\(do-\\|with-\\)\\(\\s_\\|\\w\\)*\\)" 1 font-lock-keyword-face) |
| 2073 | ))) | 2070 | ))) |
| 2074 | "Gaudy level highlighting for Lisp modes.") | 2071 | "Gaudy level highlighting for Lisp modes.") |
| 2075 | 2072 | ||