1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-24 07:20:29 +00:00

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.
This commit is contained in:
Gustav Wikström 2020-01-19 10:29:36 +01:00
parent f0ce4a6357
commit edefb2835d
3 changed files with 19 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -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)