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

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>
This commit is contained in:
Nicolas Goaziou 2017-07-13 14:08:20 +02:00
parent a8e13b9ffc
commit 3315bd1118

View File

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