From f501d0aed00998feb28c6f716e50f22a326b558c Mon Sep 17 00:00:00 2001 From: Alex Bochannek Date: Sat, 15 Jan 2022 10:28:14 +0100 Subject: [PATCH] (gnus-summary-hide-thread): Fix thread hiding for dummy roots. * lisp/gnus/gnus-sum.el (gnus-summary-hide-thread): Make thread hiding work when using dummy `gnus-summary-make-false-root' (bug#52923). --- lisp/gnus/gnus-sum.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index d3e476b5d64..6dfdcaf55c7 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -11898,7 +11898,8 @@ Returns nil if no threads were there to be hidden." (beginning-of-line) (let ((start (point)) (starteol (line-end-position)) - (article (gnus-summary-article-number))) + (article (unless (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 @@ Returns nil if no threads were there to be hidden." (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))) -- 2.39.2