Browse Source

org-capture: Adapt user-error for aborting by user

* lisp/org-capture.el (org-capture):
(org-mks): Replace `error' with `user-error'.

When `org-capture` is aborted by user with 'q' or 'C-g', `user-error' is
better than `error' when exiting.

TINYCHANGE
Chunyang Xu 9 years ago
parent
commit
b46527a8ba
1 changed files with 2 additions and 2 deletions
  1. 2 2
      lisp/org-capture.el

+ 2 - 2
lisp/org-capture.el

@@ -590,7 +590,7 @@ of the day at point (if any) or the current HH:MM time."
        ((equal entry "C")
 	(customize-variable 'org-capture-templates))
        ((equal entry "q")
-	(error "Abort"))
+	(user-error "Abort"))
        (t
 	(org-capture-set-plist entry)
 	(org-capture-get-template)
@@ -1504,7 +1504,7 @@ only the bare key is returned."
 	    (setq pressed (char-to-string (read-char-exclusive))))
 	  (when (equal pressed "\C-g")
 	    (kill-buffer buffer)
-	    (error "Abort"))
+	    (user-error "Abort"))
 	  (when (and (not (assoc pressed table))
 		     (not (member pressed des-keys))
 		     (assoc pressed specials))