unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Filipp Gunbin <fgunbin@fastmail.fm>
To: bug#38421 <38421@debbugs.gnu.org>
Subject: bug#38421: Status: 27.0.50; Gnus fontifies patch attachments when gnus-visual is nil
Date: Fri, 29 Nov 2019 00:48:11 +0300	[thread overview]
Message-ID: <m2lfrzu0ys.fsf@fastmail.fm> (raw)
In-Reply-To: bug's message of "Thu, 28 Nov 2019 20:20:54 +0000"

[-- Attachment #1: Type: text/plain, Size: 25 bytes --]

tags 38421 + patch
quit


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 1401 bytes --]

From 5ce40fc8e81a82d173e9cb17fa3390369b9b87f4 Mon Sep 17 00:00:00 2001
From: Filipp Gunbin <fgunbin@fastmail.fm>
Date: Thu, 28 Nov 2019 23:24:40 +0300
Subject: [PATCH] Fontify inline article parts only if gnus-visual says to do
 so

* lisp/gnus/mm-view.el (mm-display-inline-fontify): Check gnus-visual
before calling font-lock-ensure.
---
 lisp/gnus/mm-view.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
index 559ec7a669..3762e866fb 100644
--- a/lisp/gnus/mm-view.el
+++ b/lisp/gnus/mm-view.el
@@ -32,6 +32,7 @@
 
 (autoload 'gnus-completing-read "gnus-util")
 (autoload 'gnus-article-prepare-display "gnus-art")
+(autoload 'gnus-visual-p "gnus")
 (autoload 'vcard-parse-string "vcard")
 (autoload 'vcard-format-string "vcard")
 (autoload 'fill-flowed "flow-fill")
@@ -499,8 +500,9 @@ mm-display-inline-fontify
 			 (copy-sequence auto-mode-alist))))
 	      (set-auto-mode)
 	      (setq mode major-mode)))
-	  ;; Do not fontify if the guess mode is fundamental.
-	  (unless (eq major-mode 'fundamental-mode)
+          (when (and (gnus-visual-p 'article-highlight 'highlight)
+                     ;; Do not fontify if the guessed mode is fundamental
+                     (not (eq major-mode 'fundamental-mode)))
 	    (font-lock-ensure))))
       (setq text (buffer-string))
       (when (eq mode 'diff-mode)
-- 
2.24.0


  reply	other threads:[~2019-11-28 21:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-28 19:08 bug#38421: 27.0.50; Gnus fontifies patch attachments when gnus-visual is nil Filipp Gunbin
2019-11-28 21:48 ` Filipp Gunbin [this message]
2019-12-17 12:55   ` bug#38421: Status: " Filipp Gunbin
     [not found]   ` <m2woavp0vb.fsf@fastmail.fm>
2020-07-19 15:20     ` Lars Ingebrigtsen
     [not found]     ` <87d04rpm53.fsf@gnus.org>
2020-08-02 17:45       ` Lars Ingebrigtsen
     [not found]       ` <87wo2heybz.fsf@gnus.org>
2020-08-07 18:13         ` Filipp Gunbin

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=m2lfrzu0ys.fsf@fastmail.fm \
    --to=fgunbin@fastmail.fm \
    --cc=38421@debbugs.gnu.org \
    /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).