aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-09-29 09:56:31 +0200
committerLars Ingebrigtsen2019-09-29 09:56:31 +0200
commit0695f5383f67ebbe606e63e5349db63cf650e7da (patch)
tree8a18ab0a4560886dfc0bb836ef4ac3b887ce5eea
parent82c79220f58caa8ee6b78c8704aa97191c2352c7 (diff)
downloademacs-0695f5383f67ebbe606e63e5349db63cf650e7da.tar.gz
emacs-0695f5383f67ebbe606e63e5349db63cf650e7da.zip
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).
-rw-r--r--doc/misc/gnus.texi14
-rw-r--r--etc/NEWS7
-rw-r--r--lisp/gnus/gnus-sum.el35
3 files changed, 56 insertions, 0 deletions
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index 4c69c692926..8ab1cf9f68f 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -5347,6 +5347,20 @@ Go to the next article (@code{gnus-summary-next-article}).
5347@findex gnus-summary-prev-article 5347@findex gnus-summary-prev-article
5348Go to the previous article (@code{gnus-summary-prev-article}). 5348Go to the previous article (@code{gnus-summary-prev-article}).
5349 5349
5350@item G u
5351@itemx ]
5352@kindex ] @r{(Summary)}
5353@kindex G u @r{(Summary)}
5354@findex gnus-summary-next-unseen-article
5355Go to the next unseen article (@code{gnus-summary-next-unseen-article}).
5356
5357@item G U
5358@itemx [
5359@kindex [ @r{(Summary)}
5360@kindex G U @r{(Summary)}
5361@findex gnus-summary-prev-unseen-article
5362Go to the previous unseen article (@code{gnus-summary-prev-unseen-article}).
5363
5350@item G C-n 5364@item G C-n
5351@kindex G C-n @r{(Summary)} 5365@kindex G C-n @r{(Summary)}
5352@findex gnus-summary-next-same-subject 5366@findex gnus-summary-next-same-subject
diff --git a/etc/NEWS b/etc/NEWS
index 3d8480cb461..f858c958317 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1047,6 +1047,13 @@ Of course it will still find it if you have it in '~/.ecompleterc'.
1047** Gnus 1047** Gnus
1048 1048
1049+++ 1049+++
1050*** Two new Gnus summary mode navigation commands have been added,
1051bound to the '[' and ']' keys: `gnus-summary-prev-unseen-article' and
1052`gnus-summary-next-unseen-article'. These take you (respectively) to
1053the previous unseen or next unseen article. (These are the ones that
1054are marked with "." in the summary mode lines.)
1055
1056+++
1050*** The Gnus user variable 'nnimap-expunge' supports three new values: 1057*** The Gnus user variable 'nnimap-expunge' supports three new values:
1051'never' for never expunging messages, 'immediately' for immediately 1058'never' for never expunging messages, 'immediately' for immediately
1052expunging deleted messages, and 'on-exit' to expunge deleted articles 1059expunging deleted messages, and 'on-exit' to expunge deleted articles
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 20f338eda16..b5d744843f0 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -1911,6 +1911,8 @@ increase the score of each group you read."
1911 "\M-p" gnus-summary-prev-unread-subject 1911 "\M-p" gnus-summary-prev-unread-subject
1912 "." gnus-summary-first-unread-article 1912 "." gnus-summary-first-unread-article
1913 "," gnus-summary-best-unread-article 1913 "," gnus-summary-best-unread-article
1914 "[" gnus-summary-prev-unseen-article
1915 "]" gnus-summary-next-unseen-article
1914 "\M-s" gnus-summary-search-article-forward 1916 "\M-s" gnus-summary-search-article-forward
1915 "\M-r" gnus-summary-search-article-backward 1917 "\M-r" gnus-summary-search-article-backward
1916 "\M-S" gnus-summary-repeat-search-article-forward 1918 "\M-S" gnus-summary-repeat-search-article-forward
@@ -2088,6 +2090,8 @@ increase the score of each group you read."
2088 "\M-p" gnus-summary-prev-unread-subject 2090 "\M-p" gnus-summary-prev-unread-subject
2089 "f" gnus-summary-first-unread-article 2091 "f" gnus-summary-first-unread-article
2090 "b" gnus-summary-best-unread-article 2092 "b" gnus-summary-best-unread-article
2093 "u" gnus-summary-next-unseen-article
2094 "U" gnus-summary-prev-unseen-article
2091 "j" gnus-summary-goto-article 2095 "j" gnus-summary-goto-article
2092 "g" gnus-summary-goto-subject 2096 "g" gnus-summary-goto-subject
2093 "l" gnus-summary-goto-last-article 2097 "l" gnus-summary-goto-last-article
@@ -2796,6 +2800,8 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs))))
2796 ["Previous article same subject" gnus-summary-prev-same-subject t] 2800 ["Previous article same subject" gnus-summary-prev-same-subject t]
2797 ["First unread article" gnus-summary-first-unread-article t] 2801 ["First unread article" gnus-summary-first-unread-article t]
2798 ["Best unread article" gnus-summary-best-unread-article t] 2802 ["Best unread article" gnus-summary-best-unread-article t]
2803 ["Next unseen article" gnus-summary-next-unseen-article t]
2804 ["Prev unseen article" gnus-summary-prev-unseen-article t]
2799 ["Go to subject number..." gnus-summary-goto-subject t] 2805 ["Go to subject number..." gnus-summary-goto-subject t]
2800 ["Go to article number..." gnus-summary-goto-article t] 2806 ["Go to article number..." gnus-summary-goto-article t]
2801 ["Go to the last article" gnus-summary-goto-last-article t] 2807 ["Go to the last article" gnus-summary-goto-last-article t]
@@ -3175,6 +3181,9 @@ The following commands are available:
3175 (:type list)) 3181 (:type list))
3176 number mark pos header level) 3182 number mark pos header level)
3177 3183
3184(defun gnus-data-unseen-p (data)
3185 (memq (gnus-data-number data) gnus-newsgroup-unseen))
3186
3178(define-inline gnus-data-unread-p (data) 3187(define-inline gnus-data-unread-p (data)
3179 (inline-quote (= (gnus-data-mark ,data) gnus-unread-mark))) 3188 (inline-quote (= (gnus-data-mark ,data) gnus-unread-mark)))
3180 3189
@@ -8119,6 +8128,32 @@ Return nil if there are no unread articles."
8119 (gnus-summary-first-subject t)) 8128 (gnus-summary-first-subject t))
8120 (gnus-summary-position-point))) 8129 (gnus-summary-position-point)))
8121 8130
8131(defun gnus-summary-next-unseen-article (&optional backward)
8132 "Select the next unseen article."
8133 (interactive)
8134 (let* ((article (gnus-summary-article-number))
8135 (articles (gnus-data-find-list article (gnus-data-list backward))))
8136 (when (or (not gnus-summary-check-current)
8137 (not (gnus-data-unseen-p (car articles)))
8138 (not (gnus-data-unread-p (car articles))))
8139 (setq articles (cdr articles)))
8140 (while (and articles
8141 (or (not (gnus-data-unseen-p (car articles)))
8142 (not (gnus-data-unread-p (car articles)))))
8143 (setq articles (cdr articles)))
8144 (if (not articles)
8145 (if backward
8146 (message "No previous unseen article")
8147 (message "No next unseen article"))
8148 (goto-char (gnus-data-pos (car articles)))
8149 (gnus-summary-select-article)
8150 (gnus-data-number (car articles)))))
8151
8152(defun gnus-summary-prev-unseen-article ()
8153 "Select the previous unseen article."
8154 (interactive)
8155 (gnus-summary-next-unseen-article t))
8156
8122(defun gnus-summary-first-unseen-subject () 8157(defun gnus-summary-first-unseen-subject ()
8123 "Place the point on the subject line of the first unseen article. 8158 "Place the point on the subject line of the first unseen article.
8124Return nil if there are no unseen articles." 8159Return nil if there are no unseen articles."