Subject: 29.0.50; [PATCH] gnus-summary-hide-thread only hides first sub-thread when gnus-summary-make-false-root is set to dummy

From: Alex Bochannek <[email-masked]>
Date: Fri, 31 Dec 2021 16:40:46 -0800

Hello!

I usually set:

  (setq gnus-summary-make-false-root 'dummy)

and noticed a while back that a `T H' did not hide dummy threads
completely. This is caused by the `gnus-summary-article-number' call in
`gnus-summary-hide-thread', which moves point to the next article after
the dummy root. As a result, it only then hides _that_ sub-thread.

I am proposing the following patch. I tested it with all documented
settings for `gnus-summary-make-false-root' and it worked for me.

Let me know if this looks good. Thanks and Happy New Year!

	* lisp/gnus/gnus-sum.el (gnus-summary-hide-thread):
	Fix thread hiding for dummy roots.

diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index cda6712f0d..b43c2731e5 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -11898,7 +11898,8 @@ gnus-summary-hide-thread
   (beginning-of-line)
   (let ((start (point))
 	(starteol (line-end-position))
-	(article (gnus-summary-article-number)))
+	(article (when (not (gnus-summary-article-intangible-p))
+                   (gnus-summary-article-number))))
     ;; Go forward until either the buffer ends or the subthread ends.
     (when (and (not (eobp))
 	       (or (zerop (gnus-summary-next-thread 1 t))
@@ -11912,7 +11913,9 @@ gnus-summary-hide-thread
 	      (let ((ol (make-overlay starteol (point) nil t nil)))
 		(overlay-put ol 'invisible 'gnus-sum)
 		(overlay-put ol 'evaporate t)))
-	    (gnus-summary-goto-subject article)
+	    (if article
+                (gnus-summary-goto-subject article)
+              (gnus-summary-position-point))
 	    ;; We moved backward past the start point (invisible thread?)
             (when (> start (point))
               (goto-char starteol)))
-- 
Alex.