summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustav Wikström <gustav@whil.se>2020-01-19 10:29:36 +0100
committerGustav Wikström <gustav@whil.se>2020-01-19 10:50:14 +0100
commitedefb2835d5b720891cacf69168cf1a521649166 (patch)
tree8b9f6b5e602ed99281d5b8c9ca42c788f04c4ecb
parentf0ce4a6357a7e4fe4d6aa4c321a351e21e0b0729 (diff)
downloadorg-mode-edefb2835d5b720891cacf69168cf1a521649166.tar.gz
Additional option for org-attach-store-link-p
* doc/org-manual.org (Attachment options) * etc/ORG-NEWS (New option in ~org-attach-store-link-p~) * lisp/org-attach.el (org-attach-store-link-p) (org-attach-attach): Add option to store a link to the attached file with a file link.
-rw-r--r--doc/org-manual.org9
-rw-r--r--etc/ORG-NEWS4
-rw-r--r--lisp/org-attach.el7
3 files changed, 19 insertions, 1 deletions
diff --git a/doc/org-manual.org b/doc/org-manual.org
index 2f0947f..d58cc84 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 67c3ca2..90e6125 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 =<q>= 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 6bc8768..f5c81e0 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)