From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Allen Li Newsgroups: gmane.emacs.bugs Subject: bug#28008: 25.2; Resume kmacro definition errors C-u C-u Date: Tue, 19 Sep 2017 00:42:21 -0700 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1505806994 6926 195.159.176.226 (19 Sep 2017 07:43:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 19 Sep 2017 07:43:14 +0000 (UTC) Cc: 28008@debbugs.gnu.org To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 19 09:43:10 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1duDBU-0001Tw-Vq for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Sep 2017 09:43:09 +0200 Original-Received: from localhost ([::1]:40557 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duDBc-00046u-2A for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Sep 2017 03:43:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45131) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duDBS-00045m-GC for bug-gnu-emacs@gnu.org; Tue, 19 Sep 2017 03:43:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duDBO-0006sg-Ar for bug-gnu-emacs@gnu.org; Tue, 19 Sep 2017 03:43:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38514) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1duDBO-0006sV-6m for bug-gnu-emacs@gnu.org; Tue, 19 Sep 2017 03:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1duDBN-0005EL-RH for bug-gnu-emacs@gnu.org; Tue, 19 Sep 2017 03:43:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Allen Li Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Sep 2017 07:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28008 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28008-submit@debbugs.gnu.org id=B28008.150580694920060 (code B ref 28008); Tue, 19 Sep 2017 07:43:01 +0000 Original-Received: (at 28008) by debbugs.gnu.org; 19 Sep 2017 07:42:29 +0000 Original-Received: from localhost ([127.0.0.1]:47195 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1duDAr-0005DU-HF for submit@debbugs.gnu.org; Tue, 19 Sep 2017 03:42:29 -0400 Original-Received: from mail-qk0-f176.google.com ([209.85.220.176]:50637) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1duDAp-0005DG-F3 for 28008@debbugs.gnu.org; Tue, 19 Sep 2017 03:42:27 -0400 Original-Received: by mail-qk0-f176.google.com with SMTP id s132so2797799qke.7 for <28008@debbugs.gnu.org>; Tue, 19 Sep 2017 00:42:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=ZibRjRYHt6QlXKN/ROlZWvORslKKdKWc9AFJwcqQyro=; b=jWRWCHVXwYvLFklgqF26r6kBxGModPuVc/cNGlgrdcVysSygnHqOAteTWwSIL2QcFH vjZ6EAZgroDqhzu1q+5a5P7r8WIwxNoSFZJ3++ic31rg4V6INDFjh36lP2cOVWWr8aro 187cN4lchEKAp9qbTV7zExYO9XdlzWCP+Z6WtfEG+YkIM6I1CzKOc+R4hViHy3lMtnzf 0c9arSvD/4nh+MmlT2UEoRuTMrtT2Kq+Wy6Ubj0BfNbhFX7bkoqjexWgsQ89CtaCOggo qx5/PVIUeoVfPZRGzxUngU7iOjO15JtwCBouhxKTx70gkwleVc8vQkBWHS9T9Rknvr1M RZmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=ZibRjRYHt6QlXKN/ROlZWvORslKKdKWc9AFJwcqQyro=; b=lGSUm17nVUf65ZuGtiqUAUafFzbLJkSwTQDAb1ba2lPBshd/NHN0SB0hxpfrvSxoEG K3GDywAHPEXpuuzPLzRS4QruUse8xI2GkzwBHi4vu1zFvKSkcT4magvDAqJYlPypf5qU s4EYonGpElnpUQiDd+raAtg8QpD4btsawReb5O2pmHorsLT3+ToMjjapckzcMaUL0Oy9 SJkbznRUU2mj/RdoKB+v0wT01X4KcB1bex8euW9zo+OeNnDl+NOvdn72D+kxbmojoQBV Ja6iYtJwPP1d47WKrbd8/4mVEPT+IVnhqpugJrr+MkbS+3PcfqfYjnMAlYPMuJSMYg30 an8w== X-Gm-Message-State: AHPjjUj3DbA4k5oIAipqEDPl+jOcF0UROxKIEqfzHBm/saJtvbEcF6bY 1RdKczIGnPYupA1g68SdonrCDkW2OFqbCmqmXT4= X-Google-Smtp-Source: AOwi7QAhL1kfcgrUYShEclL0M9A1+SGrfuLjipSIpmiv5LHvvf4k8FF1bR0BpRyXCRSwewJzatSbODdhgKVpqCIVJBM= X-Received: by 10.55.66.22 with SMTP id p22mr710393qka.78.1505806941946; Tue, 19 Sep 2017 00:42:21 -0700 (PDT) Original-Received: by 10.200.49.212 with HTTP; Tue, 19 Sep 2017 00:42:21 -0700 (PDT) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:137111 Archived-At: On Mon, Sep 18, 2017 at 1:02 PM, Allen Li wrote: > On Fri, Aug 11, 2017 at 6:17 AM, Tino Calancha wrote: >> >> On Fri, 11 Aug 2017, Eli Zaretskii wrote: >>> All these low-level changes just to support an obscure use case? Is >>> really worth the risk to break macros to cater to that? >> >> That depends of how often someone uses kbd macros. I rarely use them, but >> the people using them frequently might suffer D.2 from time to time. >> >> Actually, the patch#1 is quite short: i included a docstring fix from >> the patch#2 by mistake. >> The C code changes in patch#1 are just: >> 3 files changed, 41 insertions(+), 2 deletions(-) > > I had to change a c to Qc in macros.c to get patch 1 to compile. > However, it does not seem to fix case D.2. I don't think this was > made explicit, but case D.2 applies to all undefined keybindings, so > for example C-x C-g, but also C-c z. > > We should at least fix the behavior for case D.2 The more invasive > patch 2 can be discussed later, but Emacs shouldn't just discard the > entire recorded macro on an undefined key press. This makes me > nervous whenever I use kmacros. Actually, to fix case D.2 (where undefined keys exit kmacro definition without saving), all that is needed is a short Emacs Lisp change. This keeps the behavior of a bare C-g keyboard-abort of not saving the kmacro. [PATCH] Make undefined keys exit and save kmacro definition * lisp/subr.el (undefined): Error out of kmacro definition. --- lisp/subr.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/subr.el b/lisp/subr.el index 79ae1f4830..f0c4e2969d 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -785,8 +785,9 @@ undefined "Beep to tell the user this binding is undefined." (interactive) (ding) - (message "%s is undefined" (key-description (this-single-command-keys))) - (setq defining-kbd-macro nil) + (if defining-kbd-macro + (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; ;; pass it to the command run by the up event. -- 2.14.1