From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alex Bochannek Newsgroups: gmane.emacs.bugs 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 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34558"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) To: 52923@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 01 01:43:27 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n3SUY-0008o8-7p for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 01 Jan 2022 01:43:26 +0100 Original-Received: from localhost ([::1]:47728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3SUW-0008IX-Ry for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 31 Dec 2021 19:43:24 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3STD-0008IO-3Y for bug-gnu-emacs@gnu.org; Fri, 31 Dec 2021 19:42:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46056) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n3STC-000701-H1 for bug-gnu-emacs@gnu.org; Fri, 31 Dec 2021 19:42:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n3STC-0006zQ-Aj for bug-gnu-emacs@gnu.org; Fri, 31 Dec 2021 19:42:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alex Bochannek Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 01 Jan 2022 00:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52923 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.164099766426766 (code B ref -1); Sat, 01 Jan 2022 00:42:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Jan 2022 00:41:04 +0000 Original-Received: from localhost ([127.0.0.1]:57602 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3SSF-0006xe-LF for submit@debbugs.gnu.org; Fri, 31 Dec 2021 19:41:03 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:49380) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3SSD-0006x4-Dw for submit@debbugs.gnu.org; Fri, 31 Dec 2021 19:41:01 -0500 Original-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 ) id 1n3SSD-0008GJ-7D for bug-gnu-emacs@gnu.org; Fri, 31 Dec 2021 19:41:01 -0500 Original-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 ) id 1n3SSB-000635-Da for bug-gnu-emacs@gnu.org; Fri, 31 Dec 2021 19:41:00 -0500 Original-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 ; Fri, 31 Dec 2021 16:40:53 -0800 (PST) Authentication-Results: ORIGINATING; auth=pass smtp.auth=alex smtp.mailfrom=alex@bochannek.com Received-SPF: pass client-ip=50.0.39.240; envelope-from=alex@bochannek.com; 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:223489 Archived-At: --=-=-= 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. --=-=-=--