org-capture.el: Fix expand template order

* lisp/org-capture.el (org-capture-fill-template): Expand %(sexp) after
  %:keywords, per documentation about capture templates expansion.

When a template is expanded first the simple %-escapes, %:keywords and
after that the %(sexp).

TINYCHANGE
This commit is contained in:
Roberto Huelga Díaz 2014-10-29 18:29:11 +01:00 committed by Nicolas Goaziou
parent e975eac4ce
commit cdb0a962bc
1 changed files with 4 additions and 2 deletions

View File

@ -1602,8 +1602,6 @@ The template may still contain \"%?\" for cursor positioning."
(insert-file-contents filename) (insert-file-contents filename)
(error (insert (format "%%![Couldn't insert %s: %s]" (error (insert (format "%%![Couldn't insert %s: %s]"
filename error))))))) filename error)))))))
;; %() embedded elisp
(org-capture-expand-embedded-elisp)
;; The current time ;; The current time
(goto-char (point-min)) (goto-char (point-min))
@ -1633,6 +1631,10 @@ The template may still contain \"%?\" for cursor positioning."
(intern (match-string 1))) "")) (intern (match-string 1))) ""))
(replace-match x t t))))) (replace-match x t t)))))
;; %() embedded elisp
(goto-char (point-min))
(org-capture-expand-embedded-elisp)
;; Turn on org-mode in temp buffer, set local variables ;; Turn on org-mode in temp buffer, set local variables
;; This is to support completion in interactive prompts ;; This is to support completion in interactive prompts
(let ((org-inhibit-startup t)) (org-mode)) (let ((org-inhibit-startup t)) (org-mode))