GNU bug report logs - #68352
29.1; gnus-message-citation-mode removes values from font-lock-keywords

Previous Next

Package: emacs;

Reported by: Morgan Willcock <morgan <at> ice9.digital>

Date: Tue, 9 Jan 2024 20:20:02 UTC

Severity: normal

Found in version 29.1

Done: Eric Abrahamsen <eric <at> ericabrahamsen.net>

Bug is archived. No further changes may be made.

Full log


Message #26 received at 68352 <at> debbugs.gnu.org (full text, mbox):

From: Morgan Willcock <morgan <at> ice9.digital>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 68352 <at> debbugs.gnu.org
Subject: Re: bug#68352: 29.1; gnus-message-citation-mode removes values from
 font-lock-keywords
Date: Wed, 10 Jan 2024 22:16:27 +0000
Eric Abrahamsen <eric <at> 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




This bug report was last modified 1 year and 156 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.