mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-27 00:02:51 +00:00
Capture: Fix the case of using a template file
* lisp/org-capture.el (org-capture-set-plist): Make sure txt is a string before calling `string-match'. (org-capture-templates): Fix customization type. Modified from a patch proposal by Johan Friis. TINYCHANGE
This commit is contained in:
parent
a39e5ef229
commit
bca27d9215
|
@ -285,7 +285,7 @@ calendar | %:type %:date"
|
||||||
(choice :tag "Template"
|
(choice :tag "Template"
|
||||||
(string)
|
(string)
|
||||||
(list :tag "File"
|
(list :tag "File"
|
||||||
(const :format "" file-contents)
|
(const :format "" file)
|
||||||
(file :tag "Template file"))
|
(file :tag "Template file"))
|
||||||
(list :tag "Function"
|
(list :tag "Function"
|
||||||
(const :format "" function)
|
(const :format "" function)
|
||||||
|
@ -981,7 +981,7 @@ Point will remain at the first line after the inserted text."
|
||||||
(org-capture-put :key (car entry) :description (nth 1 entry)
|
(org-capture-put :key (car entry) :description (nth 1 entry)
|
||||||
:target (nth 3 entry))
|
:target (nth 3 entry))
|
||||||
(let ((txt (nth 4 entry)) (type (or (nth 2 entry) 'entry)))
|
(let ((txt (nth 4 entry)) (type (or (nth 2 entry) 'entry)))
|
||||||
(when (or (not txt) (not (string-match "\\S-" txt)))
|
(when (or (not (stringp txt)) (not (string-match "\\S-" txt)))
|
||||||
;; The template may be empty or omitted for special types.
|
;; The template may be empty or omitted for special types.
|
||||||
;; Here we insert the default templates for such cases.
|
;; Here we insert the default templates for such cases.
|
||||||
(cond
|
(cond
|
||||||
|
|
Loading…
Reference in a new issue