From unknown Fri Aug 15 02:04:07 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#68352 <68352@debbugs.gnu.org> To: bug#68352 <68352@debbugs.gnu.org> Subject: Status: 29.1; gnus-message-citation-mode removes values from font-lock-keywords Reply-To: bug#68352 <68352@debbugs.gnu.org> Date: Fri, 15 Aug 2025 09:04:07 +0000 retitle 68352 29.1; gnus-message-citation-mode removes values from font-loc= k-keywords reassign 68352 emacs submitter 68352 Morgan Willcock severity 68352 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 09 15:19:04 2024 Received: (at submit) by debbugs.gnu.org; 9 Jan 2024 20:19:05 +0000 Received: from localhost ([127.0.0.1]:41095 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNIYx-0006pT-Kx for submit@debbugs.gnu.org; Tue, 09 Jan 2024 15:19:04 -0500 Received: from lists.gnu.org ([2001:470:142::17]:46394) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNIYu-0006oy-JR for submit@debbugs.gnu.org; Tue, 09 Jan 2024 15:19:01 -0500 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 1rNIYi-0002R6-5B for bug-gnu-emacs@gnu.org; Tue, 09 Jan 2024 15:18:48 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNIYe-0004GG-K1 for bug-gnu-emacs@gnu.org; Tue, 09 Jan 2024 15:18:47 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id A8E08E0003 for ; Tue, 9 Jan 2024 20:18:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ice9.digital; s=gm1; t=1704831519; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=wzIx7JGA4F1RrhvHZrR1fhMKxvpu7fA4fGWOdo0QD6w=; b=WYMNegXUe2muGEw5m+1MZKO3aartlK21m0WF/NJT3zEssmC2SRuk8/Wfd4FgOjHlEVIWUS QxJmxT0Aja4zQqlULh4uCy6+Uaapv6MZ1h2wNZV7MkTIpyI6HKskt/b1/UlrWM0bEpSkjF WLUSL+PkCK1Pvt75mUVCu5ixqPtzPQ0RKLhQ7su7yw04gmwgj5WbUctJXG0XhjHPVOObHB BdJGmwNvVhGvKrT0jlA+qWW9f3hR9OheQQ7ECx4FppNNOoXWkXwfe+qDb1TddcruFkfe31 Peqfj8DWwzxjbA82ttpSknTWpwUDO5TDjjfddUpXS2VyTg+BsGX3snRkoEaAww== From: Morgan Willcock To: bug-gnu-emacs@gnu.org Subject: 29.1; gnus-message-citation-mode removes values from font-lock-keywords Date: Tue, 09 Jan 2024 20:18:37 +0000 Message-ID: <8734v62rc2.fsf@ice9.digital> MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: morgan@ice9.digital Received-SPF: pass client-ip=217.70.183.196; envelope-from=morgan@ice9.digital; helo=relay4-d.mail.gandi.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) When Gnus enables gnus-message-citation-mode in message buffers, as it does by default, it calls the function `font-lock-set-defaults' and loses any additional font-lock rules which may have been added by global minor-modes. The best example to demonstrate the problem is by enabling global-whitespace-mode. The font-lock rules for whitespace are lost when gnus-message-citation-mode is enabled, which means that global-whitespace-mode will work correctly in plain message buffers, but will appear to be broken in message buffers opened by Gnus. Example for use with emacs -Q: (require 'gnus-cite) (require 'whitespace) (add-function :before-until whitespace-enable-predicate (lambda () (eq major-mode 'message-mode))) (global-whitespace-mode) (compose-mail) ;; Whitespace font-lock rules are present in `font-lock-keywords' at ;; this point. (gnus-message-citation-mode) ;; `font-lock-keywords' has now been reset, and the font-lock rules ;; for citations are added, but the whitespace font-lock rules have ;; been lost. In GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars) of 2023-07-31 built on inspiron Windowing system distributor 'The X.Org Foundation', version 11.0.12101007 System Description: Debian GNU/Linux 12 (bookworm) Configured using: 'configure --with-native-compilation --with-cairo --with-json --with-xml2 --with-x-toolkit=lucid' Configured features: CAIRO FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LIBSELINUX LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XAW3D XDBE XIM XPM LUCID ZLIB Important settings: value of $LANG: en_GB.UTF-8 locale-coding-system: utf-8-unix Major mode: Org-Agenda Week Ddl Grid Minor modes in effect: server-mode: t global-corfu-mode: t corfu-mode: t jabber-activity-mode: t which-key-mode: t global-devil-mode: t devil-mode: t global-whitespace-mode: t erc-spelling-mode: t savehist-mode: t minibuffer-electric-default-mode: t minibuffer-depth-indicate-mode: t ido-everywhere: t recentf-mode: t shell-dirtrack-mode: t global-hl-line-mode: t display-time-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t blink-cursor-mode: t buffer-read-only: t column-number-mode: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /home/mwillcock/.emacs.d/custom/powershell.el/powershell hides /home/mwillcock/.emacs.d/custom/powershell /home/mwillcock/.emacs.d/elpa/flymake-1.3.7/flymake hides /usr/local/share/emacs/29.1/lisp/progmodes/flymake /home/mwillcock/.emacs.d/elpa/project-0.10.0/project hides /usr/local/share/emacs/29.1/lisp/progmodes/project /home/mwillcock/.emacs.d/elpa/org-9.6.16/ol-man hides /usr/local/share/emacs/29.1/lisp/org/ol-man /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-colview hides /usr/local/share/emacs/29.1/lisp/org/org-colview /home/mwillcock/.emacs.d/elpa/org-9.6.16/ox-texinfo hides /usr/local/share/emacs/29.1/lisp/org/ox-texinfo /home/mwillcock/.emacs.d/elpa/org-9.6.16/ol-doi hides /usr/local/share/emacs/29.1/lisp/org/ol-doi /home/mwillcock/.emacs.d/elpa/org-9.6.16/ol-docview hides /usr/local/share/emacs/29.1/lisp/org/ol-docview /home/mwillcock/.emacs.d/elpa/org-9.6.16/ox-ascii hides /usr/local/share/emacs/29.1/lisp/org/ox-ascii /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-refile hides /usr/local/share/emacs/29.1/lisp/org/org-refile /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-ctags hides /usr/local/share/emacs/29.1/lisp/org/org-ctags /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-latex hides /usr/local/share/emacs/29.1/lisp/org/ob-latex /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-clojure hides /usr/local/share/emacs/29.1/lisp/org/ob-clojure /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-inlinetask hides /usr/local/share/emacs/29.1/lisp/org/org-inlinetask /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-js hides /usr/local/share/emacs/29.1/lisp/org/ob-js /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-groovy hides /usr/local/share/emacs/29.1/lisp/org/ob-groovy /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-lua hides /usr/local/share/emacs/29.1/lisp/org/ob-lua /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-lilypond hides /usr/local/share/emacs/29.1/lisp/org/ob-lilypond /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-table hides /usr/local/share/emacs/29.1/lisp/org/ob-table /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-id hides /usr/local/share/emacs/29.1/lisp/org/org-id /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-compat hides /usr/local/share/emacs/29.1/lisp/org/org-compat /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-exp hides /usr/local/share/emacs/29.1/lisp/org/ob-exp /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-version hides /usr/local/share/emacs/29.1/lisp/org/org-version /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-R hides /usr/local/share/emacs/29.1/lisp/org/ob-R /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-indent hides /usr/local/share/emacs/29.1/lisp/org/org-indent /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-julia hides /usr/local/share/emacs/29.1/lisp/org/ob-julia /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-sed hides /usr/local/share/emacs/29.1/lisp/org/ob-sed /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-keys hides /usr/local/share/emacs/29.1/lisp/org/org-keys /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-ditaa hides /usr/local/share/emacs/29.1/lisp/org/ob-ditaa /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-lint hides /usr/local/share/emacs/29.1/lisp/org/org-lint /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-ruby hides /usr/local/share/emacs/29.1/lisp/org/ob-ruby /home/mwillcock/.emacs.d/elpa/org-9.6.16/oc-bibtex hides /usr/local/share/emacs/29.1/lisp/org/oc-bibtex /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-core hides /usr/local/share/emacs/29.1/lisp/org/ob-core /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-comint hides /usr/local/share/emacs/29.1/lisp/org/ob-comint /home/mwillcock/.emacs.d/elpa/org-9.6.16/ol hides /usr/local/share/emacs/29.1/lisp/org/ol /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-capture hides /usr/local/share/emacs/29.1/lisp/org/org-capture /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-agenda hides /usr/local/share/emacs/29.1/lisp/org/org-agenda /home/mwillcock/.emacs.d/elpa/org-9.6.16/ol-gnus hides /usr/local/share/emacs/29.1/lisp/org/ol-gnus /home/mwillcock/.emacs.d/elpa/org-9.6.16/ox-koma-letter hides /usr/local/share/emacs/29.1/lisp/org/ox-koma-letter /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-haskell hides /usr/local/share/emacs/29.1/lisp/org/ob-haskell /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-faces hides /usr/local/share/emacs/29.1/lisp/org/org-faces /home/mwillcock/.emacs.d/elpa/org-9.6.16/org hides /usr/local/share/emacs/29.1/lisp/org/org /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-dot hides /usr/local/share/emacs/29.1/lisp/org/ob-dot /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-lisp hides /usr/local/share/emacs/29.1/lisp/org/ob-lisp /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-awk hides /usr/local/share/emacs/29.1/lisp/org/ob-awk /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-element hides /usr/local/share/emacs/29.1/lisp/org/org-element /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-goto hides /usr/local/share/emacs/29.1/lisp/org/org-goto /home/mwillcock/.emacs.d/elpa/org-9.6.16/ox-org hides /usr/local/share/emacs/29.1/lisp/org/ox-org /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-makefile hides /usr/local/share/emacs/29.1/lisp/org/ob-makefile /home/mwillcock/.emacs.d/elpa/org-9.6.16/ox-publish hides /usr/local/share/emacs/29.1/lisp/org/ox-publish /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-maxima hides /usr/local/share/emacs/29.1/lisp/org/ob-maxima /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-loaddefs hides /usr/local/share/emacs/29.1/lisp/org/org-loaddefs /home/mwillcock/.emacs.d/elpa/org-9.6.16/oc hides /usr/local/share/emacs/29.1/lisp/org/oc /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-python hides /usr/local/share/emacs/29.1/lisp/org/ob-python /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-screen hides /usr/local/share/emacs/29.1/lisp/org/ob-screen /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-C hides /usr/local/share/emacs/29.1/lisp/org/ob-C /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-mouse hides /usr/local/share/emacs/29.1/lisp/org/org-mouse /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-attach-git hides /usr/local/share/emacs/29.1/lisp/org/org-attach-git /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-shell hides /usr/local/share/emacs/29.1/lisp/org/ob-shell /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-gnuplot hides /usr/local/share/emacs/29.1/lisp/org/ob-gnuplot /home/mwillcock/.emacs.d/elpa/org-9.6.16/ox-beamer hides /usr/local/share/emacs/29.1/lisp/org/ox-beamer /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-pcomplete hides /usr/local/share/emacs/29.1/lisp/org/org-pcomplete /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-tempo hides /usr/local/share/emacs/29.1/lisp/org/org-tempo /home/mwillcock/.emacs.d/elpa/org-9.6.16/ox-odt hides /usr/local/share/emacs/29.1/lisp/org/ox-odt /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-lob hides /usr/local/share/emacs/29.1/lisp/org/ob-lob /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-sass hides /usr/local/share/emacs/29.1/lisp/org/ob-sass /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-fold-core hides /usr/local/share/emacs/29.1/lisp/org/org-fold-core /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-table hides /usr/local/share/emacs/29.1/lisp/org/org-table /home/mwillcock/.emacs.d/elpa/org-9.6.16/ol-irc hides /usr/local/share/emacs/29.1/lisp/org/ol-irc /home/mwillcock/.emacs.d/elpa/org-9.6.16/oc-basic hides /usr/local/share/emacs/29.1/lisp/org/oc-basic /home/mwillcock/.emacs.d/elpa/org-9.6.16/ox-md hides /usr/local/share/emacs/29.1/lisp/org/ox-md /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-emacs-lisp hides /usr/local/share/emacs/29.1/lisp/org/ob-emacs-lisp /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-macs hides /usr/local/share/emacs/29.1/lisp/org/org-macs /home/mwillcock/.emacs.d/elpa/org-9.6.16/ol-w3m hides /usr/local/share/emacs/29.1/lisp/org/ol-w3m /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-datetree hides /usr/local/share/emacs/29.1/lisp/org/org-datetree /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-persist hides /usr/local/share/emacs/29.1/lisp/org/org-persist /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-matlab hides /usr/local/share/emacs/29.1/lisp/org/ob-matlab /home/mwillcock/.emacs.d/elpa/org-9.6.16/ol-mhe hides /usr/local/share/emacs/29.1/lisp/org/ol-mhe /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-cycle hides /usr/local/share/emacs/29.1/lisp/org/org-cycle /home/mwillcock/.emacs.d/elpa/org-9.6.16/ox-man hides /usr/local/share/emacs/29.1/lisp/org/ox-man /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-ref hides /usr/local/share/emacs/29.1/lisp/org/ob-ref /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-archive hides /usr/local/share/emacs/29.1/lisp/org/org-archive /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob hides /usr/local/share/emacs/29.1/lisp/org/ob /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-scheme hides /usr/local/share/emacs/29.1/lisp/org/ob-scheme /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-org hides /usr/local/share/emacs/29.1/lisp/org/ob-org /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-eshell hides /usr/local/share/emacs/29.1/lisp/org/ob-eshell /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-crypt hides /usr/local/share/emacs/29.1/lisp/org/org-crypt /home/mwillcock/.emacs.d/elpa/org-9.6.16/ol-rmail hides /usr/local/share/emacs/29.1/lisp/org/ol-rmail /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-plot hides /usr/local/share/emacs/29.1/lisp/org/org-plot /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-clock hides /usr/local/share/emacs/29.1/lisp/org/org-clock /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-macro hides /usr/local/share/emacs/29.1/lisp/org/org-macro /home/mwillcock/.emacs.d/elpa/org-9.6.16/ox-icalendar hides /usr/local/share/emacs/29.1/lisp/org/ox-icalendar /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-fortran hides /usr/local/share/emacs/29.1/lisp/org/ob-fortran /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-plantuml hides /usr/local/share/emacs/29.1/lisp/org/ob-plantuml /home/mwillcock/.emacs.d/elpa/org-9.6.16/ol-bibtex hides /usr/local/share/emacs/29.1/lisp/org/ol-bibtex /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-protocol hides /usr/local/share/emacs/29.1/lisp/org/org-protocol /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-octave hides /usr/local/share/emacs/29.1/lisp/org/ob-octave /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-timer hides /usr/local/share/emacs/29.1/lisp/org/org-timer /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-forth hides /usr/local/share/emacs/29.1/lisp/org/ob-forth /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-feed hides /usr/local/share/emacs/29.1/lisp/org/org-feed /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-list hides /usr/local/share/emacs/29.1/lisp/org/org-list /home/mwillcock/.emacs.d/elpa/org-9.6.16/ol-info hides /usr/local/share/emacs/29.1/lisp/org/ol-info /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-perl hides /usr/local/share/emacs/29.1/lisp/org/ob-perl /home/mwillcock/.emacs.d/elpa/org-9.6.16/oc-csl hides /usr/local/share/emacs/29.1/lisp/org/oc-csl /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-processing hides /usr/local/share/emacs/29.1/lisp/org/ob-processing /home/mwillcock/.emacs.d/elpa/org-9.6.16/ol-eshell hides /usr/local/share/emacs/29.1/lisp/org/ol-eshell /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-eval hides /usr/local/share/emacs/29.1/lisp/org/ob-eval /home/mwillcock/.emacs.d/elpa/org-9.6.16/ox hides /usr/local/share/emacs/29.1/lisp/org/ox /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-habit hides /usr/local/share/emacs/29.1/lisp/org/org-habit /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-calc hides /usr/local/share/emacs/29.1/lisp/org/ob-calc /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-footnote hides /usr/local/share/emacs/29.1/lisp/org/org-footnote /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-attach hides /usr/local/share/emacs/29.1/lisp/org/org-attach /home/mwillcock/.emacs.d/elpa/org-9.6.16/ox-latex hides /usr/local/share/emacs/29.1/lisp/org/ox-latex /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-ocaml hides /usr/local/share/emacs/29.1/lisp/org/ob-ocaml /home/mwillcock/.emacs.d/elpa/org-9.6.16/ol-eww hides /usr/local/share/emacs/29.1/lisp/org/ol-eww /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-css hides /usr/local/share/emacs/29.1/lisp/org/ob-css /home/mwillcock/.emacs.d/elpa/org-9.6.16/ox-html hides /usr/local/share/emacs/29.1/lisp/org/ox-html /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-mobile hides /usr/local/share/emacs/29.1/lisp/org/org-mobile /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-sqlite hides /usr/local/share/emacs/29.1/lisp/org/ob-sqlite /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-tangle hides /usr/local/share/emacs/29.1/lisp/org/ob-tangle /home/mwillcock/.emacs.d/elpa/org-9.6.16/oc-biblatex hides /usr/local/share/emacs/29.1/lisp/org/oc-biblatex /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-java hides /usr/local/share/emacs/29.1/lisp/org/ob-java /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-entities hides /usr/local/share/emacs/29.1/lisp/org/org-entities /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-num hides /usr/local/share/emacs/29.1/lisp/org/org-num /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-duration hides /usr/local/share/emacs/29.1/lisp/org/org-duration /home/mwillcock/.emacs.d/elpa/org-9.6.16/ol-bbdb hides /usr/local/share/emacs/29.1/lisp/org/ol-bbdb /home/mwillcock/.emacs.d/elpa/org-9.6.16/ob-sql hides /usr/local/share/emacs/29.1/lisp/org/ob-sql /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-src hides /usr/local/share/emacs/29.1/lisp/org/org-src /home/mwillcock/.emacs.d/elpa/org-9.6.16/org-fold hides /usr/local/share/emacs/29.1/lisp/org/org-fold /home/mwillcock/.emacs.d/elpa/org-9.6.16/oc-natbib hides /usr/local/share/emacs/29.1/lisp/org/oc-natbib /home/mwillcock/.emacs.d/elpa/eldoc-1.15.0/eldoc hides /usr/local/share/emacs/29.1/lisp/emacs-lisp/eldoc Features: (shadow sort ecomplete mail-extr emacsbug gnus-topic nndraft nnmh utf-7 cursor-sensor epa-file network-stream nsm nnfolder nnnil gnus-agent gnus-srvr gnus-score score-mode nnvirtual nntp gnus-cache server cal-iso autorevert face-remap display-fill-column-indicator init corfu powershell php-mode mode-local speedbar ezimage dframe php-face php php-project jabber jabber-ourversion hippie-exp hexrgb fsm sgml-mode facemenu sasl sasl-anonymous sasl-login sasl-plain srv dns starttls tls goto-addr yaml-mode markdown-mode lua-mode advice edmacro kmacro kixtart-mode tempo org-msg let-alist color ox-odt rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok nxml-util ox-latex ox-icalendar ox-html table ox-ascii ox-publish ox htmlize gnus-msg gnus-icalendar icalendar gnus-dired gnus-cite which-key devil delight comp comp-cstr ags-mode whitespace eglot external-completion array jsonrpc ert ewoc debug backtrace xref flymake warnings imenu python project treesit cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs erc-spelling flyspell erc-track erc-match erc-join erc-goodies erc erc-backend erc-networks erc-common erc-compat compat erc-loaddefs ediff ediff-merg ediff-mult ediff-wind ediff-diff ediff-help ediff-init ediff-util vc-git diff-mode easy-mmode vc-dispatcher org-indent oc-basic cl-extra ol-eww eww url-queue thingatpt mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-art mm-uu mml2015 gnus-sum ol-docview doc-view filenotify jka-compr image-mode exif ol-bibtex bibtex ol-bbdb ol-w3m ol-doi org-link-doi appt diary-lib diary-loaddefs org-capture ob-shell ob-plantuml ob-dot org-goto org-clock org-duration org-agenda org-element org-persist xdg org-id avl-tree generator org-refile org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src ob-comint org-pcomplete org-list org-footnote org-faces org-entities noutline outline ob-emacs-lisp ob-core ob-eval org-cycle org-table ol org-fold org-fold-core org-keys oc org-loaddefs org-version org-compat org-macs autoinsert compile bookmark savehist crm minibuf-eldef mb-depth ido tramp-cache time-stamp tramp-sh tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat rx format-spec cus-edit pp cus-load icons recentf tree-widget shell pcomplete comint ansi-osc ansi-color ring hl-line time gnus-group gnus-undo gnus-start gnus-dbus dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time iso8601 gnus-spec gnus-int gnus-range gnus-win gnus nnheader range wid-edit dictionary dictionary-connection ispell shr pixel-fill kinsoku url-file svg xml dom modus-vivendi-theme modus-themes mm-view mml-smime smime gnutls dig smtpmail message sendmail yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader epg-config help-mode find-func cal-menu calendar cal-loaddefs pcase corfu-autoloads compat-autoloads delight-autoloads do-at-point-autoloads flymake-autoloads eldoc-autoloads fsm-autoloads htmlize-autoloads lua-mode-autoloads markdown-mode-autoloads modus-themes-autoloads info org-autoloads php-mode-autoloads project-autoloads rainbow-mode-autoloads renpy-mode-autoloads which-key-autoloads yaml-mode-autoloads package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads inotify dynamic-setting system-font-setting font-render-setting cairo x-toolkit x multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 1428121 74014) (symbols 48 46088 5) (strings 32 227105 18973) (string-bytes 1 6409197) (vectors 16 92579) (vector-slots 8 2267284 72324) (floats 8 717 235) (intervals 56 97870 0) (buffers 976 17)) -- Morgan Willcock From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 09 16:44:32 2024 Received: (at 68352) by debbugs.gnu.org; 9 Jan 2024 21:44:32 +0000 Received: from localhost ([127.0.0.1]:41145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNJtg-0005G2-7g for submit@debbugs.gnu.org; Tue, 09 Jan 2024 16:44:32 -0500 Received: from mail.ericabrahamsen.net ([52.70.2.18]:43276) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNJte-0005Fo-Hm for 68352@debbugs.gnu.org; Tue, 09 Jan 2024 16:44:31 -0500 Received: from localhost (71-212-21-65.tukw.qwest.net [71.212.21.65]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 06508FA0D9; Tue, 9 Jan 2024 21:44:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1704836657; bh=xMX7qH5MPCHvYL3w51rmfmBdK9lhJh338sNihwpREW8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=JY+41YNhliE9TO7Mt3965T1akpqB/97YNWhT80TwGNjEPaTqiPj3gpkAYLxshP0og Q0E6/T+vT0FQml4cW3s65xBkAphd7EIh9Z99tu72YTo2aA0JKzjMEfKxmyBN6LorQ6 rDihay2+pPOl6DweL17ZHwerHtzQqXCIltCN7MVk= From: Eric Abrahamsen To: Morgan Willcock Subject: Re: bug#68352: 29.1; gnus-message-citation-mode removes values from font-lock-keywords In-Reply-To: <8734v62rc2.fsf@ice9.digital> (Morgan Willcock's message of "Tue, 09 Jan 2024 20:18:37 +0000") References: <8734v62rc2.fsf@ice9.digital> Date: Tue, 09 Jan 2024 13:44:10 -0800 Message-ID: <87plyafahh.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 68352 Cc: 68352@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Morgan Willcock writes: > When Gnus enables gnus-message-citation-mode in message buffers, as it > does by default, it calls the function `font-lock-set-defaults' and > loses any additional font-lock rules which may have been added by global > minor-modes. Thanks for the report. I don't know font locking well enough to know what the right solution is here. It looks calling `font-lock-flush' will also end up calling `font-lock-set-defaults' as well, at least with default values: font-lock-flush-function -> font-lock-after-change-function -> font-lock-fontify-region -> font-lock-set-defaults Is the problem setting `font-lock-set-defaults' to nil? Is there anything else you can recommend? Thanks, Eric From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 09 17:21:36 2024 Received: (at 68352) by debbugs.gnu.org; 9 Jan 2024 22:21:36 +0000 Received: from localhost ([127.0.0.1]:41190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNKTY-0005dk-5T for submit@debbugs.gnu.org; Tue, 09 Jan 2024 17:21:36 -0500 Received: from relay5-d.mail.gandi.net ([2001:4b98:dc4:8::225]:40005) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNKTW-0005dW-AG for 68352@debbugs.gnu.org; Tue, 09 Jan 2024 17:21:35 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id 1D9331C0003; Tue, 9 Jan 2024 22:21:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ice9.digital; s=gm1; t=1704838880; 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=dvjW1m4zOHl/+SHZvw4jV07HN5iGanRRstmlrD/1U/k=; b=g7g3zhdcNiR+GDsDJajzeOQ5hdBc+T2zrTu+i7j9PtjuJwxvwG5WIAiDhRX2BNcelY0thc 4s3FQ9iJ7OWV61FllxDsw+E/skHzCfnAenY7Et9jQFE3khC2Ot3mpckZ7ZyFzlNT71xdk7 VwAyi1M7HGDNN/Hb6jUsmwTxntM7vJEiaQhRQNC5jZNhQ0W43seLM7mj/tbqDNp9q1fR/j NvC5R5zXpMFNKzHTsSB6AvE+LcdBC2bFDkpKzZkEvJY9kSnVOKXIyuPyYXVJQeatkwPVFW qXkcRkLQuZrRgosuZXk7BempF1g/Mg6Axrn7KUPrMVyw//9f07NXZRYtFoZOow== From: Morgan Willcock To: Eric Abrahamsen Subject: Re: bug#68352: 29.1; gnus-message-citation-mode removes values from font-lock-keywords In-Reply-To: <87plyafahh.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Tue, 09 Jan 2024 13:44:10 -0800") References: <8734v62rc2.fsf@ice9.digital> <87plyafahh.fsf@ericabrahamsen.net> Date: Tue, 09 Jan 2024 22:21:18 +0000 Message-ID: <87r0iq1735.fsf@ice9.digital> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: morgan@ice9.digital X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 68352 Cc: 68352@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eric Abrahamsen writes: > Morgan Willcock writes: > >> When Gnus enables gnus-message-citation-mode in message buffers, as it >> does by default, it calls the function `font-lock-set-defaults' and >> loses any additional font-lock rules which may have been added by global >> minor-modes. > > Thanks for the report. I don't know font locking well enough to know > what the right solution is here. It looks calling `font-lock-flush' will > also end up calling `font-lock-set-defaults' as well, at least with > default values: > > font-lock-flush-function -> > font-lock-after-change-function -> > font-lock-fontify-region -> > font-lock-set-defaults > > Is the problem setting `font-lock-set-defaults' to nil? Is there > anything else you can recommend? I think that I did test not setting `font-lock-set-defaults' to nil to see if that made a difference, but the same problem was still there. I don't know very much myself, but in that section of code there is a comment left by Stefan Monnier: ;; FIXME: Use font-lock-add-keywords! So I would guess that the correct solution would be to add the citation font-locking rules with `font-lock-add-keywords' and then remove them again with `font-lock-remove-keywords' if the mode is ever disabled, and if the highlighting needs an update after those changes, call `font-lock-flush'. (When testing I'm not seeing that a call to `font-lock-flush' will lose any values from `font-lock-keywords'.) -- Morgan Willcock From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 10 00:25:39 2024 Received: (at 68352) by debbugs.gnu.org; 10 Jan 2024 05:25:39 +0000 Received: from localhost ([127.0.0.1]:41574 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNR5v-0005sf-7o for submit@debbugs.gnu.org; Wed, 10 Jan 2024 00:25:39 -0500 Received: from mail.ericabrahamsen.net ([52.70.2.18]:52504) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNR5t-0005sN-8E for 68352@debbugs.gnu.org; Wed, 10 Jan 2024 00:25:38 -0500 Received: from localhost (71-212-21-65.tukw.qwest.net [71.212.21.65]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 82852FA02E; Wed, 10 Jan 2024 05:25:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1704864321; bh=5HvCLVPZDYMVmsp1mbCyON9KKzo9yx2lxEsCpKtAq1I=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=bpGyCbdVqEEAZdknj1K6XbSSigy50QCvXN93DYCo62jWi4a/dpQZbIQaExvr5YIRt ghK0csxPVzAxYqZi0d01hklDLD2HH0L0OudJnMtpyg76N8cQMY3fP96/IIOX6HFbOn yGCkZmZSrs17pmJCUfp9nnXbDRODzUzumcxwCEWE= From: Eric Abrahamsen To: Morgan Willcock Subject: Re: bug#68352: 29.1; gnus-message-citation-mode removes values from font-lock-keywords In-Reply-To: <87r0iq1735.fsf@ice9.digital> (Morgan Willcock's message of "Tue, 09 Jan 2024 22:21:18 +0000") References: <8734v62rc2.fsf@ice9.digital> <87plyafahh.fsf@ericabrahamsen.net> <87r0iq1735.fsf@ice9.digital> Date: Tue, 09 Jan 2024 21:25:15 -0800 Message-ID: <87le8xg3pg.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 68352 Cc: 68352@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Morgan Willcock writes: > Eric Abrahamsen writes: > >> Morgan Willcock writes: >> >>> When Gnus enables gnus-message-citation-mode in message buffers, as it >>> does by default, it calls the function `font-lock-set-defaults' and >>> loses any additional font-lock rules which may have been added by global >>> minor-modes. >> >> Thanks for the report. I don't know font locking well enough to know >> what the right solution is here. It looks calling `font-lock-flush' will >> also end up calling `font-lock-set-defaults' as well, at least with >> default values: >> >> font-lock-flush-function -> >> font-lock-after-change-function -> >> font-lock-fontify-region -> >> font-lock-set-defaults >> >> Is the problem setting `font-lock-set-defaults' to nil? Is there >> anything else you can recommend? > > I think that I did test not setting `font-lock-set-defaults' to nil to > see if that made a difference, but the same problem was still there. > > I don't know very much myself, but in that section of code there is a > comment left by Stefan Monnier: > > ;; FIXME: Use font-lock-add-keywords! Ha, my eyes went right by that comment. > So I would guess that the correct solution would be to add the citation > font-locking rules with `font-lock-add-keywords' and then remove them > again with `font-lock-remove-keywords' if the mode is ever disabled, and > if the highlighting needs an update after those changes, call > `font-lock-flush'. 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))))) From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 10 10:21:48 2024 Received: (at 68352) by debbugs.gnu.org; 10 Jan 2024 15:21:48 +0000 Received: from localhost ([127.0.0.1]:42487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNaOq-0005fh-8U for submit@debbugs.gnu.org; Wed, 10 Jan 2024 10:21:48 -0500 Received: from mail.ericabrahamsen.net ([52.70.2.18]:37628) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNaOo-0005fS-1Y for 68352@debbugs.gnu.org; Wed, 10 Jan 2024 10:21:46 -0500 Received: from localhost (71-212-21-65.tukw.qwest.net [71.212.21.65]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 1A614FA0D9; Wed, 10 Jan 2024 15:21:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1704900100; bh=ng4HQV07NxEiVf9w0oUsT7qFa1bdTeocO5c6w34dUNw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Y8me8yGzpeqGpOBV3680rgSlE2MsgRU7E9uFYRdiVVKY6UQUNqQ5/K0QeJ3NQ3YHC yrzdY77Gh0D8j6VCIxkgnbEdcfs7dnM+QZzr+fQUVxJBrPvDzggnvkIcvioE43+pgL nqm4iTef43kDub3GJgcynrcJs5Zdayn0vzC/YkT4= From: Eric Abrahamsen To: Morgan Willcock Subject: Re: bug#68352: 29.1; gnus-message-citation-mode removes values from font-lock-keywords In-Reply-To: <87le8xg3pg.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Tue, 09 Jan 2024 21:25:15 -0800") References: <8734v62rc2.fsf@ice9.digital> <87plyafahh.fsf@ericabrahamsen.net> <87r0iq1735.fsf@ice9.digital> <87le8xg3pg.fsf@ericabrahamsen.net> Date: Wed, 10 Jan 2024 07:21:38 -0800 Message-ID: <87wmshdxj1.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 68352 Cc: 68352@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eric Abrahamsen writes: > Morgan Willcock writes: > >> Eric Abrahamsen writes: >> >>> Morgan Willcock writes: >>> >>>> When Gnus enables gnus-message-citation-mode in message buffers, as it >>>> does by default, it calls the function `font-lock-set-defaults' and >>>> loses any additional font-lock rules which may have been added by global >>>> minor-modes. >>> >>> Thanks for the report. I don't know font locking well enough to know >>> what the right solution is here. It looks calling `font-lock-flush' will >>> also end up calling `font-lock-set-defaults' as well, at least with >>> default values: >>> >>> font-lock-flush-function -> >>> font-lock-after-change-function -> >>> font-lock-fontify-region -> >>> font-lock-set-defaults >>> >>> Is the problem setting `font-lock-set-defaults' to nil? Is there >>> anything else you can recommend? >> >> I think that I did test not setting `font-lock-set-defaults' to nil to >> see if that made a difference, but the same problem was still there. >> >> I don't know very much myself, but in that section of code there is a >> comment left by Stefan Monnier: >> >> ;; FIXME: Use font-lock-add-keywords! > > Ha, my eyes went right by that comment. > >> So I would guess that the correct solution would be to add the citation >> font-locking rules with `font-lock-add-keywords' and then remove them >> again with `font-lock-remove-keywords' if the mode is ever disabled, and >> if the highlighting needs an update after those changes, call >> `font-lock-flush'. > > 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))))) No, that doesn't do it. The thing is, even if you defuse this minor mode entirely (I replaced the body with `(message "Whee!")'), global-whitespace-mode has already been overridden by the time we come to run this minor-mode function. It's already getting clobbered at some earlier point. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 10 13:51:58 2024 Received: (at 68352) by debbugs.gnu.org; 10 Jan 2024 18:51:58 +0000 Received: from localhost ([127.0.0.1]:43198 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNdgE-0006pf-2S for submit@debbugs.gnu.org; Wed, 10 Jan 2024 13:51:58 -0500 Received: from mail.ericabrahamsen.net ([52.70.2.18]:45056) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNdgC-0006pU-EV for 68352@debbugs.gnu.org; Wed, 10 Jan 2024 13:51:57 -0500 Received: from localhost (71-212-21-65.tukw.qwest.net [71.212.21.65]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id DF177FA0D9; Wed, 10 Jan 2024 18:51:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1704912711; bh=/WJ0XzHxB7S1cZ11fst24z4sJqNRSNM+W0fZtLgM6Ic=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=mBMjdKc+5OSyTOOH2TiBaJqs6fqxPRZVHoT1uRx9MIu/tyt2NX0zaAeEXWJjUw2Mj VU25Swk7yDRggEcxmbHXB3Rrubx+pV6hKjACZPcj7oIcbHMeZm3Yl/MhONCoafhhUB xuTXVE1aRZjdA1b8Z5lrOdkGMWgwIMDJKDrzS4/4= From: Eric Abrahamsen To: Morgan Willcock Subject: Re: bug#68352: 29.1; gnus-message-citation-mode removes values from font-lock-keywords In-Reply-To: <87wmshdxj1.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Wed, 10 Jan 2024 07:21:38 -0800") References: <8734v62rc2.fsf@ice9.digital> <87plyafahh.fsf@ericabrahamsen.net> <87r0iq1735.fsf@ice9.digital> <87le8xg3pg.fsf@ericabrahamsen.net> <87wmshdxj1.fsf@ericabrahamsen.net> Date: Wed, 10 Jan 2024 10:51:49 -0800 Message-ID: <875y01dnsq.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 68352 Cc: 68352@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eric Abrahamsen writes: > Eric Abrahamsen writes: > >> Morgan Willcock writes: >> >>> Eric Abrahamsen writes: >>> >>>> Morgan Willcock writes: >>>> >>>>> When Gnus enables gnus-message-citation-mode in message buffers, as it >>>>> does by default, it calls the function `font-lock-set-defaults' and >>>>> loses any additional font-lock rules which may have been added by global >>>>> minor-modes. >>>> >>>> Thanks for the report. I don't know font locking well enough to know >>>> what the right solution is here. It looks calling `font-lock-flush' will >>>> also end up calling `font-lock-set-defaults' as well, at least with >>>> default values: >>>> >>>> font-lock-flush-function -> >>>> font-lock-after-change-function -> >>>> font-lock-fontify-region -> >>>> font-lock-set-defaults >>>> >>>> Is the problem setting `font-lock-set-defaults' to nil? Is there >>>> anything else you can recommend? >>> >>> I think that I did test not setting `font-lock-set-defaults' to nil to >>> see if that made a difference, but the same problem was still there. >>> >>> I don't know very much myself, but in that section of code there is a >>> comment left by Stefan Monnier: >>> >>> ;; FIXME: Use font-lock-add-keywords! >> >> Ha, my eyes went right by that comment. >> >>> So I would guess that the correct solution would be to add the citation >>> font-locking rules with `font-lock-add-keywords' and then remove them >>> again with `font-lock-remove-keywords' if the mode is ever disabled, and >>> if the highlighting needs an update after those changes, call >>> `font-lock-flush'. >> >> 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))))) > > No, that doesn't do it. The thing is, even if you defuse this minor mode > entirely (I replaced the body with `(message "Whee!")'), > global-whitespace-mode has already been overridden by the time we come > to run this minor-mode function. It's already getting clobbered at some > earlier point. Actually, it might just be that something about message-mode suppresses whitespace-mode altogether. Even if I turn it on *after* starting a reply, no font-locking of whitespace is done. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 10 14:20:29 2024 Received: (at 68352) by debbugs.gnu.org; 10 Jan 2024 19:20:29 +0000 Received: from localhost ([127.0.0.1]:43238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNe7o-0004Tn-Ow for submit@debbugs.gnu.org; Wed, 10 Jan 2024 14:20:29 -0500 Received: from relay7-d.mail.gandi.net ([2001:4b98:dc4:8::227]:42167) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNe7l-0004TU-PY for 68352@debbugs.gnu.org; Wed, 10 Jan 2024 14:20:27 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id 948AA20004; Wed, 10 Jan 2024 19:20:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ice9.digital; s=gm1; t=1704914418; 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=MN12IgUpK4nN0fCRRAwI/YgHltx1jP7BZufijZ7jIKc=; b=WAnJj6o8vQGEcP9hcOrLA9kK0SWrk/zPbUfu6+0lIaaivrmywCtUKdnVMM1WvzpwXqBjef r9IHgH/7nmEx3Ir9ShGRJrcbfQK2r8bBnrCCAcK95bZ22TAi8UVrrVuz/zyFzV3kMFmg0S fPaLpdCA0q6jted9kvtevlc3Kp/9p5NFD98MdeuQJGQQKMgK7vWX+lxLJUYEMiYky6E+l9 ggW/mwAT54ifF+O+tFfZe1ijK9G5r8gqO2HpWlHVIMdGmOIPobg4Ayjbkp/QvzJq/0Tp0M X1d4u4kqWLRzSueIemssCCHMo3UpMHnWmezo/NB81QfLP12f3jBMSCbnTiiIKg== From: Morgan Willcock To: Eric Abrahamsen Subject: Re: bug#68352: 29.1; gnus-message-citation-mode removes values from font-lock-keywords In-Reply-To: <875y01dnsq.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Wed, 10 Jan 2024 10:51:49 -0800") References: <8734v62rc2.fsf@ice9.digital> <87plyafahh.fsf@ericabrahamsen.net> <87r0iq1735.fsf@ice9.digital> <87le8xg3pg.fsf@ericabrahamsen.net> <87wmshdxj1.fsf@ericabrahamsen.net> <875y01dnsq.fsf@ericabrahamsen.net> Date: Wed, 10 Jan 2024 19:20:15 +0000 Message-ID: <87mstdgfm8.fsf@ice9.digital> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: morgan@ice9.digital X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 68352 Cc: 68352@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eric Abrahamsen writes: > Eric Abrahamsen writes: > >> Eric Abrahamsen writes: >> >>> Morgan Willcock writes: >>> >>>> Eric Abrahamsen writes: >>>> >>>>> Morgan Willcock writes: >>>>> >>>>>> When Gnus enables gnus-message-citation-mode in message buffers, as it >>>>>> does by default, it calls the function `font-lock-set-defaults' and >>>>>> loses any additional font-lock rules which may have been added by global >>>>>> minor-modes. >>>>> >>>>> Thanks for the report. I don't know font locking well enough to know >>>>> what the right solution is here. It looks calling `font-lock-flush' will >>>>> also end up calling `font-lock-set-defaults' as well, at least with >>>>> default values: >>>>> >>>>> font-lock-flush-function -> >>>>> font-lock-after-change-function -> >>>>> font-lock-fontify-region -> >>>>> font-lock-set-defaults >>>>> >>>>> Is the problem setting `font-lock-set-defaults' to nil? Is there >>>>> anything else you can recommend? >>>> >>>> I think that I did test not setting `font-lock-set-defaults' to nil to >>>> see if that made a difference, but the same problem was still there. >>>> >>>> I don't know very much myself, but in that section of code there is a >>>> comment left by Stefan Monnier: >>>> >>>> ;; FIXME: Use font-lock-add-keywords! >>> >>> Ha, my eyes went right by that comment. >>> >>>> So I would guess that the correct solution would be to add the citation >>>> font-locking rules with `font-lock-add-keywords' and then remove them >>>> again with `font-lock-remove-keywords' if the mode is ever disabled, and >>>> if the highlighting needs an update after those changes, call >>>> `font-lock-flush'. >>> >>> 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))))) >> >> No, that doesn't do it. The thing is, even if you defuse this minor mode >> entirely (I replaced the body with `(message "Whee!")'), >> global-whitespace-mode has already been overridden by the time we come >> to run this minor-mode function. It's already getting clobbered at some >> earlier point. > > Actually, it might just be that something about message-mode suppresses > whitespace-mode altogether. Even if I turn it on *after* starting a > reply, no font-locking of whitespace is done. I haven't had a chance to re-test anything yet (I'm fairly sure that removing the call to `font-lock-set-defaults' kept the whitespace font-lock rules in-place), but if you are seeing issues with whitespace-mode being turned on then it is probably because the value of `whitespace-enable-predicate' has not been modified. Because of the default predicate value, whitespace-mode does not apply to any buffer where the name begins with an asterisk (with the exception of the scratch buffer), and the message buffer is usually named something like "*unsent mail*". That is why the example to recreate the problem needed a change to the predicate value: (add-function :before-until whitespace-enable-predicate (lambda () (eq major-mode 'message-mode))) This might look a bit like I've hacked my way into creating the problem that I'm reporting, but this is actually what the docstring for the value instructs you to do to change the behaviour, and I don't think any of the default restrictions are there to avoid font-lock problems. -- Morgan Willcock From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 10 17:16:37 2024 Received: (at 68352) by debbugs.gnu.org; 10 Jan 2024 22:16:37 +0000 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 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 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== From: Morgan Willcock To: Eric Abrahamsen Subject: Re: bug#68352: 29.1; gnus-message-citation-mode removes values from font-lock-keywords In-Reply-To: <87le8xg3pg.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Tue, 09 Jan 2024 21:25:15 -0800") References: <8734v62rc2.fsf@ice9.digital> <87plyafahh.fsf@ericabrahamsen.net> <87r0iq1735.fsf@ice9.digital> <87le8xg3pg.fsf@ericabrahamsen.net> Date: Wed, 10 Jan 2024 22:16:27 +0000 Message-ID: <87y1cwrg04.fsf@ice9.digital> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: morgan@ice9.digital X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 68352 Cc: 68352@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 11 06:57:49 2024 Received: (at 68352) by debbugs.gnu.org; 11 Jan 2024 11:57:49 +0000 Received: from localhost ([127.0.0.1]:58850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNtgv-0003Y5-Dt for submit@debbugs.gnu.org; Thu, 11 Jan 2024 06:57:49 -0500 Received: from relay7-d.mail.gandi.net ([2001:4b98:dc4:8::227]:35771) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNtgt-0003Xo-3u for 68352@debbugs.gnu.org; Thu, 11 Jan 2024 06:57:44 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id 5B2802000F; Thu, 11 Jan 2024 11:57:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ice9.digital; s=gm1; t=1704974257; 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=FCP276sF1gKN9FOa5BxTed/5M1VNxlbAafbdPKEAE2E=; b=iyYtsc63mEDOUUp8eQpVBbXn4qdAmB/N/TPGGbGZooH7dl8PNiWSryV+z/ebKSReAEoucp MH1O7O99OfZLBVczRs4lrxWgGECOWShIYwmXvBkG9qQ3YSpYGexKD0RB+v6BqWDrmYhlsW IWYAC1OKUognivWk+gv9gRrqmz+t0AO9upGmjUbS1nppaydgAQ1TtpyJ70Wimv7iw87pkA DGIVK1bmPsMxCzUw/M67xqhCdd8EUBJl5ImCiByfDWpllJb8dONPE0dAi2fxJtAtmtaWg5 HHcv9PwUbdpYy15RedJrGyJIqkvT+4PetOicUBJ8XRPPdwL7y/tgzUYL7m8Lvw== From: Morgan Willcock To: Eric Abrahamsen Subject: Re: bug#68352: 29.1; gnus-message-citation-mode removes values from font-lock-keywords In-Reply-To: <87y1cwrg04.fsf@ice9.digital> (Morgan Willcock's message of "Wed, 10 Jan 2024 22:16:27 +0000") References: <8734v62rc2.fsf@ice9.digital> <87plyafahh.fsf@ericabrahamsen.net> <87r0iq1735.fsf@ice9.digital> <87le8xg3pg.fsf@ericabrahamsen.net> <87y1cwrg04.fsf@ice9.digital> Date: Thu, 11 Jan 2024 11:57:36 +0000 Message-ID: <87o7dskrpr.fsf@ice9.digital> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-GND-Sasl: morgan@ice9.digital X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 68352 Cc: 68352@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain I've attached a patch which is essentially the same as Eric's suggestion except that, the original comment is kept, the HOW argument of `font-lock-add-keywords' is set to t, and the code is restructured to avoid any font-lock changes until `font-lock-mode' is active. -- Morgan Willcock --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Avoid-font-lock-reset-in-gnus-message-citation-mode.patch >From 9fa84932aa0ad7c37b20d68ca358ee779d225f09 Mon Sep 17 00:00:00 2001 From: Morgan Willcock Date: Wed, 10 Jan 2024 21:29:29 +0000 Subject: [PATCH] Avoid font-lock reset in `gnus-message-citation-mode' * lisp/gnus/gnus-cite.el (gnus-message-citation-mode): Use `font-lock-add-keywords' and `font-lock-remove-keywords' instead of modifying font-lock defaults. Make no font-lock changes until `font-lock-mode' is active. --- lisp/gnus/gnus-cite.el | 36 +++++++++++------------------------- 1 file 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 @@ gnus-message-citation-mode 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'." -- 2.39.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 11 03:48:40 2024 Received: (at 68352) by debbugs.gnu.org; 11 Feb 2024 08:48:40 +0000 Received: from localhost ([127.0.0.1]:59308 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZ5Vv-0008KC-U6 for submit@debbugs.gnu.org; Sun, 11 Feb 2024 03:48:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44218) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZ5Vu-0008JQ-M0 for 68352@debbugs.gnu.org; Sun, 11 Feb 2024 03:48:39 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rZ5VY-0008EA-D3; Sun, 11 Feb 2024 03:48:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=1dUL4ANXJZCOnPJGjlWQjpkU2E2wJ/ZxY5f1tPj24ao=; b=Unccci4PA6EN HYcw3FfQ+aAGc+Nbv+ykW7Iebq1Z4MonP0kD6cu98U5krszSFNI8GfAalg5DOnCh3PIO79jBqJDh1 eJEAQZGyYH3kbs83xnUgNXBNYyolXT2BA8fNbSbSJiCAPAfcEexSRXFRPwSu+VYPOlvWHXjX2GF70 CW45Ef+QsGQskLGlWHTV8deDp42Ck4+VSIVeYoxgAxI2LA/m5dunxAZMkDNRVRKuEVKhunl6f3YaJ JWdjWjKWWsHMHmkfzBrQdwD9n0lHUS/6z2cZTvyAs48UcFLjhkcRSXY1jBE7OLLn2rW115VR3YQll VpgS2v6rcGVVJWTDPqXv6Q==; Date: Sun, 11 Feb 2024 10:48:14 +0200 Message-Id: <86ttmfs7xt.fsf@gnu.org> From: Eli Zaretskii To: Morgan Willcock In-Reply-To: <87o7dskrpr.fsf@ice9.digital> (message from Morgan Willcock on Thu, 11 Jan 2024 11:57:36 +0000) Subject: Re: bug#68352: 29.1; gnus-message-citation-mode removes values from font-lock-keywords References: <8734v62rc2.fsf@ice9.digital> <87plyafahh.fsf@ericabrahamsen.net> <87r0iq1735.fsf@ice9.digital> <87le8xg3pg.fsf@ericabrahamsen.net> <87y1cwrg04.fsf@ice9.digital> <87o7dskrpr.fsf@ice9.digital> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 68352 Cc: eric@ericabrahamsen.net, 68352@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 68352@debbugs.gnu.org > From: Morgan Willcock > Date: Thu, 11 Jan 2024 11:57:36 +0000 > > I've attached a patch which is essentially the same as Eric's suggestion > except that, the original comment is kept, the HOW argument of > `font-lock-add-keywords' is set to t, and the code is restructured to > avoid any font-lock changes until `font-lock-mode' is active. Eric, how should we go about making some progress here? Should the proposed patch be installed? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 11 09:55:19 2024 Received: (at 68352-done) by debbugs.gnu.org; 11 Feb 2024 14:55:19 +0000 Received: from localhost ([127.0.0.1]:51918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZBEk-0002BQ-J3 for submit@debbugs.gnu.org; Sun, 11 Feb 2024 09:55:19 -0500 Received: from mail.ericabrahamsen.net ([52.70.2.18]:59054) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rZB9c-0001xt-VD for 68352-done@debbugs.gnu.org; Sun, 11 Feb 2024 09:50:02 -0500 Received: from localhost (71-212-21-65.tukw.qwest.net [71.212.21.65]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 396EBFA0B2; Sun, 11 Feb 2024 14:49:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1707662978; bh=ayFINtGhkKogNxn+LD0Q+TsMRtQP7+p54wpQQzqEvSE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=OGATnMf6NC6lRQO8o413lnKZ6I9AKwmGZaTmzRQZEL+Zs1Rzaw5yWcZkXN6nbYPB0 gUUM6m632hMbmhcPjpa3K10AiPU3hkqRN47x8L/vTWlhp2F3mlth6jR8zh6Fh7rphJ JUUhcYH1pxTSdsh4r5a0wdod1TfR2IAdKSKEBjss= From: Eric Abrahamsen To: Eli Zaretskii Subject: Re: bug#68352: 29.1; gnus-message-citation-mode removes values from font-lock-keywords In-Reply-To: <86ttmfs7xt.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 11 Feb 2024 10:48:14 +0200") References: <8734v62rc2.fsf@ice9.digital> <87plyafahh.fsf@ericabrahamsen.net> <87r0iq1735.fsf@ice9.digital> <87le8xg3pg.fsf@ericabrahamsen.net> <87y1cwrg04.fsf@ice9.digital> <87o7dskrpr.fsf@ice9.digital> <86ttmfs7xt.fsf@gnu.org> Date: Sun, 11 Feb 2024 06:49:36 -0800 Message-ID: <874jefhx8f.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 68352-done Cc: 68352-done@debbugs.gnu.org, Morgan Willcock X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: >> Cc: 68352@debbugs.gnu.org >> From: Morgan Willcock >> Date: Thu, 11 Jan 2024 11:57:36 +0000 >> >> I've attached a patch which is essentially the same as Eric's suggestion >> except that, the original comment is kept, the HOW argument of >> `font-lock-add-keywords' is set to t, and the code is restructured to >> avoid any font-lock changes until `font-lock-mode' is active. > > Eric, how should we go about making some progress here? Should the > proposed patch be installed? It's already installed! I just neglected to close the bug, which I'm doing now. Thanks for the bump. From unknown Fri Aug 15 02:04:07 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 11 Mar 2024 11:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator