org-capture: Fix bd3a2cb

* lisp/org-capture.el (org-capture-fill-template): Fix regexp and type
  for KEY.

Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
<http://permalink.gmane.org/gmane.emacs.orgmode/103214>
This commit is contained in:
Nicolas Goaziou 2015-12-01 23:20:44 +01:00
parent b2eb53f27d
commit fb32b28057
1 changed files with 6 additions and 6 deletions

View File

@ -1630,7 +1630,7 @@ The template may still contain \"%?\" for cursor positioning."
(org-capture--expand-embedded-elisp 'mark) (org-capture--expand-embedded-elisp 'mark)
(let ((regexp "%\\(:[-a-za-z]+\\|<\\([^>\n]+\\)>\\|[aAcfFikKlntTuUx]\\|\ (let ((regexp "%\\(:[-a-za-z]+\\|<\\([^>\n]+\\)>\\|[aAcfFikKlntTuUx]\\|\
^\\(?:{\\([^}]*\\)}\\)?\\([CgGLptTuU]\\)?\\)") \\^\\(?:{\\([^}]*\\)}\\)?\\([CgGLptTuU]\\)?\\)")
(strings)) (strings))
(while (re-search-forward regexp nil t) (while (re-search-forward regexp nil t)
(let ((pos (copy-marker (match-beginning 0))) (let ((pos (copy-marker (match-beginning 0)))
@ -1669,8 +1669,8 @@ The template may still contain \"%?\" for cursor positioning."
"org-capture-template-prompt-history::" "org-capture-template-prompt-history::"
(or prompt "")))) (or prompt ""))))
(setq completions (mapcar #'list completions))) (setq completions (mapcar #'list completions)))
(pcase (string-to-char key) (pcase key
((or ?G ?g) ((or `"G" `"g")
(let* ((org-last-tags-completion-table (let* ((org-last-tags-completion-table
(org-global-tags-completion-table (org-global-tags-completion-table
(cond ((equal key "G") (org-agenda-files)) (cond ((equal key "G") (org-agenda-files))
@ -1693,7 +1693,7 @@ The template may still contain \"%?\" for cursor positioning."
(and (org-at-heading-p) (and (org-at-heading-p)
(let ((org-ignore-region t)) (let ((org-ignore-region t))
(org-set-tags nil 'align)))))) (org-set-tags nil 'align))))))
(?C (`"C"
(cond (cond
((= (length clipboards) 1) (insert (car clipboards))) ((= (length clipboards) 1) (insert (car clipboards)))
((> (length clipboards) 1) ((> (length clipboards) 1)
@ -1701,7 +1701,7 @@ The template may still contain \"%?\" for cursor positioning."
(car clipboards) (car clipboards)
'(clipboards . 1) '(clipboards . 1)
(car clipboards)))))) (car clipboards))))))
(?L (`"L"
(cond ((= (length clipboards) 1) (cond ((= (length clipboards) 1)
(org-insert-link 0 (car clipboards))) (org-insert-link 0 (car clipboards)))
((> (length clipboards) 1) ((> (length clipboards) 1)
@ -1711,7 +1711,7 @@ The template may still contain \"%?\" for cursor positioning."
(car clipboards) (car clipboards)
'(clipboards . 1) '(clipboards . 1)
(car clipboards)))))) (car clipboards))))))
(?p (org-set-property prompt nil)) (`"p" (org-set-property prompt nil))
((guard key) ((guard key)
;; These are the date/time related ones. ;; These are the date/time related ones.
(let* ((upcase? (equal (upcase key) key)) (let* ((upcase? (equal (upcase key) key))