Mercurial > emacs
diff lisp/font-lock.el @ 90192:173dee4e2611
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-61
Merge from emacs--cvs-trunk--0
Patches applied:
* emacs--cvs-trunk--0 (patch 353-357)
- Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Thu, 09 Jun 2005 07:13:03 +0000 |
parents | 01137c1fdbe9 ad41fcdb0642 |
children | b7da78284d4c |
line wrap: on
line diff
--- a/lisp/font-lock.el Mon Jun 06 04:18:31 2005 +0000 +++ b/lisp/font-lock.el Thu Jun 09 07:13:03 2005 +0000 @@ -691,7 +691,7 @@ (add-hook 'c-mode-hook (lambda () - (font-lock-add-keywords 'c-mode + (font-lock-add-keywords nil '((\"\\\\\\=<\\\\(FIXME\\\\):\" 1 font-lock-warning-face prepend) (\"\\\\\\=<\\\\(and\\\\|or\\\\|not\\\\)\\\\\\=>\" . font-lock-keyword-face))))) @@ -905,7 +905,7 @@ 'font-lock-after-change-function t) (set (make-local-variable 'font-lock-fontify-buffer-function) 'jit-lock-refontify) - ;; Don't fontify eagerly (and don't abort is the buffer is large). + ;; Don't fontify eagerly (and don't abort if the buffer is large). (set (make-local-variable 'font-lock-fontified) t) ;; Use jit-lock. (jit-lock-register 'font-lock-fontify-region @@ -1826,6 +1826,17 @@ "Font Lock mode face used to highlight preprocessor directives." :group 'font-lock-highlighting-faces) +(defface font-lock-regexp-backslash + '((((class color) (min-colors 16)) :inherit escape-glyph) + (t :inherit bold)) + "Font Lock mode face used to highlight a backslash in Lisp regexps." + :group 'font-lock-highlighting-faces) + +(defface font-lock-regexp-backslash-construct + '((t :inherit bold)) + "Font Lock mode face used to highlight `\' constructs in Lisp regexps." + :group 'font-lock-highlighting-faces) + ;;; End of Colour etc. support. ;;; Menu support. @@ -2020,7 +2031,7 @@ `(;; Control structures. Emacs Lisp forms. (,(concat "(" (regexp-opt - '("cond" "if" "while" "let" "let*" + '("cond" "if" "while" "while-no-input" "let" "let*" "prog" "progn" "progv" "prog1" "prog2" "prog*" "inline" "lambda" "save-restriction" "save-excursion" "save-window-excursion" "save-selected-window" @@ -2076,16 +2087,14 @@ ;; Make regexp grouping constructs bold, so they stand out, but only ;; in strings. ((lambda (bound) - (if (re-search-forward "\\(\\\\\\\\\\)\\([(|)]\\)\\(\\?:\\)?" bound t) + (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))))) - ;; 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)) + (1 'font-lock-regexp-backslash prepend) + (2 'font-lock-regexp-backslash-construct prepend)) + ;; 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.