summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2011-03-10 11:18:40 +0100
committerBastien Guerry <bzg@altern.org>2011-03-10 11:18:40 +0100
commitb814d83b513b96740e65af4de0744a382f5ae8b6 (patch)
treeb9d664fbdf8292ca035e737660a5c89daa11d8cc
parent25ea18739d73907c2c4495852ec452708588297b (diff)
downloadorg-mode-b814d83b513b96740e65af4de0744a382f5ae8b6.tar.gz
* org-attach.el: Allow to store a link to the attach-dir location.
* org-attach.el (org-attach-store-link-p): Allow to create a link to the attach-dir location of the file. (org-attach-attach): Allow to store a link to the attach-dir location. This was requested by Darlan Cavalcante Moreira.
-rw-r--r--lisp/org-attach.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/org-attach.el b/lisp/org-attach.el
index 6b96338..f87d428 100644
--- a/lisp/org-attach.el
+++ b/lisp/org-attach.el
@@ -102,7 +102,10 @@ ln create a hard link. Note that this is not supported
(defcustom org-attach-store-link-p nil
"Non-nil means store a link to a file when attaching it."
:group 'org-attach
- :type 'boolean)
+ :type '(choice
+ (const :tag "Don't store link" nil)
+ (const :tag "Link to origin location" 'origin)
+ (const :tag "Link to the attach-dir location" 'attach-dir)))
;;;###autoload
(defun org-attach ()
@@ -294,8 +297,10 @@ METHOD may be `cp', `mv', or `ln', default taken from `org-attach-method'."
((eq method 'ln) (add-name-to-file file fname)))
(org-attach-commit)
(org-attach-tag)
- (when org-attach-store-link-p
- (org-attach-store-link file))
+ (cond ((eq org-attach-store-link-p 'origin)
+ (org-attach-store-link file))
+ ((eq org-attach-store-link-p 'attach-dir)
+ (org-attach-store-link fname)))
(if visit-dir
(dired attach-dir)
(message "File \"%s\" is now a task attachment." basename)))))