Mercurial > emacs
changeset 62549:744535f6366b
(lisp-font-lock-keywords-2): Don't error. Minor regexp-optimization.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Fri, 20 May 2005 13:25:58 +0000 |
parents | 55227ff1f8d5 |
children | 4f78132b042b |
files | lisp/font-lock.el |
diffstat | 1 files changed, 9 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/font-lock.el Fri May 20 11:28:03 2005 +0000 +++ b/lisp/font-lock.el Fri May 20 13:25:58 2005 +0000 @@ -2053,19 +2053,22 @@ ("\\<:\\sw+\\>" 0 font-lock-builtin-face) ;; ELisp and CLisp `&' keywords as types. ("\\&\\sw+\\>" . font-lock-type-face) - ;; Make regexp grouping constructs bold, so they stand out, but only in strings. + ;; Make regexp grouping constructs bold, so they stand out, but only + ;; in strings. ((lambda (bound) - (if (re-search-forward "\\([\\][\\]\\)\\([(|)]\\)\\(\\?:\\)?" bound) + (if (re-search-forward "\\(\\\\\\\\\\)\\([(|)]\\)\\(\\?:\\)?" bound t) (let ((face (get-text-property (1- (point)) 'face))) (if (listp face) (memq 'font-lock-string-face face) (eq 'font-lock-string-face face))))) - (1 font-lock-comment-face prepend) ; Should we introduce a lowlight face for this? - ; Ideally that would retain the color, dimmed 50%. + ;; Should we introduce a lowlight face for this? + ;; Ideally that would retain the color, dimmed. + (1 font-lock-comment-face prepend) (2 'bold prepend) (3 font-lock-type-face prepend t)) - ;; Underline innermost grouping, so that you can more easily see what belongs together. - ;; 2005-05-12: Font-lock can go into an unbreakable endless loop on this -- something's broken. + ;; Underline innermost grouping, so that you can more easily see what + ;; belongs together. 2005-05-12: Font-lock can go into an + ;; unbreakable endless loop on this -- something's broken. ;;("[\\][\\][(]\\(?:\\?:\\)?\\(\\(?:[^\\\"]+\\|[\\]\\(?:[^\\]\\|[\\][^(]\\)\\)+?\\)[\\][\\][)]" ;;1 'underline prepend) ;;; This is too general -- rms.