Mark unmarked articles in current thread as read and move to
authorOleksandr Gavenko <gavenkoa@gmail.com>
Mon, 10 Mar 2014 22:14:13 +0200
changeset 1118 ece4746ba12e
parent 1117 90ae97bfab3f
child 1119 a1a33efa7ad0
Mark unmarked articles in current thread as read and move to next thread without selecting article.
.emacs-my
--- a/.emacs-my	Sat Mar 08 15:34:45 2014 +0200
+++ b/.emacs-my	Mon Mar 10 22:14:13 2014 +0200
@@ -1814,6 +1814,20 @@
 (eval-after-load 'gnus-sum
   '(define-key gnus-summary-mode-map (kbd "C-k") #'my-gnus-summary-kill-same-subject))
 
+(defun my-gnus.mark-thread-as-read ()
+  "Mark unmarked articles in current thread as read and move to
+next thread without selecting article."
+  (interactive)
+  (gnus-summary-top-thread)
+  (catch 'exit
+    (while t
+      (when (eq (gnus-summary-article-mark (gnus-summary-article-number)) gnus-unread-mark)
+        (gnus-summary-mark-article (gnus-summary-article-number) gnus-del-mark))
+      (when (or (not (gnus-summary-search-forward)) (eq (gnus-summary-thread-level) 0))
+        (throw 'exit nil)) )))
+(eval-after-load 'gnus-sum
+  '(define-key gnus-summary-mode-map (kbd "H-k") #'my-gnus.mark-thread-as-read))
+
 (defun my-gnus-thread-score-function (&rest scores)
   "If any followup have positive score assign greater available
 score to thread, else assign lesser available score."