浏览代码

org-capture.el: Don't throw an error abusively

* lisp/org-capture.el (org-capture-fill-template): Don't throw
a user error when immediately finishing a template from which
an initial annotation is missing, warn instead.

This fixes 78ec8da52a.  Thanks to Eric Fraga for reporting this.
Bastien 5 年之前
父节点
当前提交
26ba4f7d7f
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      lisp/org-capture.el

+ 4 - 4
lisp/org-capture.el

@@ -1576,11 +1576,11 @@ The template may still contain \"%?\" for cursor positioning."
 		       annotation
 		       annotation
 		       (org-capture-get :annotation)
 		       (org-capture-get :annotation)
 		       ;; When immediately finishing and %a cannot be
 		       ;; When immediately finishing and %a cannot be
-		       ;; expanded, through a user error:
+		       ;; expanded, warn the user:
 		       (if (org-capture-get :immediate-finish)
 		       (if (org-capture-get :immediate-finish)
-			   (user-error "Missing initial annotation in this template: %s"
-				       (replace-regexp-in-string
-					"\n" " " (org-capture-get :template)))
+			   (warn "Missing initial annotation in this template: %s"
+				 (replace-regexp-in-string
+				  "\n" " " (org-capture-get :template)))
 			 ""))))
 			 ""))))
 	    ;; Is the link empty?  Then we do not want it...
 	    ;; Is the link empty?  Then we do not want it...
 	    (if (equal a "[[]]") "" a)))
 	    (if (equal a "[[]]") "" a)))