summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.emacs.d/init.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index f6daa237..75a1f070 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -3141,6 +3141,20 @@ mutt's review view, after exiting EDITOR."
(with-eval-after-load 'gnus-sum
(define-key gnus-summary-mode-map "vf" #'spw/gnus-summary-limit-to-patches))
+(defun spw/gnus-summary-save-all-attachments ()
+ "Save all attachments to ~/tmp/."
+ (interactive)
+ (gnus-eval-in-buffer-window gnus-article-buffer
+ ;; `gnus-summary-save-parts' has some alternative ways to get the handles
+ ;; if `gnus-article-mime-handles' is nil.
+ (let ((handles gnus-article-mime-handles))
+ (when (stringp (car handles)) (pop handles))
+ (mapc #'mm-save-part (cl-remove-if-not #'mm-handle-filename handles)))))
+(with-eval-after-load 'gnus-sum
+ ;; Like `X m' binding.
+ (define-key gnus-summary-mode-map
+ "vm" #'spw/gnus-summary-save-all-attachments))
+
(defun spw/org-gnus-follow-link (orig-fun &optional group article)
(if (not article)
(apply orig-fun group nil)