Subject: Re: bug#51809: 29.0.50; [PATCH] Support for outline default state in Diff buffers

From: Juri Linkov <[email-masked]>
Date: Sat, 29 Jan 2022 21:12:55 +0200

> I see one problem: Once one has some default state configured for Diff
> mode, it applies to patch embedded in Gnus Article buffers, but there
> the outline-minor-mode keymap isn't active and there's no way to toggle
> headings visibility... No idea how to improve this situation...

A hackish way would be something like this:

diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
index c40c38a95f..49cac01e2f 100644
--- a/lisp/gnus/mm-view.el
+++ b/lisp/gnus/mm-view.el
@@ -532,7 +532,8 @@ mm-display-inline-fontify
 	          (funcall mode))
 	    (let ((auto-mode-alist
 		   (delq (rassq 'doc-view-mode-maybe auto-mode-alist)
-			 (copy-sequence auto-mode-alist))))
+			 (copy-sequence auto-mode-alist)))
+                  outline-default-state)
 	      ;; Don't run hooks that might assume buffer-file-name
 	      ;; really associates buffer with a file (bug#39190).
 	      (delay-mode-hooks (set-auto-mode))

But OTOH, when long lines is a problem, then it's natural to expect that
the user would want to hide long lines in Gnus Article buffers as well.
And it's still possible to use outline cycling commands after saving an
attachment to a file.