summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2023-03-26 10:55:54 -0700
committerSean Whitton <spwhitton@spwhitton.name>2023-04-16 13:07:22 -0700
commit2093049f453547ae78e7f786eaaf0220627f26fe (patch)
tree7927b26fd530ea52aafdf9d1423095da54d28471
parent1de6c9974ed4cd6104f188eb754872feec732c43 (diff)
downloaddotfiles-2093049f453547ae78e7f786eaaf0220627f26fe.tar.gz
fix killing last article in group, use C-M-k to kill subthreads
-rw-r--r--.emacs.d/init.el14
1 files changed, 12 insertions, 2 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index 4cc7b3cf..3981984a 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -3778,9 +3778,19 @@ mutt's review view, after exiting EDITOR."
gnus-article-delete-part))
(advice-add fn :override #'ignore))
+(defun spw/gnus-summary-kill-thread (orig-fun &optional unmark)
+ (save-excursion
+ (funcall orig-fun unmark))
+ (unless unmark
+ (gnus-summary-next-unread-article)))
+(advice-add 'gnus-summary-kill-thread :around #'spw/gnus-summary-kill-thread)
+
+(defun spw/gnus-summary-kill-whole-thread (&optional unmark)
+ (interactive "P")
+ (gnus-summary-top-thread)
+ (gnus-summary-kill-thread unmark))
(with-eval-after-load 'gnus-sum
- (define-key gnus-summary-mode-map "k" "ToTkg")
- (define-key gnus-summary-mode-map "\M-k" "Tkg"))
+ (define-key gnus-summary-mode-map "k" #'spw/gnus-summary-kill-whole-thread))
;;; Following bindings go under 'v' because that is reserved to Gnus users.