diff --git a/doc/org-manual.org b/doc/org-manual.org index 2f0947fdc..d58cc847c 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -8031,6 +8031,15 @@ mentioning. tried when resolving existing ID's into paths, to maintain backward compatibility with existing folders in your system. +- ~org-attach-store-link-p~ :: + #+vindex: org-attach-store-link-p + Stores a link to the file that is being attached. The link is + stored in ~org-stored-links~ for later insertion with {{{kbd(C-c + C-l)}}} (see [[*Handling Links]]). Depending on what option is set in + ~org-attach-store-link-p~, the link is stored to either the original + location as a file link, the attachment location as an attachment + link or to the attachment location as a file link. + - ~org-attach-expert~ :: #+vindex: org-attach-expert Do not show the splash buffer with the attach dispatcher when diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 67c3ca2ed..90e612529 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -64,6 +64,10 @@ normal headlines. The face can be customized via ~org-headline-todo~. there was only key == to exit column view and only functional on lines which were affected by the column view. +*** New option in ~org-attach-store-link-p~ +~org-attach-store-link-p~ have a new option to store a file link to +the attachment. + * Version 9.3 ** Incompatible changes diff --git a/lisp/org-attach.el b/lisp/org-attach.el index 6bc87688b..f5c81e01f 100644 --- a/lisp/org-attach.el +++ b/lisp/org-attach.el @@ -139,7 +139,8 @@ Selective means to respect the inheritance setting in :type '(choice (const :tag "Don't store link" nil) (const :tag "Link to origin location" t) - (const :tag "Link to the attach-dir location" attached))) + (const :tag "Attachment link to the attach-dir location" attached) + (const :tag "File link to the attach-dir location" file))) (defcustom org-attach-archive-delete nil "Non-nil means attachments are deleted upon archiving a subtree. @@ -506,6 +507,10 @@ METHOD may be `cp', `mv', `ln', `lns' or `url' default taken from ((eq org-attach-store-link-p t) (push (list (concat "file:" file) (file-name-nondirectory file)) + org-stored-links)) + ((eq org-attach-store-link-p 'file) + (push (list (concat "file:" attach-file) + (file-name-nondirectory attach-file)) org-stored-links))) (if visit-dir (dired attach-dir)