emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/gnorb b82576c 268/449: Always clear attachments during


From: Stefan Monnier
Subject: [elpa] externals/gnorb b82576c 268/449: Always clear attachments during triggering
Date: Fri, 27 Nov 2020 23:15:53 -0500 (EST)

branch: externals/gnorb
commit b82576c9f7c1646e2e61f53c8c9989fc86b0559b
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>

    Always clear attachments during triggering
    
    * gnorb-utils.el (gnorb-trigger-todo-action):
      `gnorb-gnus-capture-attachments' needs to be set to nil even if there
      are errors. Leaving that variable populated, even if the trigger
      process fails/aborts, can be very confusing.
---
 gnorb-utils.el | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/gnorb-utils.el b/gnorb-utils.el
index 01a5e16..dbe9e99 100644
--- a/gnorb-utils.el
+++ b/gnorb-utils.el
@@ -239,16 +239,18 @@ agenda. Then let the user choose an action from the value 
of
             (move-marker root-marker (point-at-bol)))))
     (unless agenda-p
       (org-reveal))
-    ;; Query about attaching email attachments.
-    (org-with-point-at root-marker
-      (map-y-or-n-p
-       (lambda (a)
-        (format "Attach %s to heading? "
-                (file-name-nondirectory a)))
-       (lambda (a) (org-attach-attach a nil 'mv))
-       gnorb-gnus-capture-attachments
-       '("file" "files" "attach")))
-    (setq gnorb-gnus-capture-attachments nil)
+    ;; Query about attaching email attachments. No matter what
+    ;; happens, clear `gnorb-gnus-capture-attachments'.
+    (unwind-protect
+       (org-with-point-at root-marker
+         (map-y-or-n-p
+          (lambda (a)
+            (format "Attach %s to heading? "
+                    (file-name-nondirectory a)))
+          (lambda (a) (org-attach-attach a nil 'mv))
+          gnorb-gnus-capture-attachments
+          '("file" "files" "attach")))
+      (setq gnorb-gnus-capture-attachments nil))
     (cl-labels
        ((make-entry
          (id)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]