bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#68352: 29.1; gnus-message-citation-mode removes values from font-loc


From: Morgan Willcock
Subject: bug#68352: 29.1; gnus-message-citation-mode removes values from font-lock-keywords
Date: Wed, 10 Jan 2024 22:16:27 +0000
User-agent: Gnus/5.13 (Gnus v5.13)

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> So maybe this is enough?
>
> (define-minor-mode gnus-message-citation-mode
>   "Minor mode providing more font-lock support for nested citations.
> When enabled, it automatically turns on `font-lock-mode'."
>   :lighter ""
>   (when (derived-mode-p 'message-mode)
>     (if gnus-message-citation-mode
>       (font-lock-add-keywords nil gnus-message-citation-keywords)
>       (font-lock-remove-keywords nil gnus-message-citation-keywords))
>     (if font-lock-mode
>       (font-lock-flush)
>       (gnus-message-citation-mode (font-lock-mode 1)))))

I think this does fix it, although I've added the optional argument to
append to the end of the font-lock rules and restored the comment which
suggested why it previously worked that way.

  (define-minor-mode gnus-message-citation-mode
    "Minor mode providing more font-lock support for nested citations.
  When enabled, it automatically turns on `font-lock-mode'."
    :lighter ""
    (when (derived-mode-p 'message-mode)
      (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))
      (if font-lock-mode
          (font-lock-flush)
        (gnus-message-citation-mode (font-lock-mode 1)))))

-- 
Morgan Willcock





reply via email to

[Prev in Thread] Current Thread [Next in Thread]