Commit 9ad5e4d4 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

(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.
parent 014b37b6
...@@ -1825,15 +1825,15 @@ Sets various variables using `font-lock-defaults' (or, if nil, using ...@@ -1825,15 +1825,15 @@ Sets various variables using `font-lock-defaults' (or, if nil, using
"Font Lock mode face used to highlight preprocessor directives." "Font Lock mode face used to highlight preprocessor directives."
:group 'font-lock-highlighting-faces) :group 'font-lock-highlighting-faces)
(defface font-lock-regexp-backslash (defface font-lock-regexp-grouping-backslash
'((((class color) (min-colors 16)) :inherit escape-glyph) '((((class color) (min-colors 16)) :inherit escape-glyph)
(t :inherit bold)) (t :inherit bold))
"Font Lock mode face used to highlight a backslash in Lisp regexps." "Font Lock mode face for backslashes in Lisp regexp grouping constructs."
:group 'font-lock-highlighting-faces) :group 'font-lock-highlighting-faces)
(defface font-lock-regexp-backslash-construct (defface font-lock-regexp-backslash-grouping-construct
'((t :inherit bold)) '((t :inherit bold))
"Font Lock mode face used to highlight `\' constructs in Lisp regexps." "Font Lock mode face used to highlight grouping constructs in Lisp regexps."
:group 'font-lock-highlighting-faces) :group 'font-lock-highlighting-faces)
;;; End of Colour etc. support. ;;; End of Colour etc. support.
...@@ -2082,22 +2082,22 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item." ...@@ -2082,22 +2082,22 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item."
("\\<:\\sw+\\>" 0 font-lock-builtin-face) ("\\<:\\sw+\\>" 0 font-lock-builtin-face)
;; ELisp and CLisp `&' keywords as types. ;; ELisp and CLisp `&' keywords as types.
("\\&\\sw+\\>" . font-lock-type-face) ("\\&\\sw+\\>" . font-lock-type-face)
;; Make regexp grouping constructs bold, so they stand out, but only ;; ELisp regexp grouping constructs
;; in strings.
((lambda (bound) ((lambda (bound)
(if (re-search-forward "\\(\\\\\\\\\\)\\((\\(?:?:\\)?\\|[|)]\\)" bound t) (catch 'found
(let ((face (get-text-property (1- (point)) 'face))) ;; The following loop is needed to continue searching after matches
(if (listp face) ;; that do not occur in strings. The associated regexp matches one
(memq 'font-lock-string-face face) ;; of `\\\\' `\\(' `\\(?:' `\\|' `\\)'. `\\\\' has been included to
(eq 'font-lock-string-face face))))) ;; avoid highlighting, for example, `\\(' in `\\\\('.
(1 'font-lock-regexp-backslash prepend) (while (re-search-forward "\\(\\\\\\\\\\)\\(?:\\(\\\\\\\\\\)\\|\\((\\(?:\\?:\\)?\\|[|)]\\)\\)" bound t)
(2 'font-lock-regexp-backslash-construct prepend)) (unless (match-beginning 2)
(let ((face (get-text-property (1- (point)) 'face)))
;; Underline innermost grouping, so that you can more easily see what (when (or (and (listp face)
;; belongs together. 2005-05-12: Font-lock can go into an (memq 'font-lock-string-face face))
;; unbreakable endless loop on this -- something's broken. (eq 'font-lock-string-face face))
;;("[\\][\\][(]\\(?:\\?:\\)?\\(\\(?:[^\\\"]+\\|[\\]\\(?:[^\\]\\|[\\][^(]\\)\\)+?\\)[\\][\\][)]" (throw 'found t)))))))
;;1 'underline prepend) (1 'font-lock-regexp-grouping-backslash prepend)
(3 'font-lock-regexp-grouping-construct prepend))
;;; This is too general -- rms. ;;; This is too general -- rms.
;;; A user complained that he has functions whose names start with `do' ;;; A user complained that he has functions whose names start with `do'
;;; and that they get the wrong color. ;;; and that they get the wrong color.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment