From 4681055651950bdd66090745dcd2cc9f2b90a0f2 Mon Sep 17 00:00:00 2001 From: Aaron Ecay Date: Sun, 15 Dec 2013 23:52:02 -0500 Subject: [PATCH] org-attach: only offer to delete/open attachments of the current headline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/org-attach.el (org-attach-open): Only get the files pertaining to the present headline This change is useful in cases where the attachment directory is inherited – in such cases, the we don’t want to see all the files in the directory, but rather only those associated to the present headline. --- lisp/org-attach.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/org-attach.el b/lisp/org-attach.el index 58ec2d1..6ec5da8 100644 --- a/lisp/org-attach.el +++ b/lisp/org-attach.el @@ -374,7 +374,8 @@ The attachment is created as an Emacs buffer." "Delete a single attachment." (interactive) (let* ((attach-dir (org-attach-dir t)) - (files (org-attach-file-list attach-dir)) + (files (org-entry-get-multivalued-property + nil org-attach-file-list-property)) (file (or file (org-icompleting-read "Delete attachment: " @@ -449,7 +450,8 @@ and in the system-specific variants of this variable. If IN-EMACS is non-nil, force opening in Emacs." (interactive "P") (let* ((attach-dir (org-attach-dir t)) - (files (org-attach-file-list attach-dir)) + (files (org-entry-get-multivalued-property + nil org-attach-file-list-property)) (file (if (= (length files) 1) (car files) (org-icompleting-read "Open attachment: " -- 1.8.5.1