Commit 0695f538 authored by Lars Ingebrigtsen's avatar Lars Ingebrigtsen

Add new Gnus summary commands and keystrokes for "unseen" navigation

* doc/misc/gnus.texi (Choosing Commands): Document them.
* lisp/gnus/gnus-sum.el (gnus-summary-next-unseen-article)
(gnus-summary-prev-unseen-article): New commands and
keystrokes (bug#35213).
parent 82c79220
Pipeline #3364 passed with stage
in 56 minutes and 57 seconds
...@@ -5347,6 +5347,20 @@ Go to the next article (@code{gnus-summary-next-article}). ...@@ -5347,6 +5347,20 @@ Go to the next article (@code{gnus-summary-next-article}).
@findex gnus-summary-prev-article @findex gnus-summary-prev-article
Go to the previous article (@code{gnus-summary-prev-article}). Go to the previous article (@code{gnus-summary-prev-article}).
@item G u
@itemx ]
@kindex ] @r{(Summary)}
@kindex G u @r{(Summary)}
@findex gnus-summary-next-unseen-article
Go to the next unseen article (@code{gnus-summary-next-unseen-article}).
@item G U
@itemx [
@kindex [ @r{(Summary)}
@kindex G U @r{(Summary)}
@findex gnus-summary-prev-unseen-article
Go to the previous unseen article (@code{gnus-summary-prev-unseen-article}).
@item G C-n @item G C-n
@kindex G C-n @r{(Summary)} @kindex G C-n @r{(Summary)}
@findex gnus-summary-next-same-subject @findex gnus-summary-next-same-subject
...@@ -1046,6 +1046,13 @@ Of course it will still find it if you have it in '~/.ecompleterc'. ...@@ -1046,6 +1046,13 @@ Of course it will still find it if you have it in '~/.ecompleterc'.
** Gnus ** Gnus
+++
*** Two new Gnus summary mode navigation commands have been added,
bound to the '[' and ']' keys: `gnus-summary-prev-unseen-article' and
`gnus-summary-next-unseen-article'. These take you (respectively) to
the previous unseen or next unseen article. (These are the ones that
are marked with "." in the summary mode lines.)
+++ +++
*** The Gnus user variable 'nnimap-expunge' supports three new values: *** The Gnus user variable 'nnimap-expunge' supports three new values:
'never' for never expunging messages, 'immediately' for immediately 'never' for never expunging messages, 'immediately' for immediately
......
...@@ -1911,6 +1911,8 @@ increase the score of each group you read." ...@@ -1911,6 +1911,8 @@ increase the score of each group you read."
"\M-p" gnus-summary-prev-unread-subject "\M-p" gnus-summary-prev-unread-subject
"." gnus-summary-first-unread-article "." gnus-summary-first-unread-article
"," gnus-summary-best-unread-article "," gnus-summary-best-unread-article
"[" gnus-summary-prev-unseen-article
"]" gnus-summary-next-unseen-article
"\M-s" gnus-summary-search-article-forward "\M-s" gnus-summary-search-article-forward
"\M-r" gnus-summary-search-article-backward "\M-r" gnus-summary-search-article-backward
"\M-S" gnus-summary-repeat-search-article-forward "\M-S" gnus-summary-repeat-search-article-forward
...@@ -2088,6 +2090,8 @@ increase the score of each group you read." ...@@ -2088,6 +2090,8 @@ increase the score of each group you read."
"\M-p" gnus-summary-prev-unread-subject "\M-p" gnus-summary-prev-unread-subject
"f" gnus-summary-first-unread-article "f" gnus-summary-first-unread-article
"b" gnus-summary-best-unread-article "b" gnus-summary-best-unread-article
"u" gnus-summary-next-unseen-article
"U" gnus-summary-prev-unseen-article
"j" gnus-summary-goto-article "j" gnus-summary-goto-article
"g" gnus-summary-goto-subject "g" gnus-summary-goto-subject
"l" gnus-summary-goto-last-article "l" gnus-summary-goto-last-article
...@@ -2796,6 +2800,8 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs)))) ...@@ -2796,6 +2800,8 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs))))
["Previous article same subject" gnus-summary-prev-same-subject t] ["Previous article same subject" gnus-summary-prev-same-subject t]
["First unread article" gnus-summary-first-unread-article t] ["First unread article" gnus-summary-first-unread-article t]
["Best unread article" gnus-summary-best-unread-article t] ["Best unread article" gnus-summary-best-unread-article t]
["Next unseen article" gnus-summary-next-unseen-article t]
["Prev unseen article" gnus-summary-prev-unseen-article t]
["Go to subject number..." gnus-summary-goto-subject t] ["Go to subject number..." gnus-summary-goto-subject t]
["Go to article number..." gnus-summary-goto-article t] ["Go to article number..." gnus-summary-goto-article t]
["Go to the last article" gnus-summary-goto-last-article t] ["Go to the last article" gnus-summary-goto-last-article t]
...@@ -3175,6 +3181,9 @@ The following commands are available: ...@@ -3175,6 +3181,9 @@ The following commands are available:
(:type list)) (:type list))
number mark pos header level) number mark pos header level)
(defun gnus-data-unseen-p (data)
(memq (gnus-data-number data) gnus-newsgroup-unseen))
(define-inline gnus-data-unread-p (data) (define-inline gnus-data-unread-p (data)
(inline-quote (= (gnus-data-mark ,data) gnus-unread-mark))) (inline-quote (= (gnus-data-mark ,data) gnus-unread-mark)))
...@@ -8119,6 +8128,32 @@ Return nil if there are no unread articles." ...@@ -8119,6 +8128,32 @@ Return nil if there are no unread articles."
(gnus-summary-first-subject t)) (gnus-summary-first-subject t))
(gnus-summary-position-point))) (gnus-summary-position-point)))
(defun gnus-summary-next-unseen-article (&optional backward)
"Select the next unseen article."
(interactive)
(let* ((article (gnus-summary-article-number))
(articles (gnus-data-find-list article (gnus-data-list backward))))
(when (or (not gnus-summary-check-current)
(not (gnus-data-unseen-p (car articles)))
(not (gnus-data-unread-p (car articles))))
(setq articles (cdr articles)))
(while (and articles
(or (not (gnus-data-unseen-p (car articles)))
(not (gnus-data-unread-p (car articles)))))
(setq articles (cdr articles)))
(if (not articles)
(if backward
(message "No previous unseen article")
(message "No next unseen article"))
(goto-char (gnus-data-pos (car articles)))
(gnus-summary-select-article)
(gnus-data-number (car articles)))))
(defun gnus-summary-prev-unseen-article ()
"Select the previous unseen article."
(interactive)
(gnus-summary-next-unseen-article t))
(defun gnus-summary-first-unseen-subject () (defun gnus-summary-first-unseen-subject ()
"Place the point on the subject line of the first unseen article. "Place the point on the subject line of the first unseen article.
Return nil if there are no unseen articles." Return nil if there are no unseen articles."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment