unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#52923: 29.0.50; [PATCH] gnus-summary-hide-thread only hides first sub-thread when gnus-summary-make-false-root is set to dummy
@ 2022-01-01  0:40 Alex Bochannek
  2022-01-15  9:28 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Bochannek @ 2022-01-01  0:40 UTC (permalink / raw)
  To: 52923

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

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.


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

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)))

[-- Attachment #3: Type: text/plain, Size: 10 bytes --]

-- 
Alex.

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#52923: 29.0.50; [PATCH] gnus-summary-hide-thread only hides first sub-thread when gnus-summary-make-false-root is set to dummy
  2022-01-01  0:40 bug#52923: 29.0.50; [PATCH] gnus-summary-hide-thread only hides first sub-thread when gnus-summary-make-false-root is set to dummy Alex Bochannek
@ 2022-01-15  9:28 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2022-01-15  9:28 UTC (permalink / raw)
  To: Alex Bochannek; +Cc: 52923

Alex Bochannek <alex@bochannek.com> writes:

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

Thanks; applied to Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-15  9:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-01  0:40 bug#52923: 29.0.50; [PATCH] gnus-summary-hide-thread only hides first sub-thread when gnus-summary-make-false-root is set to dummy Alex Bochannek
2022-01-15  9:28 ` Lars Ingebrigtsen

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).