unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Morgan Willcock <morgan@ice9.digital>
To: Eric Abrahamsen <eric@ericabrahamsen.net>
Cc: 68352@debbugs.gnu.org
Subject: bug#68352: 29.1; gnus-message-citation-mode removes values from font-lock-keywords
Date: Wed, 10 Jan 2024 22:16:27 +0000	[thread overview]
Message-ID: <87y1cwrg04.fsf@ice9.digital> (raw)
In-Reply-To: <87le8xg3pg.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Tue, 09 Jan 2024 21:25:15 -0800")

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





  parent reply	other threads:[~2024-01-10 22:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-09 20:18 bug#68352: 29.1; gnus-message-citation-mode removes values from font-lock-keywords Morgan Willcock
2024-01-09 21:44 ` Eric Abrahamsen
2024-01-09 22:21   ` Morgan Willcock
2024-01-10  5:25     ` Eric Abrahamsen
2024-01-10 15:21       ` Eric Abrahamsen
2024-01-10 18:51         ` Eric Abrahamsen
2024-01-10 19:20           ` Morgan Willcock
2024-01-10 22:16       ` Morgan Willcock [this message]
2024-01-11 11:57         ` Morgan Willcock
2024-02-11  8:48           ` Eli Zaretskii
2024-02-11 14:49             ` Eric Abrahamsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y1cwrg04.fsf@ice9.digital \
    --to=morgan@ice9.digital \
    --cc=68352@debbugs.gnu.org \
    --cc=eric@ericabrahamsen.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).