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

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

[elpa] externals/gnorb 9fbd947 105/449: Collect attachments on incoming


From: Stefan Monnier
Subject: [elpa] externals/gnorb 9fbd947 105/449: Collect attachments on incoming trigger action
Date: Fri, 27 Nov 2020 23:15:19 -0500 (EST)

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

    Collect attachments on incoming trigger action
    
    lisp/gnorb-gnus.el: `gnorb-gnus-incoming-do-todo' now collects
                    attachments from the incoming message.
    
    lisp/gnorb-util.el: And then `gnorb-trigger-todo-action' prompts for
                    attachment.
---
 lisp/gnorb-gnus.el  | 16 +++++++++-------
 lisp/gnorb-utils.el |  7 +++++++
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/lisp/gnorb-gnus.el b/lisp/gnorb-gnus.el
index 4f4dbac..c354157 100644
--- a/lisp/gnorb-gnus.el
+++ b/lisp/gnorb-gnus.el
@@ -373,22 +373,24 @@ if any of the IDs there match the value of the
                (message "Gnorb can't check for relevant headings unless 
`org-id-track-globally' is t")
                (sit-for 1))))
           targ)
-      ;; offer to attach attachments!
+      (gnorb-gnus-collect-all-attachments)
       (if id
          (gnorb-trigger-todo-action arg id)
        (if (and offer-heading
                 (y-or-n-p (format "Trigger action on %s"
-                           (org-format-outline-path (cadr offer-heading)))))
+                                  (org-format-outline-path (cadr 
offer-heading)))))
            (gnorb-trigger-todo-action arg (car offer-heading))
          (setq targ (org-refile-get-location
                      "Trigger heading" nil t))
          (find-file (nth 1 targ))
          (goto-char (nth 3 targ))
-         (gnorb-trigger-todo-action arg))
-       (message
-        "Insert a link to the message with org-insert-link (%s)"
-        (mapconcat 'key-description
-                   (where-is-internal 'org-insert-link) ", "))))))
+         (gnorb-trigger-todo-action arg)))
+      ;; will this ever actually get called?
+      (setq gnorb-gnus-capture-attachments nil)
+      (message
+       "Insert a link to the message with org-insert-link (%s)"
+       (mapconcat 'key-description
+                 (where-is-internal 'org-insert-link) ", ")))))
 
 (defun gnorb-gnus-search-messages (str &optional ret)
   "Initiate a search for gnus message links in an org subtree.
diff --git a/lisp/gnorb-utils.el b/lisp/gnorb-utils.el
index 34a51e7..40f8acd 100644
--- a/lisp/gnorb-utils.el
+++ b/lisp/gnorb-utils.el
@@ -147,6 +147,13 @@ the prefix arg."
                          (if (eq gnorb-trigger-todo-default 'todo)
                              'note
                            'todo))))
+      (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"))
       (if (eq action 'note)
          (call-interactively note-func)
        (call-interactively todo-func)))))



reply via email to

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