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

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

[elpa] externals/gnorb 01645a4 215/449: Allowing fetching attachments fr


From: Stefan Monnier
Subject: [elpa] externals/gnorb 01645a4 215/449: Allowing fetching attachments from specific IDs
Date: Fri, 27 Nov 2020 23:15:42 -0500 (EST)

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

    Allowing fetching attachments from specific IDs
    
    * lisp/gnorb-org.el (gnorb-org-attachment-list): Allow passing an Org ID
      to the function to get the attachment list from the specified ID,
      rather than the heading under point.
---
 lisp/gnorb-org.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lisp/gnorb-org.el b/lisp/gnorb-org.el
index 52979e8..9f7cb9c 100644
--- a/lisp/gnorb-org.el
+++ b/lisp/gnorb-org.el
@@ -347,11 +347,14 @@ headings."
     (message-goto-to))
   (run-hooks 'gnorb-org-after-message-setup-hook))
 
-(defun gnorb-org-attachment-list ()
+(defun gnorb-org-attachment-list (&optional id)
   "Get a list of files (absolute filenames) attached to the
-current heading."
+current heading, or the heading indicated by optional argument ID."
   (when (featurep 'org-attach)
-    (let* ((attach-dir (org-attach-dir t))
+    (let* ((attach-dir (save-excursion
+                        (when id
+                          (org-id-goto id))
+                        (org-attach-dir)))
           (files
            (mapcar
             (lambda (f)



reply via email to

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