diff options
| author | Juri Linkov | 2005-06-06 12:02:35 +0000 |
|---|---|---|
| committer | Juri Linkov | 2005-06-06 12:02:35 +0000 |
| commit | c711faac0a1ef15f18c23e988167d3dbccca1448 (patch) | |
| tree | 228c1ad8deb211faa79bc5235fe3a67ab6e5d9ce | |
| parent | 6bf7c777248921cefbac30270127b31fd1264b31 (diff) | |
| download | emacs-c711faac0a1ef15f18c23e988167d3dbccca1448.tar.gz emacs-c711faac0a1ef15f18c23e988167d3dbccca1448.zip | |
(font-lock-regexp-backslash)
(font-lock-regexp-backslash-construct): New faces.
(lisp-font-lock-keywords-2): Use new faces. Match `?:' only
after `('. Add `while-no-input' to control structures.
| -rw-r--r-- | lisp/font-lock.el | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 1e4e0d188ad..f75c08151e8 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -905,7 +905,7 @@ The value of this variable is used when Font Lock mode is turned on." | |||
| 905 | 'font-lock-after-change-function t) | 905 | 'font-lock-after-change-function t) |
| 906 | (set (make-local-variable 'font-lock-fontify-buffer-function) | 906 | (set (make-local-variable 'font-lock-fontify-buffer-function) |
| 907 | 'jit-lock-refontify) | 907 | 'jit-lock-refontify) |
| 908 | ;; Don't fontify eagerly (and don't abort is the buffer is large). | 908 | ;; Don't fontify eagerly (and don't abort if the buffer is large). |
| 909 | (set (make-local-variable 'font-lock-fontified) t) | 909 | (set (make-local-variable 'font-lock-fontified) t) |
| 910 | ;; Use jit-lock. | 910 | ;; Use jit-lock. |
| 911 | (jit-lock-register 'font-lock-fontify-region | 911 | (jit-lock-register 'font-lock-fontify-region |
| @@ -1826,6 +1826,17 @@ Sets various variables using `font-lock-defaults' (or, if nil, using | |||
| 1826 | "Font Lock mode face used to highlight preprocessor directives." | 1826 | "Font Lock mode face used to highlight preprocessor directives." |
| 1827 | :group 'font-lock-highlighting-faces) | 1827 | :group 'font-lock-highlighting-faces) |
| 1828 | 1828 | ||
| 1829 | (defface font-lock-regexp-backslash | ||
| 1830 | '((((class color) (min-colors 16)) :inherit escape-glyph) | ||
| 1831 | (t :inherit bold)) | ||
| 1832 | "Font Lock mode face used to highlight a backslash in Lisp regexps." | ||
| 1833 | :group 'font-lock-highlighting-faces) | ||
| 1834 | |||
| 1835 | (defface font-lock-regexp-backslash-construct | ||
| 1836 | '((t :inherit bold)) | ||
| 1837 | "Font Lock mode face used to highlight `\' constructs in Lisp regexps." | ||
| 1838 | :group 'font-lock-highlighting-faces) | ||
| 1839 | |||
| 1829 | ;;; End of Colour etc. support. | 1840 | ;;; End of Colour etc. support. |
| 1830 | 1841 | ||
| 1831 | ;;; Menu support. | 1842 | ;;; Menu support. |
| @@ -2019,7 +2030,7 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item." | |||
| 2019 | `(;; Control structures. Emacs Lisp forms. | 2030 | `(;; Control structures. Emacs Lisp forms. |
| 2020 | (,(concat | 2031 | (,(concat |
| 2021 | "(" (regexp-opt | 2032 | "(" (regexp-opt |
| 2022 | '("cond" "if" "while" "let" "let*" | 2033 | '("cond" "if" "while" "while-no-input" "let" "let*" |
| 2023 | "prog" "progn" "progv" "prog1" "prog2" "prog*" | 2034 | "prog" "progn" "progv" "prog1" "prog2" "prog*" |
| 2024 | "inline" "lambda" "save-restriction" "save-excursion" | 2035 | "inline" "lambda" "save-restriction" "save-excursion" |
| 2025 | "save-window-excursion" "save-selected-window" | 2036 | "save-window-excursion" "save-selected-window" |
| @@ -2075,16 +2086,14 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item." | |||
| 2075 | ;; Make regexp grouping constructs bold, so they stand out, but only | 2086 | ;; Make regexp grouping constructs bold, so they stand out, but only |
| 2076 | ;; in strings. | 2087 | ;; in strings. |
| 2077 | ((lambda (bound) | 2088 | ((lambda (bound) |
| 2078 | (if (re-search-forward "\\(\\\\\\\\\\)\\([(|)]\\)\\(\\?:\\)?" bound t) | 2089 | (if (re-search-forward "\\(\\\\\\\\\\)\\((\\(?:?:\\)?\\|[|)]\\)" bound t) |
| 2079 | (let ((face (get-text-property (1- (point)) 'face))) | 2090 | (let ((face (get-text-property (1- (point)) 'face))) |
| 2080 | (if (listp face) | 2091 | (if (listp face) |
| 2081 | (memq 'font-lock-string-face face) | 2092 | (memq 'font-lock-string-face face) |
| 2082 | (eq 'font-lock-string-face face))))) | 2093 | (eq 'font-lock-string-face face))))) |
| 2083 | ;; Should we introduce a lowlight face for this? | 2094 | (1 'font-lock-regexp-backslash prepend) |
| 2084 | ;; Ideally that would retain the color, dimmed. | 2095 | (2 'font-lock-regexp-backslash-construct prepend)) |
| 2085 | (1 font-lock-comment-face prepend) | 2096 | |
| 2086 | (2 'bold prepend) | ||
| 2087 | (3 font-lock-type-face prepend t)) | ||
| 2088 | ;; Underline innermost grouping, so that you can more easily see what | 2097 | ;; Underline innermost grouping, so that you can more easily see what |
| 2089 | ;; belongs together. 2005-05-12: Font-lock can go into an | 2098 | ;; belongs together. 2005-05-12: Font-lock can go into an |
| 2090 | ;; unbreakable endless loop on this -- something's broken. | 2099 | ;; unbreakable endless loop on this -- something's broken. |