aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2005-05-20 13:25:58 +0000
committerStefan Monnier2005-05-20 13:25:58 +0000
commit9605a00f9c823ff0a5bc0f8412d2e1569ace377b (patch)
tree650658f3545af2f5a7cc254452fa7e1f303c716b
parent9bc3d124027c320ca799cfb31380b108a84c443c (diff)
downloademacs-9605a00f9c823ff0a5bc0f8412d2e1569ace377b.tar.gz
emacs-9605a00f9c823ff0a5bc0f8412d2e1569ace377b.zip
(lisp-font-lock-keywords-2): Don't error. Minor regexp-optimization.
-rw-r--r--lisp/font-lock.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index ba42412d8da..bb24329c000 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -2053,19 +2053,22 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item."
2053 ("\\<:\\sw+\\>" 0 font-lock-builtin-face) 2053 ("\\<:\\sw+\\>" 0 font-lock-builtin-face)
2054 ;; ELisp and CLisp `&' keywords as types. 2054 ;; ELisp and CLisp `&' keywords as types.
2055 ("\\&\\sw+\\>" . font-lock-type-face) 2055 ("\\&\\sw+\\>" . font-lock-type-face)
2056 ;; Make regexp grouping constructs bold, so they stand out, but only in strings. 2056 ;; Make regexp grouping constructs bold, so they stand out, but only
2057 ;; in strings.
2057 ((lambda (bound) 2058 ((lambda (bound)
2058 (if (re-search-forward "\\([\\][\\]\\)\\([(|)]\\)\\(\\?:\\)?" bound) 2059 (if (re-search-forward "\\(\\\\\\\\\\)\\([(|)]\\)\\(\\?:\\)?" bound t)
2059 (let ((face (get-text-property (1- (point)) 'face))) 2060 (let ((face (get-text-property (1- (point)) 'face)))
2060 (if (listp face) 2061 (if (listp face)
2061 (memq 'font-lock-string-face face) 2062 (memq 'font-lock-string-face face)
2062 (eq 'font-lock-string-face face))))) 2063 (eq 'font-lock-string-face face)))))
2063 (1 font-lock-comment-face prepend) ; Should we introduce a lowlight face for this? 2064 ;; Should we introduce a lowlight face for this?
2064 ; Ideally that would retain the color, dimmed 50%. 2065 ;; Ideally that would retain the color, dimmed.
2066 (1 font-lock-comment-face prepend)
2065 (2 'bold prepend) 2067 (2 'bold prepend)
2066 (3 font-lock-type-face prepend t)) 2068 (3 font-lock-type-face prepend t))
2067 ;; Underline innermost grouping, so that you can more easily see what belongs together. 2069 ;; Underline innermost grouping, so that you can more easily see what
2068 ;; 2005-05-12: Font-lock can go into an unbreakable endless loop on this -- something's broken. 2070 ;; belongs together. 2005-05-12: Font-lock can go into an
2071 ;; unbreakable endless loop on this -- something's broken.
2069 ;;("[\\][\\][(]\\(?:\\?:\\)?\\(\\(?:[^\\\"]+\\|[\\]\\(?:[^\\]\\|[\\][^(]\\)\\)+?\\)[\\][\\][)]" 2072 ;;("[\\][\\][(]\\(?:\\?:\\)?\\(\\(?:[^\\\"]+\\|[\\]\\(?:[^\\]\\|[\\][^(]\\)\\)+?\\)[\\][\\][)]"
2070 ;;1 'underline prepend) 2073 ;;1 'underline prepend)
2071;;; This is too general -- rms. 2074;;; This is too general -- rms.