瀏覽代碼

org-capture: Fix error when clipboard is empty

* lisp/org-capture.el (org-capture-fill-template): Fix "%x"
  placeholder when clipboard is empty.

Reported-by: Brady Trainor <mail@bradyt.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-04/msg00328.html>
Nicolas Goaziou 7 年之前
父節點
當前提交
c75c574d58
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      lisp/org-capture.el

+ 2 - 1
lisp/org-capture.el

@@ -1607,7 +1607,8 @@ The template may still contain \"%?\" for cursor positioning."
 	 (v-c (and kill-ring (current-kill 0)))
 	 (v-x (or (org-get-x-clipboard 'PRIMARY)
 		  (org-get-x-clipboard 'CLIPBOARD)
-		  (org-get-x-clipboard 'SECONDARY)))
+		  (org-get-x-clipboard 'SECONDARY)
+		  ""))			;ensure it is a string
 	 ;; `initial' and `annotation' might have been passed.  But if
 	 ;; the property list has them, we prefer those values.
 	 (v-i (or (plist-get org-store-link-plist :initial)