From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Morgan Willcock Newsgroups: gmane.emacs.bugs Subject: bug#68352: 29.1; gnus-message-citation-mode removes values from font-lock-keywords Date: Wed, 10 Jan 2024 22:16:27 +0000 Message-ID: <87y1cwrg04.fsf@ice9.digital> References: <8734v62rc2.fsf@ice9.digital> <87plyafahh.fsf@ericabrahamsen.net> <87r0iq1735.fsf@ice9.digital> <87le8xg3pg.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="952"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 68352@debbugs.gnu.org To: Eric Abrahamsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 10 23:17:34 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rNgtC-000AZg-3g for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Jan 2024 23:17:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNgsj-0004Sx-85; Wed, 10 Jan 2024 17:17:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNgsh-0004SL-N1 for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2024 17:17:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNgsh-0001l0-Et for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2024 17:17:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rNgsg-0007bA-94 for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2024 17:17:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Morgan Willcock Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Jan 2024 22:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68352 X-GNU-PR-Package: emacs Original-Received: via spool by 68352-submit@debbugs.gnu.org id=B68352.170492499728827 (code B ref 68352); Wed, 10 Jan 2024 22:17:02 +0000 Original-Received: (at 68352) by debbugs.gnu.org; 10 Jan 2024 22:16:37 +0000 Original-Received: from localhost ([127.0.0.1]:43432 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNgsH-0007UZ-7a for submit@debbugs.gnu.org; Wed, 10 Jan 2024 17:16:37 -0500 Original-Received: from relay3-d.mail.gandi.net ([2001:4b98:dc4:8::223]:44983) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNgsE-0007N7-Ca for 68352@debbugs.gnu.org; Wed, 10 Jan 2024 17:16:35 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 470DE60003; Wed, 10 Jan 2024 22:16:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ice9.digital; s=gm1; t=1704924988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iePEm3nj/23TovHXcAMjyzPEYti/AkiPI9RxIxZqhqA=; b=TsqXFwj2HcVlWyEyCk7/QC2RSUY82+fuDOax4NnrC3+5ceIZIEEiAzMUG/ByLCdmCMwNw4 SD/ROU/VxvdttXvpqy89qL/rlPimdCk16BYM0ejsguC0i+F3fVuZtWUv+xM3KF6ML3mbS0 zZ2n2Rc1158ve16KnSw1eN67z/CAuzL0FpmgqOOuIPfa2Q23l4uEvKZJFOaoIHhhEkKK3z e0D4BVl8g94Jzia7yFCEmtzi91kmu+wMDTEiP3FT5iUfAt218KY9WObovseS+ULETTU6N4 ohacideot92t9p8jtPrJ9hOhGNBwOmJ2jOkLQvr9VVsRWfWdeR95upmERNtZMQ== In-Reply-To: <87le8xg3pg.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Tue, 09 Jan 2024 21:25:15 -0800") X-GND-Sasl: morgan@ice9.digital X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:277837 Archived-At: Eric Abrahamsen 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