diff options
| author | Eli Zaretskii | 2005-07-02 09:40:42 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2005-07-02 09:40:42 +0000 |
| commit | 9ad5e4d4eebb2a479d38f7b0fc06caf6b2b043c9 (patch) | |
| tree | b74d3133940eec3ef30f08ebccb6fff397190223 | |
| parent | 014b37b6c9b74f0bbd0686cae48f234c22f2f778 (diff) | |
| download | emacs-9ad5e4d4eebb2a479d38f7b0fc06caf6b2b043c9.tar.gz emacs-9ad5e4d4eebb2a479d38f7b0fc06caf6b2b043c9.zip | |
(font-lock-regexp-grouping-backslash): Rename from
font-lock-regexp-backslash. Doc fix.
(font-lock-regexp-backslash-grouping-construct): Rename from
font-lock-regexp-backslash-construct. Doc fix.
(lisp-font-lock-keywords-2): Fix highlighting of ELisp regexp
grouping constructs.
| -rw-r--r-- | lisp/font-lock.el | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 82c12548c1d..aaf8fa58cbc 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -1825,15 +1825,15 @@ Sets various variables using `font-lock-defaults' (or, if nil, using | |||
| 1825 | "Font Lock mode face used to highlight preprocessor directives." | 1825 | "Font Lock mode face used to highlight preprocessor directives." |
| 1826 | :group 'font-lock-highlighting-faces) | 1826 | :group 'font-lock-highlighting-faces) |
| 1827 | 1827 | ||
| 1828 | (defface font-lock-regexp-backslash | 1828 | (defface font-lock-regexp-grouping-backslash |
| 1829 | '((((class color) (min-colors 16)) :inherit escape-glyph) | 1829 | '((((class color) (min-colors 16)) :inherit escape-glyph) |
| 1830 | (t :inherit bold)) | 1830 | (t :inherit bold)) |
| 1831 | "Font Lock mode face used to highlight a backslash in Lisp regexps." | 1831 | "Font Lock mode face for backslashes in Lisp regexp grouping constructs." |
| 1832 | :group 'font-lock-highlighting-faces) | 1832 | :group 'font-lock-highlighting-faces) |
| 1833 | 1833 | ||
| 1834 | (defface font-lock-regexp-backslash-construct | 1834 | (defface font-lock-regexp-backslash-grouping-construct |
| 1835 | '((t :inherit bold)) | 1835 | '((t :inherit bold)) |
| 1836 | "Font Lock mode face used to highlight `\' constructs in Lisp regexps." | 1836 | "Font Lock mode face used to highlight grouping constructs in Lisp regexps." |
| 1837 | :group 'font-lock-highlighting-faces) | 1837 | :group 'font-lock-highlighting-faces) |
| 1838 | 1838 | ||
| 1839 | ;;; End of Colour etc. support. | 1839 | ;;; End of Colour etc. support. |
| @@ -2082,22 +2082,22 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item." | |||
| 2082 | ("\\<:\\sw+\\>" 0 font-lock-builtin-face) | 2082 | ("\\<:\\sw+\\>" 0 font-lock-builtin-face) |
| 2083 | ;; ELisp and CLisp `&' keywords as types. | 2083 | ;; ELisp and CLisp `&' keywords as types. |
| 2084 | ("\\&\\sw+\\>" . font-lock-type-face) | 2084 | ("\\&\\sw+\\>" . font-lock-type-face) |
| 2085 | ;; Make regexp grouping constructs bold, so they stand out, but only | 2085 | ;; ELisp regexp grouping constructs |
| 2086 | ;; in strings. | ||
| 2087 | ((lambda (bound) | 2086 | ((lambda (bound) |
| 2088 | (if (re-search-forward "\\(\\\\\\\\\\)\\((\\(?:?:\\)?\\|[|)]\\)" bound t) | 2087 | (catch 'found |
| 2089 | (let ((face (get-text-property (1- (point)) 'face))) | 2088 | ;; The following loop is needed to continue searching after matches |
| 2090 | (if (listp face) | 2089 | ;; that do not occur in strings. The associated regexp matches one |
| 2091 | (memq 'font-lock-string-face face) | 2090 | ;; of `\\\\' `\\(' `\\(?:' `\\|' `\\)'. `\\\\' has been included to |
| 2092 | (eq 'font-lock-string-face face))))) | 2091 | ;; avoid highlighting, for example, `\\(' in `\\\\('. |
| 2093 | (1 'font-lock-regexp-backslash prepend) | 2092 | (while (re-search-forward "\\(\\\\\\\\\\)\\(?:\\(\\\\\\\\\\)\\|\\((\\(?:\\?:\\)?\\|[|)]\\)\\)" bound t) |
| 2094 | (2 'font-lock-regexp-backslash-construct prepend)) | 2093 | (unless (match-beginning 2) |
| 2095 | 2094 | (let ((face (get-text-property (1- (point)) 'face))) | |
| 2096 | ;; Underline innermost grouping, so that you can more easily see what | 2095 | (when (or (and (listp face) |
| 2097 | ;; belongs together. 2005-05-12: Font-lock can go into an | 2096 | (memq 'font-lock-string-face face)) |
| 2098 | ;; unbreakable endless loop on this -- something's broken. | 2097 | (eq 'font-lock-string-face face)) |
| 2099 | ;;("[\\][\\][(]\\(?:\\?:\\)?\\(\\(?:[^\\\"]+\\|[\\]\\(?:[^\\]\\|[\\][^(]\\)\\)+?\\)[\\][\\][)]" | 2098 | (throw 'found t))))))) |
| 2100 | ;;1 'underline prepend) | 2099 | (1 'font-lock-regexp-grouping-backslash prepend) |
| 2100 | (3 'font-lock-regexp-grouping-construct prepend)) | ||
| 2101 | ;;; This is too general -- rms. | 2101 | ;;; This is too general -- rms. |
| 2102 | ;;; A user complained that he has functions whose names start with `do' | 2102 | ;;; A user complained that he has functions whose names start with `do' |
| 2103 | ;;; and that they get the wrong color. | 2103 | ;;; and that they get the wrong color. |