summaryrefslogtreecommitdiff
path: root/lisp/gnus/gnus-cite.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/gnus/gnus-cite.el')
-rw-r--r--lisp/gnus/gnus-cite.el36
1 files changed, 11 insertions, 25 deletions
diff --git a/lisp/gnus/gnus-cite.el b/lisp/gnus/gnus-cite.el
index 04abdfc0d1b..3fde9baa0fe 100644
--- a/lisp/gnus/gnus-cite.el
+++ b/lisp/gnus/gnus-cite.el
@@ -1122,31 +1122,17 @@ Returns nil if there is no such line before LIMIT, t otherwise."
When enabled, it automatically turns on `font-lock-mode'."
:lighter ""
(when (derived-mode-p 'message-mode)
- ;; FIXME: Use font-lock-add-keywords!
- (let ((defaults (car font-lock-defaults))
- default) ;; keywords
- (while defaults
- (setq default (if (consp defaults)
- (pop defaults)
- (prog1
- defaults
- (setq defaults nil))))
- (if gnus-message-citation-mode
- ;; `gnus-message-citation-keywords' should be the last
- ;; elements of the keywords because the others are unlikely
- ;; to have the OVERRIDE flags -- XEmacs applies a keyword
- ;; having no OVERRIDE flag to matched text even if it has
- ;; already other faces, while Emacs doesn't.
- (set (make-local-variable default)
- (append (default-value default)
- gnus-message-citation-keywords))
- (kill-local-variable default))))
- ;; Force `font-lock-set-defaults' to update `font-lock-keywords'.
- (setq font-lock-set-defaults nil)
- (font-lock-set-defaults)
- (if font-lock-mode
- (font-lock-flush)
- (gnus-message-citation-mode (font-lock-mode 1)))))
+ (if (not font-lock-mode)
+ (gnus-message-citation-mode (font-lock-mode 1))
+ (if gnus-message-citation-mode
+ ;; `gnus-message-citation-keywords' should be the last
+ ;; elements of the keywords because the others are unlikely
+ ;; to have the OVERRIDE flags -- XEmacs applies a keyword
+ ;; having no OVERRIDE flag to matched text even if it has
+ ;; already other faces, while Emacs doesn't.
+ (font-lock-add-keywords nil gnus-message-citation-keywords t)
+ (font-lock-remove-keywords nil gnus-message-citation-keywords))
+ (font-lock-flush))))
(defun turn-on-gnus-message-citation-mode ()
"Turn on `gnus-message-citation-mode'."