[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb ed9825e 034/449: Use map-y-or-n-p for attachment
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb ed9825e 034/449: Use map-y-or-n-p for attachment actions |
Date: |
Fri, 27 Nov 2020 23:15:03 -0500 (EST) |
branch: externals/gnorb
commit ed9825e6638da58027fec45440952e07d5ebb947
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
Use map-y-or-n-p for attachment actions
gnorb-org.el: Both `gnorb-org-handle-mail' and `gnorb-org-email-subtree'
gnorb-gnus.el: `gnorb-gnus-capture-attach'
---
lisp/gnorb-gnus.el | 10 +++++++---
lisp/gnorb-org.el | 35 +++++++++++++++++++----------------
2 files changed, 26 insertions(+), 19 deletions(-)
diff --git a/lisp/gnorb-gnus.el b/lisp/gnorb-gnus.el
index 2cc253c..7d862c9 100644
--- a/lisp/gnorb-gnus.el
+++ b/lisp/gnorb-gnus.el
@@ -113,9 +113,13 @@ save them into `gnorb-tmp-dir'."
(require 'org-attach)
(setq gnorb-gnus-capture-attachments nil)
(gnorb-gnus-collect-all-attachments t)
- (when gnorb-gnus-capture-attachments
- (dolist (a gnorb-gnus-capture-attachments)
- (org-attach-attach a nil 'mv)))))
+ (map-y-or-n-p
+ (lambda (a)
+ (format "Attach %s to capture heading? "
+ (file-name-nondirectory a)))
+ (lambda (a) (org-attach-attach a nil 'mv))
+ gnorb-gnus-capture-attachments
+ '("file" "files" "attach"))))
(add-hook 'org-capture-mode-hook 'gnorb-gnus-capture-attach)
diff --git a/lisp/gnorb-org.el b/lisp/gnorb-org.el
index f7e16bb..373f6e7 100644
--- a/lisp/gnorb-org.el
+++ b/lisp/gnorb-org.el
@@ -118,14 +118,16 @@ point."
(attachments (gnorb-org-attachment-list)))
(gnorb-org-setup-message (first mail-stuff) (second mail-stuff))
(message-goto-body)
- (when attachments
- (dolist (a attachments)
- (and (yes-or-no-p
- (format "Attach %s to outgoing message? "
- (file-name-nondirectory a)))
- (mml-attach-file a
- (mm-default-file-encoding a)
- nil "attachment"))))))
+ (map-y-or-n-p
+ (lambda (a)
+ (format "Attach %s to outgoing message? "
+ (file-name-nondirectory a)))
+ (lambda (a)
+ (mml-attach-file
+ a (mm-default-file-encoding a)
+ nil "attachment"))
+ attachments
+ '("file" "files" "attach"))))
(defun gnorb-org-handle-mail-agenda ()
"Examine item at point for mail-related links, and handle them."
@@ -234,14 +236,15 @@ default set of parameters."
result
(mm-default-file-encoding result)
nil "attachment"))
- (when attachments
- (dolist (a attachments)
- (and (yes-or-no-p (format
- "Attach %s to outgoing message? "
- (file-name-nondirectory a)))
- (mml-attach-file a
- (mm-default-file-encoding a)
- nil "attachment"))))))
+ (map-y-or-n-p
+ (lambda (a) (format "Attach %s to outgoing message? "
+ (file-name-nondirectory a)))
+ (lambda (a)
+ (mml-attach-file
+ a (mm-default-file-encoding a)
+ nil "attachment"))
+ attachments
+ '("file" "files" "attach"))))
(provide 'gnorb-org)
;;; gnorb-org.el ends here
- [elpa] externals/gnorb c2b1a3a 013/449: Docstring for gnorb-org-contact-link, (continued)
- [elpa] externals/gnorb c2b1a3a 013/449: Docstring for gnorb-org-contact-link, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb d4987a7 014/449: gnorb-utils.el: More likely requires for Org libraries, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 62368b7 017/449: gnorb-gnus.el: Make attachment fiddling work in org capture, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb da7cf10 018/449: gnorb-utils.el: Require mailcap, and parse, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 5264b3c 021/449: README.org: Document gnorb-org-email-subtree, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 82bb9db 023/449: README.org: Add keybindings to gnus mime commands., Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 534b2bf 024/449: gnorb-org.el: new option gnorb-org-mail-todos, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 9c5d04a 027/449: README.org: More explanation about the mail stuff., Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb e53d908 028/449: gnorb-gnus.el: bugfix in gnorb-gnus-collect-all-attachments, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 4f16002 029/449: gnorb-org.el: Fix attaching attachments to outgoing messages., Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb ed9825e 034/449: Use map-y-or-n-p for attachment actions,
Stefan Monnier <=
- [elpa] externals/gnorb af8f375 038/449: Various README.org tweaks, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 27a91f6 039/449: Open link from string correctly, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 048bbd9 040/449: Many pointless defstructs, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb e183272 055/449: Think about merging mail commands, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb a680c42 058/449: Moving the mail header stuff to a different file, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 8519593 060/449: Rework Org BBDB popups, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 97c0d41 045/449: Place point somewhere useful after setting up message, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb c9e4dfb 056/449: Limit to TODOs only in BBDB tag searches, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 210851e 065/449: That's not broken anymore., Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 72a98bd 020/449: README.org: Document new capture attachment thingy., Stefan Monnier, 2020/11/27