all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: miha--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 48603@debbugs.gnu.org
Subject: bug#48603: 27.2; [PATCH] Quit minibuffers without aborting kmacros
Date: Tue, 07 Sep 2021 17:11:11 +0200	[thread overview]
Message-ID: <875yvcl8ts.fsf@miha-pc> (raw)
In-Reply-To: <877dhlf9ex.fsf@gnus.org>


[-- Attachment #1.1: Type: text/plain, Size: 536 bytes --]

Lars Ingebrigtsen <larsi@gnus.org> writes:

> <miha@kamnitnik.top> writes:
>
>> Good idea, attaching a revised patch (which also adds two NEWS entries.)
>
> Sorry; I forgot all about this.  I've now re-read and tested the patch,
> and it seems to work fine for me, so I've pushed it to Emacs 28.

After some testing, I found out that we can't record kmacros that end
with C-g in the minibuffer. For example, trying to record a kmacro like
"C-n M-x C-g" will actually record only "C-n".

Please consider the attached patch to fix this.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-Allow-kmacros-to-end-with-C-g-in-minibuffer.patch --]
[-- Type: text/x-patch, Size: 981 bytes --]

From 1fc801cde2cd0a7c557fdb3d4e1593eaa85518f8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miha=20Rihtar=C5=A1i=C4=8D?= <miha@kamnitnik.top>
Date: Tue, 7 Sep 2021 16:55:22 +0200
Subject: [PATCH] Allow kmacros to end with C-g in minibuffer

* src/keyboard.c (cmd_error): If a command causes a minibuffer-quit
condition, record its key in a keyboard macro.
---
 src/keyboard.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/keyboard.c b/src/keyboard.c
index f6139b30e7..a32c3e7b2b 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -951,6 +951,10 @@ cmd_error (Lisp_Object data)
       Vexecuting_kbd_macro = Qnil;
       executing_kbd_macro = Qnil;
     }
+  else if (!NILP (KVAR (current_kboard, defining_kbd_macro)))
+    /* A command that signals a minibuffer-quit condition should be
+       installed in kbd macro.  */
+    finalize_kbd_macro_chars ();
 
   specbind (Qstandard_output, Qt);
   specbind (Qstandard_input, Qt);
-- 
2.33.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

  parent reply	other threads:[~2021-09-07 15:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-23 14:36 bug#48603: 27.2; [PATCH] Quit minibuffers without aborting kmacros miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-25 19:54 ` Lars Ingebrigtsen
2021-05-25 21:34   ` miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-20 12:37     ` Lars Ingebrigtsen
2021-08-17 22:45       ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-18 14:55         ` Lars Ingebrigtsen
2021-09-01  6:58         ` miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-01  8:11           ` Lars Ingebrigtsen
2021-09-03 17:53           ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-07 15:11       ` miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2021-09-08  7:40         ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875yvcl8ts.fsf@miha-pc \
    --to=bug-gnu-emacs@gnu.org \
    --cc=48603@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=miha@kamnitnik.top \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.