summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2010-07-06 09:44:31 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2010-07-06 09:44:31 +0200
commitc80d5b9c2763e368481fcedc3ab5cf7bcdbca405 (patch)
tree8b4d6ce50123b12cd68476b0d78ba6eba02f5833
parent75192f263eb69737153512a540f0f215d28c5d06 (diff)
downloadorg-mode-c80d5b9c2763e368481fcedc3ab5cf7bcdbca405.tar.gz
Capture: Expand template file name
-rw-r--r--lisp/org-capture.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index b3db087..c689d6d 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -659,13 +659,14 @@ already gone."
(let* ((txt (org-capture-get :template))
(reversed (org-capture-get :prepend))
(target-entry-p (org-capture-get :target-entry-p))
- level beg end)
+ level beg end file)
;; Get the full template
(cond
((and (listp txt) (eq (car txt) 'file))
- (if (file-exists-p (nth 1 txt))
- (setq txt (org-file-contents (nth 1 txt)))
+ (if (file-exists-p
+ (setq file (expand-file-name (nth 1 txt) org-directory)))
+ (setq txt (org-file-contents file))
(setq txt (format "Template file %s not found" (nth 1 txt)))))
((and (listp txt) (eq (car txt) 'function))
(if (fboundp (nth 1 txt))