From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chunyang Xu Subject: [PATCH] org-capture: Adapt user-error for aborting by user Date: Sun, 01 May 2016 14:11:43 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awkc9-0006xN-Eh for emacs-orgmode@gnu.org; Sun, 01 May 2016 02:12:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1awkbx-0006R9-NA for emacs-orgmode@gnu.org; Sun, 01 May 2016 02:12:16 -0400 Received: from mail-pf0-x22d.google.com ([2607:f8b0:400e:c00::22d]:34559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1awkbw-0006My-Cy for emacs-orgmode@gnu.org; Sun, 01 May 2016 02:12:09 -0400 Received: by mail-pf0-x22d.google.com with SMTP id y69so65357195pfb.1 for ; Sat, 30 Apr 2016 23:11:53 -0700 (PDT) Received: from localhost ([128.199.88.169]) by smtp.gmail.com with ESMTPSA id i1sm35512610pfj.17.2016.04.30.23.11.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Apr 2016 23:11:48 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hi, Sometimes I turn on lisp debugger with M-x toggle-debug-on-error for some reason, then aborting org-capture with 'q' or 'C-g' enters the debugger, which is annoying. I think `user-error' is better than `error' in this case. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-capture-Adapt-user-error-for-aborting-by-user.patch Content-Description: patch >From 9d950e96c48b8e1a0dad779cdf34a4f8a76621db Mon Sep 17 00:00:00 2001 From: Chunyang Xu Date: Sun, 1 May 2016 12:47:14 +0800 Subject: [PATCH] org-capture: Adapt user-error for aborting by user When `org-capture` is aborted by user with 'q' or 'C-g', `user-error' is better than `error' to use to exit. --- lisp/org-capture.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 008f0a6..34a6817 100644 --- a/lisp/org-capture.el +++ b/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)) -- 2.8.0 --=-=-=--