From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Allen Li Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] emacs-26 f172894: Exit macro definition on undefined keys Date: Sat, 30 Sep 2017 15:25:28 -0700 Message-ID: References: <20170930134840.28326.3545@vcs0.savannah.gnu.org> <20170930134841.1354D20514@vcs0.savannah.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1506816179 10809 195.159.176.226 (1 Oct 2017 00:02:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 1 Oct 2017 00:02:59 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 01 02:02:56 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dyRih-0002Q0-Hf for ged-emacs-devel@m.gmane.org; Sun, 01 Oct 2017 02:02:55 +0200 Original-Received: from localhost ([::1]:40703 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dyRip-0001tJ-2U for ged-emacs-devel@m.gmane.org; Sat, 30 Sep 2017 20:03:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dyQCQ-0006FK-Sd for emacs-devel@gnu.org; Sat, 30 Sep 2017 18:25:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dyQCP-0000LM-Vy for emacs-devel@gnu.org; Sat, 30 Sep 2017 18:25:30 -0400 Original-Received: from mail-qk0-x22f.google.com ([2607:f8b0:400d:c09::22f]:54191) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dyQCP-0000KW-SI for emacs-devel@gnu.org; Sat, 30 Sep 2017 18:25:29 -0400 Original-Received: by mail-qk0-x22f.google.com with SMTP id w63so2444429qkd.10 for ; Sat, 30 Sep 2017 15:25:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=hzbjxc9mSSEbOA1npykTIplG8ZZ+4cQIbEfaqBYA3lc=; b=U+xNQJtNjw0euXzB6OEBkEEysE9emM89zalFyPdrxEEisYMrohNVHg4Lsuqw2TVLw9 WDljoLbQsQPP3KLxzvGAbp8/Q72l5T5wFyEXxyIrP+0RmLbc8oumxHEixCs7ABCIwM93 Na2sHsmS+IZGs28oQKsaBX6KKUpTtJZuIm59DjEDPy0kPPWukkOvXO+/Td7dxlZRzgLo KxQYt9sTtJ98+clnvIx5MIuJNli/Ng3ZUBdLxxGtyx+TAk+PDNcFBriU5swd+KMGG3Ay 0EB3nKA8P7Sw9ZybB9bcokWydNb/5MW9g4u1w3RhyDoevfMgpc/qU5stbKPI3rxZHZPv Qpjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=hzbjxc9mSSEbOA1npykTIplG8ZZ+4cQIbEfaqBYA3lc=; b=May88rrY+fZuahbmdSL4/McFIfmJr0SSDWgqj7lfIFnsXs1gYHNU1+uP2ICKZJwvOb qEHAXps1c1Y1SNIuT0YPcXHAF96HVOwQpfRg4sV+834QWDYmYfzbOLhoPQW3iw633xxS IBkYpU382LGa/SP9Cv2XuQ3gD6kd2MLxfFMjpvq5viSFWLZOICtzeTrZlLmYElVdFcyU HXc28MGItC17bfjL2MWmAHLbtiMQ3L8W4zU1CYBgU8zIypgMi+AgIDqpSlCIHlVMBZ44 V5Sh1gYOWJ6nQAA3eS9WU2TE5odXhJTsWxJFSJndIkUfBFIeRjT9n2na86lA7DhFbipL 258A== X-Gm-Message-State: AMCzsaXO6SztQQaYgmAjZm/F7lyzUaBPzWRO7yDeyR7BwwmiqOQkiBVk Ttg1HEDlV1RsFLXelEaWC8CYHtXPPiJ/ZigXSr4= X-Google-Smtp-Source: AOwi7QBThuVNukTHHi+TLSbjVviMTTTMZ7sqk1+YZU6fyGpv1lDVJKM1B40a9O/T5TAy5rYSDZObpnHOj3OPF+uVA2I= X-Received: by 10.55.203.70 with SMTP id d67mr4874567qkj.123.1506810329129; Sat, 30 Sep 2017 15:25:29 -0700 (PDT) Original-Received: by 10.237.60.196 with HTTP; Sat, 30 Sep 2017 15:25:28 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::22f X-Mailman-Approved-At: Sat, 30 Sep 2017 20:02:28 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:218980 Archived-At: On Sat, Sep 30, 2017 at 10:12 AM, Stefan Monnier wrote: >> + (if defining-kbd-macro >> + (error "%s is undefined" (key-description (this-single-command-ke= ys))) >> + (message "%s is undefined" (key-description (this-single-command-ke= ys)))) > > Would user-error do the trick? Yep. It sounds like user-error would be the better choice here. (I'm assuming it's okay to post patches on emacs-devel. Apologies if it is= n't.) [PATCH] Use `user-error' to exit macro definition on undefined keys * lisp/subr.el (undefined): Use =E2=80=98user-error=E2=80=99 instead of =E2= =80=98error=E2=80=99. --- lisp/subr.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/subr.el b/lisp/subr.el index 64479a4b5b..0bd7662b3b 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -786,7 +786,7 @@ undefined (interactive) (ding) (if defining-kbd-macro - (error "%s is undefined" (key-description (this-single-command-keys)= )) + (user-error "%s is undefined" (key-description (this-single-command-keys))) (message "%s is undefined" (key-description (this-single-command-keys)= ))) (force-mode-line-update) ;; If this is a down-mouse event, don't reset prefix-arg; --=20 2.14.1