diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2021-10-24 20:25:12 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2021-10-24 20:25:12 +0200 |
commit | 74846b8d3092466ee9e3dd1336b452a0eb50a5b3 (patch) | |
tree | dfdd5247eebcd81f62cd7310b1a3597280d3b51e /lisp | |
parent | e6946bf5f2c9cb23a7a569d0bf6154110df247c7 (diff) | |
download | emacs-74846b8d3092466ee9e3dd1336b452a0eb50a5b3.tar.gz emacs-74846b8d3092466ee9e3dd1336b452a0eb50a5b3.tar.bz2 emacs-74846b8d3092466ee9e3dd1336b452a0eb50a5b3.zip |
Don't unhide first thread if entering without selecting article
* lisp/gnus/gnus-sum.el (gnus-summary-first-unread-subject)
(gnus-summary-first-unseen-subject)
(gnus-summary-first-unseen-or-unread-subject): Use it.
(gnus-summary--goto-and-possibly-unhide): New function -- don't
unhide the first thread unless necessary (bug#51344).
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/gnus/gnus-sum.el | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index ab8c578c9cd..f7385d19c8d 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -8064,9 +8064,7 @@ Return nil if there are no unread articles." Return nil if there are no unread articles." (interactive nil gnus-summary-mode) (prog1 - (when (gnus-summary-first-subject t) - (gnus-summary-show-thread) - (gnus-summary-first-subject t)) + (gnus-summary--goto-and-possibly-unhide t) (gnus-summary-position-point))) (defun gnus-summary-next-unseen-article (&optional backward) @@ -8100,23 +8098,27 @@ Return nil if there are no unread articles." Return nil if there are no unseen articles." (interactive nil gnus-summary-mode) (prog1 - (when (gnus-summary-first-subject nil nil t) - (gnus-summary-show-thread) - (gnus-summary-first-subject nil nil t)) + (gnus-summary--goto-and-possibly-unhide) (gnus-summary-position-point))) +(defun gnus-summary--goto-and-possibly-unhide (&optional unread undownloaded + unseen) + (let ((first (gnus-summary-first-subject unread undownloaded unseen))) + (if (and first + (not (= first (gnus-summary-article-number)))) + (progn + (gnus-summary-show-thread) + (gnus-summary-first-subject unread undownloaded unseen)) + first))) + (defun gnus-summary-first-unseen-or-unread-subject () "Place the point on the subject line of the first unseen and unread article. If all articles have been seen, on the subject line of the first unread article." (interactive nil gnus-summary-mode) (prog1 - (unless (when (gnus-summary-first-subject nil nil t) - (gnus-summary-show-thread) - (gnus-summary-first-subject nil nil t)) - (when (gnus-summary-first-subject t) - (gnus-summary-show-thread) - (gnus-summary-first-subject t))) + (unless (gnus-summary--goto-and-possibly-unhide nil nil t) + (gnus-summary-first-subject t)) (gnus-summary-position-point))) (defun gnus-summary-first-article () |