Subject: Re: bug#32706: 27.0.50; Gnus ignores gnus-visual nil after gnus-article-outlook-deuglify-article

From: Katsumi Yamaoka <[email-masked]>
Date: Wed, 12 Sep 2018 16:21:55 +0900

On Tue, 11 Sep 2018 23:00:52 +0300, Filipp Gunbin wrote:
> I have gnus-visual set to nil and articles are not fontified (correct).

> But if I invoke `W Y f' (gnus-article-outlook-deuglify-article) on an
> article, then it gets fontified.  It's not the only command after which
> I observe such behavior.

I tried this fix at first:

--- deuglify.el~	2018-02-18 21:35:29.069455800 +0000
+++ deuglify.el	2018-09-12 07:18:02.820308500 +0000
@@ -301,3 +301,4 @@
     ;; this is a bug or not.
-    (gnus-article-highlight t)
+    (when (gnus-visual-p 'article-highlight 'highlight)
+      (gnus-article-highlight t))
     (gnus-treat-article nil)

But I found this function is still problematic.  That is,
`(gnus-treat-article nil)' there runs in an article including
headers, so, if gnus-visual is non-nil, the treatments are
performed on not only the article body but also the header ---
the header is buttonized if gnus-treat-buttonize is non-nil even
if gnus-treat-buttonize-head is nil, for example.  So, I've
installed the next one in the trunk:

--- deuglify.el~	2018-02-18 21:35:29.069455800 +0000
+++ deuglify-2.el	2018-09-12 07:18:02.821397300 +0000
@@ -300,6 +300,12 @@
     ;; prepared article removes all MIME parts.  I'm unsure whether
     ;; this is a bug or not.
-    (gnus-article-highlight t)
-    (gnus-treat-article nil)
+    (when (gnus-visual-p 'article-highlight 'highlight)
+      (gnus-article-highlight t))
+    (save-excursion
+      (save-restriction
+	(widen)
+	(article-goto-body)
+	(narrow-to-region (point) (point-max))
+	(gnus-treat-article nil)))
     (gnus-run-hooks 'gnus-article-prepare-hook
 		    'gnus-outlook-display-hook)))

Unfortunately I have no idea not to buttonize the header of a
forwarded message existing in the article as a mime part, though.