diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-07-13 14:08:20 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-07-13 14:08:20 +0200 |
commit | 3315bd11186992e11e7164429f513a41afa9785c (patch) | |
tree | c8c8fa148edb10d91cc52431da24b19530d86efd | |
parent | a8e13b9ffc207d46a926752e86f6242950e42aa7 (diff) | |
download | org-mode-3315bd11186992e11e7164429f513a41afa9785c.tar.gz |
org-capture: Fix %k and %K in capture template
* lisp/org-capture.el (org-capture-fill-template): Fix link returned
by %K. Also, both %k and %K should be expanded as strings even when
there is no clocking data.
Reported-by: Michal Politowski <mpol@meep.pl>
-rw-r--r-- | lisp/org-capture.el | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 1175cb4..9fc4da9 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1575,12 +1575,15 @@ The template may still contain \"%?\" for cursor positioning." (replace-match "\\1" nil nil v-a) v-a)) (v-n user-full-name) - (v-k (and (marker-buffer org-clock-marker) - (org-no-properties org-clock-heading))) + (v-k (if (marker-buffer org-clock-marker) + (org-no-properties org-clock-heading) + "")) (v-K (if (marker-buffer org-clock-marker) (org-make-link-string - (buffer-file-name (marker-buffer org-clock-marker)) - org-clock-heading))) + (format "%s::%s" + (buffer-file-name (marker-buffer org-clock-marker)) + (org-no-properties org-clock-heading))) + "")) (v-f (or (org-capture-get :original-file-nondirectory) "")) (v-F (or (org-capture-get :original-file) "")) (org-capture--clipboards |