GNU bug report logs - #52923
29.0.50; [PATCH] gnus-summary-hide-thread only hides first sub-thread when gnus-summary-make-false-root is set to dummy

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Alex Bochannek <alex@HIDDEN>; Keywords: patch; Done: Lars Ingebrigtsen <larsi@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug marked as fixed in version 29.1, send any further explanations to 52923 <at> debbugs.gnu.org and Alex Bochannek <alex@HIDDEN> Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 52923 <at> debbugs.gnu.org:


Received: (at 52923) by debbugs.gnu.org; 15 Jan 2022 09:28:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 15 04:28:38 2022
Received: from localhost ([127.0.0.1]:39001 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1n8fMU-0005cO-HX
	for submit <at> debbugs.gnu.org; Sat, 15 Jan 2022 04:28:38 -0500
Received: from quimby.gnus.org ([95.216.78.240]:46918)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1n8fMT-0005c9-MZ
 for 52923 <at> debbugs.gnu.org; Sat, 15 Jan 2022 04:28:38 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=L/0ly7WURxxpmtulAq7cBC9fEGMfYRnI01P6mefK340=; b=AXKb/6AtFaT3sVefRdiykkry6p
 QifuhpXOV+TG4TFqR0srLjdGbm7pBO/co4xPQqDfp1Mb0F49NsLTbFQn2A7FkK1DK7ytut1wEOqHE
 jbxYFfEbGterypB2lfcXaq6l7J4zsT3ZMxAIMEBO607oehMXhqafU9XcdX3rcqvf+hI0=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1n8fMK-000369-KC; Sat, 15 Jan 2022 10:28:31 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Alex Bochannek <alex@HIDDEN>
Subject: Re: 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
References: <m2o84w70fl.fsf@HIDDEN>
X-Now-Playing: Joni Mitchell's _Archives: The Early Years (4)_: "Chelsea
 Morning"
Date: Sat, 15 Jan 2022 10:28:25 +0100
In-Reply-To: <m2o84w70fl.fsf@HIDDEN> (Alex Bochannek's message of "Fri, 
 31 Dec 2021 16:40:46 -0800")
Message-ID: <878rvhz6ti.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Alex Bochannek <alex@HIDDEN> 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. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 52923
Cc: 52923 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Alex Bochannek <alex@HIDDEN> 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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#52923; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 1 Jan 2022 00:41:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 31 19:41:03 2021
Received: from localhost ([127.0.0.1]:57602 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1n3SSF-0006xe-LF
	for submit <at> debbugs.gnu.org; Fri, 31 Dec 2021 19:41:03 -0500
Received: from lists.gnu.org ([209.51.188.17]:49380)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <alex@HIDDEN>) id 1n3SSD-0006x4-Dw
 for submit <at> debbugs.gnu.org; Fri, 31 Dec 2021 19:41:01 -0500
Received: from eggs.gnu.org ([209.51.188.92]:35558)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <alex@HIDDEN>)
 id 1n3SSD-0008GJ-7D
 for bug-gnu-emacs@HIDDEN; Fri, 31 Dec 2021 19:41:01 -0500
Received: from ns.lapseofthought.com ([50.0.39.240]:7142
 helo=mail.lapseofthought.com)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <alex@HIDDEN>)
 id 1n3SSB-000635-Da
 for bug-gnu-emacs@HIDDEN; Fri, 31 Dec 2021 19:41:00 -0500
Received: from awb-mbp.local (c-73-92-249-246.hsd1.ca.comcast.net
 [73.92.249.246])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mail.lapseofthought.com (Postfix) with ESMTPSA id 4JQjq962bNz3pdyG
 for <bug-gnu-emacs@HIDDEN>; Fri, 31 Dec 2021 16:40:53 -0800 (PST)
From: Alex Bochannek <alex@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 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
Message-ID: <m2o84w70fl.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Authentication-Results: ORIGINATING;
 auth=pass smtp.auth=alex smtp.mailfrom=alex@HIDDEN
Received-SPF: pass client-ip=50.0.39.240; envelope-from=alex@HIDDEN;
 helo=mail.lapseofthought.com
X-Spam_score_int: 0
X-Spam_score: -0.0
X-Spam_bar: /
X-Spam_report: (-0.0 / 5.0 requ) SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

--=-=-=
Content-Type: text/plain

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.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline

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

--=-=-=
Content-Type: text/plain

-- 
Alex.

--=-=-=--




Acknowledgement sent to Alex Bochannek <alex@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#52923; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 15 Jan 2022 09:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.