unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alex Bochannek <alex@bochannek.com>
To: 52923@debbugs.gnu.org
Subject: 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
Date: Fri, 31 Dec 2021 16:40:46 -0800	[thread overview]
Message-ID: <m2o84w70fl.fsf@bochannek.com> (raw)

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

             reply	other threads:[~2022-01-01  0:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-01  0:40 Alex Bochannek [this message]
2022-01-15  9:28 ` 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 Lars Ingebrigtsen

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=m2o84w70fl.fsf@bochannek.com \
    --to=alex@bochannek.com \
    --cc=52923@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).