From unknown Sun Sep 07 01:43:39 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#48603 <48603@debbugs.gnu.org> To: bug#48603 <48603@debbugs.gnu.org> Subject: Status: 27.2; [PATCH] Quit minibuffers without aborting kmacros Reply-To: bug#48603 <48603@debbugs.gnu.org> Date: Sun, 07 Sep 2025 08:43:39 +0000 retitle 48603 27.2; [PATCH] Quit minibuffers without aborting kmacros reassign 48603 emacs submitter 48603 miha@kamnitnik.top severity 48603 normal tag 48603 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun May 23 10:31:13 2021 Received: (at submit) by debbugs.gnu.org; 23 May 2021 14:31:14 +0000 Received: from localhost ([127.0.0.1]:41505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lkp8L-0008Rn-9z for submit@debbugs.gnu.org; Sun, 23 May 2021 10:31:13 -0400 Received: from lists.gnu.org ([209.51.188.17]:34026) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lkp8G-0008Rb-6b for submit@debbugs.gnu.org; Sun, 23 May 2021 10:31:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkp8E-00019V-14 for bug-gnu-emacs@gnu.org; Sun, 23 May 2021 10:31:08 -0400 Received: from kamnitnik.top ([2001:19f0:5001:bf2:5400:2ff:fee0:2626]:35894 helo=mail.kamnitnik.top) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkp8A-0002zt-4O for bug-gnu-emacs@gnu.org; Sun, 23 May 2021 10:31:05 -0400 Received: from localhost (unknown [IPv6:2a00:ee2:e04:9300:b7eb:7ae7:cc56:e0da]) by mail.kamnitnik.top (Postfix) with ESMTPSA id 4DD03BBB78 for ; Sun, 23 May 2021 14:30:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kamnitnik.top; s=mail; t=1621780256; bh=38jQOKJWp9xT8JApHW6CsgPpw68ikl2C1HArji2wxWk=; h=From:To:Subject:Date:From; b=Qw/n1aqS/pubjltgJbvTCtEFMLyDnsHWYJAEVz4fA+6kPIaBdYYCftXdNBOZQkUaE m6xFfbn+sBjtpWoa8d5mghzq+GihIB+rhCfgsvVTcMprgDQ/SmPgpnO0eyGKRjOnBi pTA09/s2+H2Tdk83lcBdnhclSdnhZ+vVl4XrEF2X5slan9/pX57s/WRiD+hOKDDD9+ Rn2k5Q7XLHFiplRP6EcgYzN5zuyu1rFYytRye34AqIeAsphnkEFfoZDJ8TWWDKF8Ck SgdBUxiBwN5rpsFpIAJ0ASHvJ7Sgepfrn3G+3EdQbO2WFNxIa7HMFBALrvRPq9644i WM4PVA+zDNcww== From: miha@kamnitnik.top To: bug-gnu-emacs@gnu.org Subject: 27.2; [PATCH] Quit minibuffers without aborting kmacros Date: Sun, 23 May 2021 16:36:17 +0200 Message-ID: <86eedx7c0u.fsf@miha-pc> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2001:19f0:5001:bf2:5400:2ff:fee0:2626; envelope-from=miha@kamnitnik.top; helo=mail.kamnitnik.top X-Spam_score_int: 23 X-Spam_score: 2.3 X-Spam_bar: ++ X-Spam_report: (2.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_SUSPICIOUS_NTLD=0.499, FROM_SUSPICIOUS_NTLD_FP=1.901, PDS_OTHER_BAD_TLD=1.999, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 3.0 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Rationale: a user wants to copy a command from command history without executing it. Or user wants to complete a file name in C-x C-f and copy it without finding the file. I believe this should be pos [...] Content analysis details: (3.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.9 SPF_FAIL SPF: sender does not match SPF record (fail) [SPF failed: Please see http://www.openspf.org/Why?s=mfrom; id=miha%40kamnitnik.top; ip=209.51.188.17; r=debbugs.gnu.org] 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [209.51.188.17 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [209.51.188.17 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD 1.9 FROM_SUSPICIOUS_NTLD_FP From abused NTLD X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.1 (/) --=-=-= Content-Type: text/plain Content-Disposition: inline Rationale: a user wants to copy a command from command history without executing it. Or user wants to complete a file name in C-x C-f and copy it without finding the file. I believe this should be possible in keyboard macros. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Quit-minibuffers-without-aborting-kmacros.patch >From 5513841b55e47f05f3e049ffcb71a0fc56287fbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miha=20Rihtar=C5=A1i=C4=8D?= Date: Sun, 23 May 2021 16:08:43 +0200 Subject: [PATCH] Quit minibuffers without aborting kmacros * src/data.c (syms_of_data): New error symbol `lite-quit' * src/keyboard.c (recursive_edit_1): Implement throwing of function values to `exit`. In that case, the function will be called without arguments before returning from the command loop. (cmd_error): (Fcommand_error_default_function): Do not abort keyboard macro execution if lite-quit is signaled. (command_loop_2): New argument HANDLERS. * src/macros.c (Fexecute_kbd_macro): Use command_loop_2 instead of command_loop_1. * doc/lispref/commands.texi (Quitting): Document `lite-quit' (Recursive Editing): Document throwing of function values to `exit'. * doc/lispref/errors.texi (Standard Errors): Document `lite-quit' * lisp/minibuffer.el (lite-quit-recursive-edit): New function. * src/minibuf.c (Fabort_minibuffers): Use it. * lisp/simple.el (minibuffer-error-function): Do not abort keyboard macro execution if is lite-quit is signaled. --- doc/lispref/commands.texi | 14 +++++++++--- doc/lispref/errors.texi | 9 ++++++-- lisp/minibuffer.el | 9 ++++++++ lisp/simple.el | 6 ++++-- src/data.c | 2 ++ src/keyboard.c | 45 ++++++++++++++++++++++++++++----------- src/lisp.h | 2 +- src/macros.c | 2 +- src/minibuf.c | 2 +- 9 files changed, 69 insertions(+), 22 deletions(-) diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 8199ece110..a0b99ed144 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -3378,6 +3378,12 @@ Quitting in @ref{Errors}.) @end deffn + To quit without aborting keyboard macro definition or execution, you +can signal the @code{lite-quit} condition. This has almost the same +effect as the @code{quit} condition except that the error handling in +the command loop handles it without breaking keyboard macro definition +or execution. + You can specify a character other than @kbd{C-g} to use for quitting. See the function @code{set-input-mode} in @ref{Input Modes}. @@ -3562,12 +3568,14 @@ Recursive Editing @code{recursive-edit}. This function contains the command loop; it also contains a call to @code{catch} with tag @code{exit}, which makes it possible to exit the recursive editing level by throwing to @code{exit} -(@pxref{Catch and Throw}). If you throw a value other than @code{t}, -then @code{recursive-edit} returns normally to the function that called -it. The command @kbd{C-M-c} (@code{exit-recursive-edit}) does this. +(@pxref{Catch and Throw}). If you throw a @code{nil} value, then +@code{recursive-edit} returns normally to the function that called it. +The command @kbd{C-M-c} (@code{exit-recursive-edit}) does this. Throwing a @code{t} value causes @code{recursive-edit} to quit, so that control returns to the command loop one level up. This is called @dfn{aborting}, and is done by @kbd{C-]} (@code{abort-recursive-edit}). +You can also throw a function value. In that case, +@code{recursive-edit} will call it without arguments before returning. Most applications should not use recursive editing, except as part of using the minibuffer. Usually it is more convenient for the user if you diff --git a/doc/lispref/errors.texi b/doc/lispref/errors.texi index fb393b951f..a45489db8e 100644 --- a/doc/lispref/errors.texi +++ b/doc/lispref/errors.texi @@ -20,8 +20,9 @@ Standard Errors we do not say here that a certain error symbol has additional error conditions, that means it has none. - As a special exception, the error symbol @code{quit} does not have the -condition @code{error}, because quitting is not considered an error. + As a special exception, the error symbols @code{quit} and +@code{lite-quit} don't have the condition @code{error}, because quitting +is not considered an error. Most of these error symbols are defined in C (mainly @file{data.c}), but some are defined in Lisp. For example, the file @file{userlock.el} @@ -40,6 +41,10 @@ Standard Errors @item quit The message is @samp{Quit}. @xref{Quitting}. +@item lite-quit +The message is @samp{Quit}. This is a subcategory of @code{quit}. +@xref{Quitting}. + @item args-out-of-range The message is @samp{Args out of range}. This happens when trying to access an element beyond the range of a sequence, buffer, or other diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index e04f1040b3..d1b88b0355 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -2318,6 +2318,15 @@ exit-minibuffer (setq deactivate-mark nil) (throw 'exit nil)) +(defun lite-quit-recursive-edit () + "Quit the command that requested this recursive edit wihtout error. +Like `abort-recursive-edit' wihtout aborting keyboard macro +execution." + ;; See Info node `(elisp)Recursive Editing' for an explanation of + ;; throwing a function to `exit'. + (throw 'exit (lambda () + (signal 'lite-quit nil)))) + (defun self-insert-and-exit () "Terminate minibuffer input." (interactive) diff --git a/lisp/simple.el b/lisp/simple.el index 2a90a07631..191c9d482d 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2854,8 +2854,10 @@ minibuffer-error-function The same as `command-error-default-function' but display error messages at the end of the minibuffer using `minibuffer-message' to not obscure the minibuffer contents." - (discard-input) - (ding) + (if (memq 'lite-quit (get (car data) 'error-conditions)) + (ding t) + (discard-input) + (ding)) (let ((string (error-message-string data))) ;; If we know from where the error was signaled, show it in ;; *Messages*. diff --git a/src/data.c b/src/data.c index d547f5da5e..315d43942c 100644 --- a/src/data.c +++ b/src/data.c @@ -3899,6 +3899,7 @@ syms_of_data (void) DEFSYM (Qerror, "error"); DEFSYM (Quser_error, "user-error"); DEFSYM (Qquit, "quit"); + DEFSYM (Qlite_quit, "lite-quit"); DEFSYM (Qwrong_length_argument, "wrong-length-argument"); DEFSYM (Qwrong_type_argument, "wrong-type-argument"); DEFSYM (Qargs_out_of_range, "args-out-of-range"); @@ -3971,6 +3972,7 @@ #define PUT_ERROR(sym, tail, msg) \ Fput (sym, Qerror_message, build_pure_c_string (msg)) PUT_ERROR (Qquit, Qnil, "Quit"); + PUT_ERROR (Qlite_quit, pure_cons (Qquit, Qnil), "Quit"); PUT_ERROR (Quser_error, error_tail, ""); PUT_ERROR (Qwrong_length_argument, error_tail, "Wrong length argument"); diff --git a/src/keyboard.c b/src/keyboard.c index 47b5e59024..10e1386023 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -725,6 +725,9 @@ recursive_edit_1 (void) if (STRINGP (val)) xsignal1 (Qerror, val); + if (FUNCTIONP (val)) + call0 (val); + return unbind_to (count, Qnil); } @@ -921,6 +924,7 @@ restore_kboard_configuration (int was_locked) cmd_error (Lisp_Object data) { Lisp_Object old_level, old_length; + Lisp_Object conditions; char macroerror[sizeof "After..kbd macro iterations: " + INT_STRLEN_BOUND (EMACS_INT)]; @@ -940,10 +944,15 @@ cmd_error (Lisp_Object data) else *macroerror = 0; + conditions = Fget (XCAR (data), Qerror_conditions); + if (NILP (Fmemq (Qlite_quit, conditions))) + { + Vexecuting_kbd_macro = Qnil; + executing_kbd_macro = Qnil; + } + Vstandard_output = Qt; Vstandard_input = Qt; - Vexecuting_kbd_macro = Qnil; - executing_kbd_macro = Qnil; kset_prefix_arg (current_kboard, Qnil); kset_last_prefix_arg (current_kboard, Qnil); cancel_echoing (); @@ -998,6 +1007,7 @@ DEFUN ("command-error-default-function", Fcommand_error_default_function, (Lisp_Object data, Lisp_Object context, Lisp_Object signal) { struct frame *sf = SELECTED_FRAME (); + Lisp_Object conditions; CHECK_STRING (context); @@ -1024,17 +1034,27 @@ DEFUN ("command-error-default-function", Fcommand_error_default_function, } else { + conditions = Fget (XCAR (data), Qerror_conditions); + clear_message (1, 0); - Fdiscard_input (); message_log_maybe_newline (); - bitch_at_user (); + + if (!NILP (Fmemq (Qlite_quit, conditions))) + { + Fding (Qt); + } + else + { + Fdiscard_input (); + bitch_at_user (); + } print_error_message (data, Qt, SSDATA (context), signal); } return Qnil; } -static Lisp_Object command_loop_2 (Lisp_Object); +static Lisp_Object command_loop_1 (void); static Lisp_Object top_level_1 (Lisp_Object); /* Entry to editor-command-loop. @@ -1062,7 +1082,7 @@ command_loop (void) if (command_loop_level > 0 || minibuf_level > 0) { Lisp_Object val; - val = internal_catch (Qexit, command_loop_2, Qnil); + val = internal_catch (Qexit, command_loop_2, Qerror); executing_kbd_macro = Qnil; return val; } @@ -1070,7 +1090,7 @@ command_loop (void) while (1) { internal_catch (Qtop_level, top_level_1, Qnil); - internal_catch (Qtop_level, command_loop_2, Qnil); + internal_catch (Qtop_level, command_loop_2, Qerror); executing_kbd_macro = Qnil; /* End of file in -batch run causes exit here. */ @@ -1083,15 +1103,16 @@ command_loop (void) editing loop, and reenter the editing loop. When there is an error, cmd_error runs and returns a non-nil value to us. A value of nil means that command_loop_1 itself - returned due to end of file (or end of kbd macro). */ + returned due to end of file (or end of kbd macro). HANDLERS is a + list of condition names, passed to internal_condition_case. */ -static Lisp_Object -command_loop_2 (Lisp_Object ignore) +Lisp_Object +command_loop_2 (Lisp_Object handlers) { register Lisp_Object val; do - val = internal_condition_case (command_loop_1, Qerror, cmd_error); + val = internal_condition_case (command_loop_1, handlers, cmd_error); while (!NILP (val)); return Qnil; @@ -1234,7 +1255,7 @@ some_mouse_moved (void) bool, bool, bool, bool); static void adjust_point_for_property (ptrdiff_t, bool); -Lisp_Object +static Lisp_Object command_loop_1 (void) { modiff_count prev_modiff = 0; diff --git a/src/lisp.h b/src/lisp.h index 91b7a89d0f..a30d7b861d 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -4417,7 +4417,7 @@ fast_string_match_ignore_case (Lisp_Object regexp, Lisp_Object string) extern bool detect_input_pending_run_timers (bool); extern void safe_run_hooks (Lisp_Object); extern void cmd_error_internal (Lisp_Object, const char *); -extern Lisp_Object command_loop_1 (void); +extern Lisp_Object command_loop_2 (Lisp_Object); extern Lisp_Object read_menu_command (void); extern Lisp_Object recursive_edit_1 (void); extern void record_auto_save (void); diff --git a/src/macros.c b/src/macros.c index 60d0766a75..53ad727a5b 100644 --- a/src/macros.c +++ b/src/macros.c @@ -324,7 +324,7 @@ DEFUN ("execute-kbd-macro", Fexecute_kbd_macro, Sexecute_kbd_macro, 1, 3, 0, break; } - command_loop_1 (); + command_loop_2 (list1 (Qlite_quit)); executing_kbd_macro_iterations = ++success_count; diff --git a/src/minibuf.c b/src/minibuf.c index cffb7fe787..9237cbe2b6 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -496,7 +496,7 @@ DEFUN ("abort-minibuffers", Fabort_minibuffers, Sabort_minibuffers, 0, 0, "", } } else - Fthrow (Qexit, Qt); + CALLN (Ffuncall, intern ("lite-quit-recursive-edit")); return Qnil; } -- 2.31.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue May 25 15:55:11 2021 Received: (at 48603) by debbugs.gnu.org; 25 May 2021 19:55:11 +0000 Received: from localhost ([127.0.0.1]:46949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lld8x-0000NQ-Hy for submit@debbugs.gnu.org; Tue, 25 May 2021 15:55:11 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49124) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lld8v-0000N8-2O for 48603@debbugs.gnu.org; Tue, 25 May 2021 15:55:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=LOjdOxdiyPE6cbsrDrLfmK7oqIs8zAjtwiNvt9aMqQo=; b=Ckfo01x9V2LUtNmBdshDFEkHFK ljHHTXDMXxlgehJHgpOjC3vgdbbu9zgw5PiRhN/8V4wepme8IF2LJqV7ssd3O6484IyuGCIiZdjlR 6gqCkUM08gJFl4ZRLRptklQEhEzy5MVkaRBalpGVGG1hxcgp5IsTliwrIgEc38l2rnyw=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lld8m-0004Y2-5N; Tue, 25 May 2021 21:55:02 +0200 From: Lars Ingebrigtsen To: miha@kamnitnik.top Subject: Re: bug#48603: 27.2; [PATCH] Quit minibuffers without aborting kmacros References: <86eedx7c0u.fsf@miha-pc> X-Now-Playing: Satomimagae's _awa_: "riki" Date: Tue, 25 May 2021 21:54:59 +0200 In-Reply-To: <86eedx7c0u.fsf@miha-pc> (miha@kamnitnik.top's message of "Sun, 23 May 2021 16:36:17 +0200") Message-ID: <877djmegh8.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: miha@kamnitnik.top writes: > Rationale: a user wants to copy a command from command history without > executing it. Or user wants to complete a file name in C-x C-f and copy > it without finding the file. I believe this should [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: miha@kamnitnik.top writes: > Rationale: a user wants to copy a command from command history without > executing it. Or user wants to complete a file name in C-x C-f and copy > it without finding the file. I believe this should [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [95.216.78.240 listed in list.dnswl.org] X-Debbugs-Envelope-To: 48603 Cc: 48603@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) miha@kamnitnik.top writes: > Rationale: a user wants to copy a command from command history without > executing it. Or user wants to complete a file name in C-x C-f and copy > it without finding the file. I believe this should be possible in > keyboard macros. `C-g' is part of how one normally operates `M-x' (etc.) in some circumstances, so it might make sense to have a special quit symbol for that; yes. Does anybody else have an opinion here? > * src/data.c (syms_of_data): New error symbol `lite-quit' But it should be called something more descriptive, like `minibuffer-quit'. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue May 25 17:28:56 2021 Received: (at 48603) by debbugs.gnu.org; 25 May 2021 21:28:56 +0000 Received: from localhost ([127.0.0.1]:47196 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llebf-0003EZ-AJ for submit@debbugs.gnu.org; Tue, 25 May 2021 17:28:56 -0400 Received: from kamnitnik.top ([209.250.245.214]:34882 helo=mail.kamnitnik.top) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llebb-0003EO-NH for 48603@debbugs.gnu.org; Tue, 25 May 2021 17:28:54 -0400 Received: from localhost (unknown [IPv6:2a00:ee2:e04:9300:b7eb:7ae7:cc56:e0da]) by mail.kamnitnik.top (Postfix) with ESMTPSA id 73ED3BBB83; Tue, 25 May 2021 21:28:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kamnitnik.top; s=mail; t=1621978129; bh=Gm+FNaS7eE3DR6NdgoeVxFu8YvgxgItdnMYiPIZFR/o=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=eXWaph0VD4Bw4wFlQetUd+cfE0zxi6wc/T+tRYO6qxTTio26BioZ9o9Y4IOW986oM y/mWo4zh/a3hRJASOavqldTjLTcJyK3cFnQFZ8V12YCl8ZdUhOd2TZOCRAmQbJlY8B nRNLPV4zLpwowpX099efo3MwXBMjnxvsA17skty0h1n59h38en0O3RZm++DyTXOLV6 VYAkGBpGf3hl+RZoSaLYb4RTYmKx0iU37noX/h9f/pFN/wpn1EOHgm9QEvfxUIhdo3 epb93Za+I81DVBMkJKUe5ZKs4vv6ItT5hbUJ/kF1bGB6HLW1TRrNmyEGRs215iGe3o 73U3wPhk708SA== From: To: Lars Ingebrigtsen Subject: Re: bug#48603: 27.2; [PATCH] Quit minibuffers without aborting kmacros In-Reply-To: <877djmegh8.fsf@gnus.org> References: <86eedx7c0u.fsf@miha-pc> <877djmegh8.fsf@gnus.org> Date: Tue, 25 May 2021 23:34:11 +0200 Message-ID: <86r1hu4hws.fsf@miha-pc> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Lars Ingebrigtsen writes: > miha@kamnitnik.top writes: > >> Rationale: a user wants to copy a command from command history without >> executing it. Or user wants to complete a file name in C-x C-f and copy >> it without findin [...] Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD X-Debbugs-Envelope-To: 48603 Cc: 48603@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Lars Ingebrigtsen writes: > miha@kamnitnik.top writes: > >> Rationale: a user wants to copy a command from command history without >> executing it. Or user wants to complete a file name in C-x C-f and copy >> it without findin [...] Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] 1.0 BULK_RE_SUSP_NTLD Precedence bulk and RE: from a suspicious TLD 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Lars Ingebrigtsen writes: > miha@kamnitnik.top writes: > >> Rationale: a user wants to copy a command from command history without >> executing it. Or user wants to complete a file name in C-x C-f and copy >> it without finding the file. I believe this should be possible in >> keyboard macros. > > `C-g' is part of how one normally operates `M-x' (etc.) in some > circumstances, so it might make sense to have a special quit symbol for > that; yes. > > Does anybody else have an opinion here? One alternative to a new quit error symbol would be to introduce a new variable `kmacro-dont-end-on-error'. One would then set it to non-nil before signaling a quit (or any error) and command loop would set it back to nil after handling the error without aborting kmacro definition. What do you think? >> * src/data.c (syms_of_data): New error symbol `lite-quit' > > But it should be called something more descriptive, like > `minibuffer-quit'. Good idea, attaching a revised patch (which also adds two NEWS entries.) --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Quit-minibuffers-without-aborting-kmacros.patch Content-Transfer-Encoding: quoted-printable From=20289f4d6cae45c6846d9ef4c245b1635056a2f288 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Miha=3D20Rihtar=3DC5=3DA1i=3DC4=3D8D?=3D Date: Sun, 23 May 2021 16:08:43 +0200 Subject: [PATCH] Quit minibuffers without aborting kmacros * src/data.c (syms_of_data): New error symbol `minibuffer-quit' * src/keyboard.c (recursive_edit_1): Implement throwing of function values to `exit`. In that case, the function will be called without arguments before returning from the command loop. (cmd_error): (Fcommand_error_default_function): Do not abort keyboard macro execution if minibuffer-quit is signaled. (command_loop_2): New argument HANDLERS. * src/macros.c (Fexecute_kbd_macro): Use command_loop_2 instead of command_loop_1. * doc/lispref/commands.texi (Quitting): Document `minibuffer-quit' (Recursive Editing): Document throwing of function values to `exit'. * doc/lispref/errors.texi (Standard Errors): Document `minibuffer-quit' * lisp/minibuffer.el (minibuffer-quit-recursive-edit): New function. * src/minibuf.c (Fabort_minibuffers): Use it. * lisp/simple.el (minibuffer-error-function): Do not abort keyboard macro execution if is minibuffer-quit is signaled. =2D-- doc/lispref/commands.texi | 14 +++++++++--- doc/lispref/errors.texi | 9 ++++++-- etc/NEWS | 9 ++++++++ lisp/minibuffer.el | 9 ++++++++ lisp/simple.el | 6 ++++-- src/data.c | 2 ++ src/keyboard.c | 45 ++++++++++++++++++++++++++++----------- src/lisp.h | 2 +- src/macros.c | 2 +- src/minibuf.c | 2 +- 10 files changed, 78 insertions(+), 22 deletions(-) diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 8199ece110..164e1ad630 100644 =2D-- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -3378,6 +3378,12 @@ Quitting in @ref{Errors}.) @end deffn =20 + To quit without aborting keyboard macro definition or execution, you +can signal the @code{minibuffer-quit} condition. This has almost the +same effect as the @code{quit} condition except that the error handling +in the command loop handles it without breaking keyboard macro +definition or execution. + You can specify a character other than @kbd{C-g} to use for quitting. See the function @code{set-input-mode} in @ref{Input Modes}. =20 @@ -3562,12 +3568,14 @@ Recursive Editing @code{recursive-edit}. This function contains the command loop; it also contains a call to @code{catch} with tag @code{exit}, which makes it possible to exit the recursive editing level by throwing to @code{exit} =2D(@pxref{Catch and Throw}). If you throw a value other than @code{t}, =2Dthen @code{recursive-edit} returns normally to the function that called =2Dit. The command @kbd{C-M-c} (@code{exit-recursive-edit}) does this. +(@pxref{Catch and Throw}). If you throw a @code{nil} value, then +@code{recursive-edit} returns normally to the function that called it. +The command @kbd{C-M-c} (@code{exit-recursive-edit}) does this. Throwing a @code{t} value causes @code{recursive-edit} to quit, so that control returns to the command loop one level up. This is called @dfn{aborting}, and is done by @kbd{C-]} (@code{abort-recursive-edit}). +You can also throw a function value. In that case, +@code{recursive-edit} will call it without arguments before returning. =20 Most applications should not use recursive editing, except as part of using the minibuffer. Usually it is more convenient for the user if you diff --git a/doc/lispref/errors.texi b/doc/lispref/errors.texi index fb393b951f..f848218e26 100644 =2D-- a/doc/lispref/errors.texi +++ b/doc/lispref/errors.texi @@ -20,8 +20,9 @@ Standard Errors we do not say here that a certain error symbol has additional error conditions, that means it has none. =20 =2D As a special exception, the error symbol @code{quit} does not have the =2Dcondition @code{error}, because quitting is not considered an error. + As a special exception, the error symbols @code{quit} and +@code{minibuffer-quit} don't have the condition @code{error}, because +quitting is not considered an error. =20 Most of these error symbols are defined in C (mainly @file{data.c}), but some are defined in Lisp. For example, the file @file{userlock.el} @@ -40,6 +41,10 @@ Standard Errors @item quit The message is @samp{Quit}. @xref{Quitting}. =20 +@item minibuffer-quit +The message is @samp{Quit}. This is a subcategory of @code{quit}. +@xref{Quitting}. + @item args-out-of-range The message is @samp{Args out of range}. This happens when trying to access an element beyond the range of a sequence, buffer, or other diff --git a/etc/NEWS b/etc/NEWS index ea74dfe217..1bfd87dcb7 100644 =2D-- a/etc/NEWS +++ b/etc/NEWS @@ -2705,6 +2705,15 @@ the Emacs Lisp reference manual for background. * Lisp Changes in Emacs 28.1 =20 ++++ +** A function can now be thrown to the 'exit' label in addition to t or ni= l. +The command loop will call it with zero arguments before returning. + ++++ +** New error symbol 'minibuffer-quit'. +Signaling it has almost the same effect as 'quit' except that it +doesn't cause keyboard macro termination. + --- ** Emacs now attempts to test for high-rate subprocess output more fairly. When several subprocesses produce output simultaneously at high rate, diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index ec21b7b93b..400dff058c 100644 =2D-- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -2318,6 +2318,15 @@ exit-minibuffer (setq deactivate-mark nil) (throw 'exit nil)) =20 +(defun minibuffer-quit-recursive-edit () + "Quit the command that requested this recursive edit wihtout error. +Like `abort-recursive-edit' wihtout aborting keyboard macro +execution." + ;; See Info node `(elisp)Recursive Editing' for an explanation of + ;; throwing a function to `exit'. + (throw 'exit (lambda () + (signal 'minibuffer-quit nil)))) + (defun self-insert-and-exit () "Terminate minibuffer input." (interactive) diff --git a/lisp/simple.el b/lisp/simple.el index 8849919360..4546bbde2a 100644 =2D-- a/lisp/simple.el +++ b/lisp/simple.el @@ -2855,8 +2855,10 @@ minibuffer-error-function The same as `command-error-default-function' but display error messages at the end of the minibuffer using `minibuffer-message' to not obscure the minibuffer contents." =2D (discard-input) =2D (ding) + (if (memq 'minibuffer-quit (get (car data) 'error-conditions)) + (ding t) + (discard-input) + (ding)) (let ((string (error-message-string data))) ;; If we know from where the error was signaled, show it in ;; *Messages*. diff --git a/src/data.c b/src/data.c index d547f5da5e..903d171d8b 100644 =2D-- a/src/data.c +++ b/src/data.c @@ -3899,6 +3899,7 @@ syms_of_data (void) DEFSYM (Qerror, "error"); DEFSYM (Quser_error, "user-error"); DEFSYM (Qquit, "quit"); + DEFSYM (Qminibuffer_quit, "minibuffer-quit"); DEFSYM (Qwrong_length_argument, "wrong-length-argument"); DEFSYM (Qwrong_type_argument, "wrong-type-argument"); DEFSYM (Qargs_out_of_range, "args-out-of-range"); @@ -3971,6 +3972,7 @@ #define PUT_ERROR(sym, tail, msg) \ Fput (sym, Qerror_message, build_pure_c_string (msg)) =20 PUT_ERROR (Qquit, Qnil, "Quit"); + PUT_ERROR (Qminibuffer_quit, pure_cons (Qquit, Qnil), "Quit"); =20 PUT_ERROR (Quser_error, error_tail, ""); PUT_ERROR (Qwrong_length_argument, error_tail, "Wrong length argument"); diff --git a/src/keyboard.c b/src/keyboard.c index 47b5e59024..0ac6d24b0a 100644 =2D-- a/src/keyboard.c +++ b/src/keyboard.c @@ -725,6 +725,9 @@ recursive_edit_1 (void) if (STRINGP (val)) xsignal1 (Qerror, val); =20 + if (FUNCTIONP (val)) + call0 (val); + return unbind_to (count, Qnil); } =20 @@ -921,6 +924,7 @@ restore_kboard_configuration (int was_locked) cmd_error (Lisp_Object data) { Lisp_Object old_level, old_length; + Lisp_Object conditions; char macroerror[sizeof "After..kbd macro iterations: " + INT_STRLEN_BOUND (EMACS_INT)]; =20 @@ -940,10 +944,15 @@ cmd_error (Lisp_Object data) else *macroerror =3D 0; =20 + conditions =3D Fget (XCAR (data), Qerror_conditions); + if (NILP (Fmemq (Qminibuffer_quit, conditions))) + { + Vexecuting_kbd_macro =3D Qnil; + executing_kbd_macro =3D Qnil; + } + Vstandard_output =3D Qt; Vstandard_input =3D Qt; =2D Vexecuting_kbd_macro =3D Qnil; =2D executing_kbd_macro =3D Qnil; kset_prefix_arg (current_kboard, Qnil); kset_last_prefix_arg (current_kboard, Qnil); cancel_echoing (); @@ -998,6 +1007,7 @@ DEFUN ("command-error-default-function", Fcommand_erro= r_default_function, (Lisp_Object data, Lisp_Object context, Lisp_Object signal) { struct frame *sf =3D SELECTED_FRAME (); + Lisp_Object conditions; =20 CHECK_STRING (context); =20 @@ -1024,17 +1034,27 @@ DEFUN ("command-error-default-function", Fcommand_e= rror_default_function, } else { + conditions =3D Fget (XCAR (data), Qerror_conditions); + clear_message (1, 0); =2D Fdiscard_input (); message_log_maybe_newline (); =2D bitch_at_user (); + + if (!NILP (Fmemq (Qminibuffer_quit, conditions))) + { + Fding (Qt); + } + else + { + Fdiscard_input (); + bitch_at_user (); + } =20 print_error_message (data, Qt, SSDATA (context), signal); } return Qnil; } =20 =2Dstatic Lisp_Object command_loop_2 (Lisp_Object); +static Lisp_Object command_loop_1 (void); static Lisp_Object top_level_1 (Lisp_Object); =20 /* Entry to editor-command-loop. @@ -1062,7 +1082,7 @@ command_loop (void) if (command_loop_level > 0 || minibuf_level > 0) { Lisp_Object val; =2D val =3D internal_catch (Qexit, command_loop_2, Qnil); + val =3D internal_catch (Qexit, command_loop_2, Qerror); executing_kbd_macro =3D Qnil; return val; } @@ -1070,7 +1090,7 @@ command_loop (void) while (1) { internal_catch (Qtop_level, top_level_1, Qnil); =2D internal_catch (Qtop_level, command_loop_2, Qnil); + internal_catch (Qtop_level, command_loop_2, Qerror); executing_kbd_macro =3D Qnil; =20 /* End of file in -batch run causes exit here. */ @@ -1083,15 +1103,16 @@ command_loop (void) editing loop, and reenter the editing loop. When there is an error, cmd_error runs and returns a non-nil value to us. A value of nil means that command_loop_1 itself =2D returned due to end of file (or end of kbd macro). */ + returned due to end of file (or end of kbd macro). HANDLERS is a + list of condition names, passed to internal_condition_case. */ =20 =2Dstatic Lisp_Object =2Dcommand_loop_2 (Lisp_Object ignore) +Lisp_Object +command_loop_2 (Lisp_Object handlers) { register Lisp_Object val; =20 do =2D val =3D internal_condition_case (command_loop_1, Qerror, cmd_error); + val =3D internal_condition_case (command_loop_1, handlers, cmd_error); while (!NILP (val)); =20 return Qnil; @@ -1234,7 +1255,7 @@ some_mouse_moved (void) bool, bool, bool, bool); static void adjust_point_for_property (ptrdiff_t, bool); =20 =2DLisp_Object +static Lisp_Object command_loop_1 (void) { modiff_count prev_modiff =3D 0; diff --git a/src/lisp.h b/src/lisp.h index 91b7a89d0f..a30d7b861d 100644 =2D-- a/src/lisp.h +++ b/src/lisp.h @@ -4417,7 +4417,7 @@ fast_string_match_ignore_case (Lisp_Object regexp, Li= sp_Object string) extern bool detect_input_pending_run_timers (bool); extern void safe_run_hooks (Lisp_Object); extern void cmd_error_internal (Lisp_Object, const char *); =2Dextern Lisp_Object command_loop_1 (void); +extern Lisp_Object command_loop_2 (Lisp_Object); extern Lisp_Object read_menu_command (void); extern Lisp_Object recursive_edit_1 (void); extern void record_auto_save (void); diff --git a/src/macros.c b/src/macros.c index 60d0766a75..0752a5bb6f 100644 =2D-- a/src/macros.c +++ b/src/macros.c @@ -324,7 +324,7 @@ DEFUN ("execute-kbd-macro", Fexecute_kbd_macro, Sexecut= e_kbd_macro, 1, 3, 0, break; } =20 =2D command_loop_1 (); + command_loop_2 (list1 (Qminibuffer_quit)); =20 executing_kbd_macro_iterations =3D ++success_count; =20 diff --git a/src/minibuf.c b/src/minibuf.c index cffb7fe787..9f4970320e 100644 =2D-- a/src/minibuf.c +++ b/src/minibuf.c @@ -496,7 +496,7 @@ DEFUN ("abort-minibuffers", Fabort_minibuffers, Sabort_= minibuffers, 0, 0, "", } } else =2D Fthrow (Qexit, Qt); + CALLN (Ffuncall, intern ("minibuffer-quit-recursive-edit")); return Qnil; } =20 =2D-=20 2.31.1 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCAAxFiEEmxVnesoT5rQXvVXnswkaGpIVmT8FAmCtbVMTHG1paGFAa2Ft bml0bmlrLnRvcAAKCRCzCRoakhWZP0QoEACz5ZagRhP39S7Wh2pkz/md7AgWNRvq +Zpzvt+KWZpp+NKfOc9qmORI9gIxiYfGVji71tm5H9idv43mH6a0sFDAC3neHLyc FUkBhJ9ul9i3eniMrym0U7sUohrScLWOLOt22O2grZtEsmhYFZ66aBchfPCrPmq8 cw9L9Stqfh83IuyMZ/4V0GDQdJAgcV3GqM3pGrnimsMrbfbY0WHNW4wp6LXLVXfY 6SUdnGf5H0MV1SiDSpnUk96iB8/KgR22WcnuNZiHAhejX+lZi7Ox72URgpnu286M 3ckjbSVskJmy/ftYO7T+zobGtNDfySi4lLeb0cNm25YwbmSP1s/UJWE35MWRkz1b NsKZNxzT4wQaqgSOfnS7a5q5jqbPnaTcFiKAvW8XbJMfVO4FzI0mkD6UXaaMN8g6 tydbgAlRrGT1HJ7fNjELKxCA0ttzYcu2U2C/YiPM7CJfZmtKMlhyaUjh4QBhI3wI MvSSimmGYrXiTt5JenG2H2C8gvE/kBnSbK10WXIiyg+eL6acDQToE5PzxpvaJBK6 +fEbvM49QBUs/edriGQVMP7RPtbjUpo5K2fk1ypr7AZV+GzrPhebVZT+J8KZOcY3 aoSI7fPRZBVdvEVNYMpAzRBlVWPW0/D2pvwIsxGTy+ffZMDEnrVpl2ELSQe18yYT LnEjnv11iiCPlA== =7aDF -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 20 08:37:55 2021 Received: (at 48603) by debbugs.gnu.org; 20 Jul 2021 12:37:55 +0000 Received: from localhost ([127.0.0.1]:33147 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5p0U-0001bu-OR for submit@debbugs.gnu.org; Tue, 20 Jul 2021 08:37:54 -0400 Received: from quimby.gnus.org ([95.216.78.240]:57066) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5p0T-0001be-05 for 48603@debbugs.gnu.org; Tue, 20 Jul 2021 08:37:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=3NB8wK6r0+Rr69GZASEZxH2PBfOJd9y8/rDrGYgwa6g=; b=UCYUjE5Pg1E1F7suAPRwwkeEt8 4Q2RC+smmIEXjdH978/Bow4dfnIuOQhF92HcZcY7uIbJIFM262F58uUNLkhqi3i8rFSCq+neY1Lru ZXu1ps9KGq6UI/AYYGFksE6ycRO8TQFdKfueR3ubsG/ldtYkSyWM2pGBPLhgE12k9SE8=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m5p0J-0003Cq-NI; Tue, 20 Jul 2021 14:37:46 +0200 From: Lars Ingebrigtsen To: Subject: Re: bug#48603: 27.2; [PATCH] Quit minibuffers without aborting kmacros References: <86eedx7c0u.fsf@miha-pc> <877djmegh8.fsf@gnus.org> <86r1hu4hws.fsf@miha-pc> X-Now-Playing: Pet Shop Boys's _Hotspot_: "You are the one" Date: Tue, 20 Jul 2021 14:37:42 +0200 In-Reply-To: <86r1hu4hws.fsf@miha-pc> (miha@kamnitnik.top's message of "Tue, 25 May 2021 23:34:11 +0200") Message-ID: <877dhlf9ex.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: 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. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -0.3 (/) X-Debbugs-Envelope-To: 48603 Cc: 48603@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) 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. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 20 08:37:58 2021 Received: (at control) by debbugs.gnu.org; 20 Jul 2021 12:37:58 +0000 Received: from localhost ([127.0.0.1]:33150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5p0Y-0001c9-0W for submit@debbugs.gnu.org; Tue, 20 Jul 2021 08:37:58 -0400 Received: from quimby.gnus.org ([95.216.78.240]:57080) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5p0W-0001bi-7O for control@debbugs.gnu.org; Tue, 20 Jul 2021 08:37:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=tNkvilc8uyQY7beoydO2P8JnSx+4WxpWfrKN8K/uQpU=; b=oZymipnbJHPPEy3DExomYBMnRp uuvnn1oZ10L0DjGk1ngtP3qF/oDbsquginoshQJ/diEECsurihaG0/8iQxHG6Gh3Pg6/uce/6QsYR T3XLzjA81W+mfKgBP3VG9xiWl2KdUv5YyJFivGn7zuRgeAUEVwAvISvcoT31Ici/KRng=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m5p0O-0003D0-Hg for control@debbugs.gnu.org; Tue, 20 Jul 2021 14:37:50 +0200 Date: Tue, 20 Jul 2021 14:37:48 +0200 Message-Id: <875yx5f9er.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #48603 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 48603 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 48603 28.1 quit From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 17 18:45:28 2021 Received: (at 48603) by debbugs.gnu.org; 17 Aug 2021 22:45:28 +0000 Received: from localhost ([127.0.0.1]:54389 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mG7po-00077y-A3 for submit@debbugs.gnu.org; Tue, 17 Aug 2021 18:45:28 -0400 Received: from mail-wm1-f52.google.com ([209.85.128.52]:43939) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mG7pk-00077i-As for 48603@debbugs.gnu.org; Tue, 17 Aug 2021 18:45:26 -0400 Received: by mail-wm1-f52.google.com with SMTP id k5-20020a05600c1c85b02902e699a4d20cso514832wms.2 for <48603@debbugs.gnu.org>; Tue, 17 Aug 2021 15:45:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=7gK0U4OeWUXJRgIwyZDXuUocarYlrxdcch6L1r5B7r4=; b=CUq1kOREwzMOEgz1/vt1nWUhQBO65zcIbj4XNW4SYcWr5zluLMCBQXWy02H37PS8K7 aTJxFwqJS33Y2+1G4WniF9Qk2ZTGxV9V6SnqLzgwHttDQ+tPog3kAqdma55MOgvsdm1v wSZVW/4IMInsO22crBFRwJ8G5tPy27hNNn5n15xF4mmfPCs8nrBbhfsTC629//wJMx+t FZElMPk0uS4r1HKeYXl++asCS9e8DJB7qi2MZRwwONMk+fE+YRGQZldeMuPQ3w7qy9e/ yazpEN7yeTvj5M3vVcdb0c1nPeVaDK44izBvYKHS34VAS+dJdL/YhDyxR8v+PN+3Mtlx fcDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=7gK0U4OeWUXJRgIwyZDXuUocarYlrxdcch6L1r5B7r4=; b=QVL0xjDioWtKfkIQ8O557l1CVjFVRc0FpaJRpNWIdQu5slfW4Ib0QSsvqqAXV1Rh/8 yj+GjCfeZeM200q6l2pI4b19hBEnzuV+LcCefZ+GdDSqWJzsMHhZQFbuikUeYbnEXrhv r/ROUQvHkuDQ3iWTVtdCzdvHO1yxZDktpJu9v9XaKN8MLSTgw19xqN766RO01vQVYBRM yMSdXS0fSSfaz1FQqd1/97jGEDCPnR7Gb0obr8qqVTdO2T8MTB03IPoTdKpYJpMOSTM1 HQm/c/taFeeYx7yGKrhgbSEmgvhBJIE7ln6HL3+/oeggKDJwMN7UbWxugVBJtnEw5+8r LeQw== X-Gm-Message-State: AOAM532zKPLPxUAysTBket626K82949/dpe+CsXlrwRvOjkjEsNjsrxr KeJirsB0sJatWgMVyAeOpoSoLQ== X-Google-Smtp-Source: ABdhPJyiTAEeR/I4x0KalvZgF0scdAez+3wyYILOzOp3MNmMucn1Qq+noBFrYEFAvpDP1uOITPIUUA== X-Received: by 2002:a1c:7419:: with SMTP id p25mr5364285wmc.160.1629240318403; Tue, 17 Aug 2021 15:45:18 -0700 (PDT) Received: from localhost ([2a02:8084:20e2:c380:d15:339e:aa10:60f1]) by smtp.gmail.com with ESMTPSA id y15sm3852297wrw.58.2021.08.17.15.45.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Aug 2021 15:45:17 -0700 (PDT) From: "Basil L. Contovounesios" To: Lars Ingebrigtsen Subject: Re: bug#48603: 27.2; [PATCH] Quit minibuffers without aborting kmacros References: <86eedx7c0u.fsf@miha-pc> <877djmegh8.fsf@gnus.org> <86r1hu4hws.fsf@miha-pc> <877dhlf9ex.fsf@gnus.org> Date: Tue, 17 Aug 2021 23:45:15 +0100 In-Reply-To: <877dhlf9ex.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 20 Jul 2021 14:37:42 +0200") Message-ID: <87czqbzo5g.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Lars Ingebrigtsen [2021-07-20 14:37 +0200] wrote: > 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 t [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.128.52 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.52 listed in wl.mailspike.net] 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Debbugs-Envelope-To: 48603 Cc: 48603@debbugs.gnu.org, miha@kamnitnik.top X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) --=-=-= Content-Type: text/plain Lars Ingebrigtsen [2021-07-20 14:37 +0200] wrote: > 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. Thanks, but given the following file quit.el, which is distilled from the Ivy package's batch-run test suite: --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline; filename=quit.el Content-Transfer-Encoding: quoted-printable ;; -*- lexical-binding: t -*- (defconst my-read "\C-ce") (local-set-key my-read (lambda () (interactive) (read-from-minibuffer ""))) (condition-case err (execute-kbd-macro (concat my-read "\C-g")) (t (print err))) --=-=-= Content-Type: text/plain the patch gives rise to the following change in behaviour. Before: $ emacs -Q -batch -l quit.el (quit) $ echo $? 0 After: $ emacs -Q -batch -l quit.el Quit $ echo $? 255 IOW, it's no longer possible to catch the quit around execute-kbd-macro. I tried wrapping it in (catch 'exit ...) as well, but to no avail. Surely it should always be possible to catch a quit condition from Lisp? Thanks, -- Basil --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 18 10:55:54 2021 Received: (at 48603) by debbugs.gnu.org; 18 Aug 2021 14:55:54 +0000 Received: from localhost ([127.0.0.1]:57224 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGMyw-0005H3-1s for submit@debbugs.gnu.org; Wed, 18 Aug 2021 10:55:54 -0400 Received: from quimby.gnus.org ([95.216.78.240]:39112) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGMyu-0005Go-1i for 48603@debbugs.gnu.org; Wed, 18 Aug 2021 10:55:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=+QViM14Ds1tsWu0i5cmsE36NFK6n227iGkSioWm86+4=; b=j357+imcnlc6/+4RocvSQn2m2z 0bpyaFdES9n6d5w0R2k7FwtBiZFy+T5OSlMXl9nLTib8Urkr0/mI/ts/FluAmj2fFvwSoKQbEHOCv Cul/DF0UAC1lIsEh80zoAOXyOJMwLRUF9pBc0jXZl5D/MW904Ak0nmLrp/a3PKbfNKp0=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mGMyi-000112-Uo; Wed, 18 Aug 2021 16:55:45 +0200 From: Lars Ingebrigtsen To: "Basil L. Contovounesios" Subject: Re: bug#48603: 27.2; [PATCH] Quit minibuffers without aborting kmacros References: <86eedx7c0u.fsf@miha-pc> <877djmegh8.fsf@gnus.org> <86r1hu4hws.fsf@miha-pc> <877dhlf9ex.fsf@gnus.org> <87czqbzo5g.fsf@tcd.ie> Date: Wed, 18 Aug 2021 16:55:40 +0200 In-Reply-To: <87czqbzo5g.fsf@tcd.ie> (Basil L. Contovounesios's message of "Tue, 17 Aug 2021 23:45:15 +0100") Message-ID: <87r1eqajkj.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: "Basil L. Contovounesios" writes: > Thanks, but given the following file quit.el, which is distilled from > the Ivy package's batch-run test suite: > > ;; -*- lexical-binding: t -*- > (defconst my-read "\C-ce") > (local-set-key my-rea [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48603 Cc: 48603@debbugs.gnu.org, miha@kamnitnik.top X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) "Basil L. Contovounesios" writes: > Thanks, but given the following file quit.el, which is distilled from > the Ivy package's batch-run test suite: > > ;; -*- lexical-binding: t -*- > (defconst my-read "\C-ce") > (local-set-key my-read (lambda () (interactive) (read-from-minibuffer ""))) > (condition-case err > (execute-kbd-macro (concat my-read "\C-g")) > (t (print err))) [...] > IOW, it's no longer possible to catch the quit around execute-kbd-macro. > I tried wrapping it in (catch 'exit ...) as well, but to no avail. > Surely it should always be possible to catch a quit condition from Lisp? Yup. Miha? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 01 02:55:15 2021 Received: (at 48603) by debbugs.gnu.org; 1 Sep 2021 06:55:15 +0000 Received: from localhost ([127.0.0.1]:35980 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLK9S-00029t-Vt for submit@debbugs.gnu.org; Wed, 01 Sep 2021 02:55:15 -0400 Received: from kamnitnik.top ([209.250.245.214]:56548 helo=mail.kamnitnik.top) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLK9O-00029e-Tg for 48603@debbugs.gnu.org; Wed, 01 Sep 2021 02:55:13 -0400 Received: from localhost (unknown [IPv6:2a00:ee2:e04:9300:e609:6c46:d026:8c47]) by mail.kamnitnik.top (Postfix) with ESMTPSA id 569D6BCF6B; Wed, 1 Sep 2021 06:55:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kamnitnik.top; s=mail; t=1630479308; bh=FJTBU/IOL8SbUXUo41iSCklJ5XptfNnZADlvjZA4Gvo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=mXieUL0zMCGUsta38Nf/pYqPAZPeKyFv+MbIoLp1MCp7H33t0GKB0aA4mYm2OGHEq ZKf3tbIEsvyCh9duV1VVbVJl4pk79DEJvsEgQD+sx2ygA7tUI/5365y2CyzS0h7VMH p1xbJtPEhKcYkxcs4zemx1iuKoyfGsGG0bBTo2uYKJOiScgGGAqvFw9NgNA4VfhmTC TJbxwYbirdKJkqIOqUNyErctdZNa6wHO9QmTwg7VMB4SIm12X3w0DPu/690K0Dp1BI acGygaCx8yuTjqTOOj/uorJW3OhgCWfHbj+TVbl39nbjlysCNWcRbKxEKkqIPZHGrl CoX0CzQiIpJbw== From: To: "Basil L. Contovounesios" , Lars Ingebrigtsen Subject: Re: bug#48603: 27.2; [PATCH] Quit minibuffers without aborting kmacros In-Reply-To: <87czqbzo5g.fsf@tcd.ie> References: <86eedx7c0u.fsf@miha-pc> <877djmegh8.fsf@gnus.org> <86r1hu4hws.fsf@miha-pc> <877dhlf9ex.fsf@gnus.org> <87czqbzo5g.fsf@tcd.ie> Date: Wed, 01 Sep 2021 08:58:04 +0200 Message-ID: <87o89cdbpf.fsf@miha-pc> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: "Basil L. Contovounesios" via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > Lars Ingebrigtsen [2021-07-20 14:37 +0200] wrote: > >> writes: >> >>> Good idea, attaching a revised patch (which also adds two NEWS entries.) >> >> Sorry; I forgot all about th [...] Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD X-Debbugs-Envelope-To: 48603 Cc: 48603@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: "Basil L. Contovounesios" via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > Lars Ingebrigtsen [2021-07-20 14:37 +0200] wrote: > >> writes: >> >>> Good idea, attaching a revised patch (which also adds two NEWS entries.) >> >> Sorry; I forgot all about th [...] Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD 1.0 BULK_RE_SUSP_NTLD Precedence bulk and RE: from a suspicious TLD -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain "Basil L. Contovounesios" via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > Lars Ingebrigtsen [2021-07-20 14:37 +0200] wrote: > >> 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. > > Thanks, but given the following file quit.el, which is distilled from > the Ivy package's batch-run test suite: > [...] > IOW, it's no longer possible to catch the quit around execute-kbd-macro. > I tried wrapping it in (catch 'exit ...) as well, but to no avail. > Surely it should always be possible to catch a quit condition from Lisp? > In order to make C-g from a minibuffer not abort kmacro execution, execute-kbd-macro was made to catch the minibuffer-quit condition, handle it with the default error handler (command-error-function) and continue with kmacro execution. In batch mode, this error handler kills Emacs with status 255. Please consider the attached patch, which avoids killing for the minibuffer-quit condition. However, even with this patch, slight change in behaviour still remains: - In Emacs 27, C-g in the minibuffer is bound to abort-recursive-edit which makes execute-kbd-macro signal an error (a quit). - In Emacs 28, C-g is bound to abort-minibuffers. This command will not make execute-kbd-macro signal any errors. I hope this change in default behaviour is acceptable, otherwise it wouldn't be possible to have C-g continue with kmacro execution. For test suites, you can get back the old behaviour with (define-key minibuffer-local-map "\C-g" #'abort-recursive-edit) Sorry for late reply, best regards. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-In-batch-mode-avoid-killing-Emacs-with-C-g-in-the-mi.patch Content-Transfer-Encoding: quoted-printable From=20dac1a0ccca5678dda4b331d1a788a8432c9a7a03 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Miha=3D20Rihtar=3DC5=3DA1i=3DC4=3D8D?=3D Date: Wed, 1 Sep 2021 08:32:25 +0200 Subject: [PATCH] In batch mode, avoid killing Emacs with C-g in the minibuf= fer * src/keyboard.c (Fcommand_error_default_function): Don't kill emacs when handling the minibuffer-quit condition (bug#48603). =2D-- src/keyboard.c | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/keyboard.c b/src/keyboard.c index 81ff9df153..6a8c33ae3b 100644 =2D-- a/src/keyboard.c +++ b/src/keyboard.c @@ -1009,25 +1009,28 @@ DEFUN ("command-error-default-function", Fcommand_e= rror_default_function, (Lisp_Object data, Lisp_Object context, Lisp_Object signal) { struct frame *sf =3D SELECTED_FRAME (); =2D Lisp_Object conditions; + Lisp_Object conditions =3D Fget (XCAR (data), Qerror_conditions); + int is_minibuffer_quit =3D !NILP (Fmemq (Qminibuffer_quit, conditions)); =20 CHECK_STRING (context); =20 /* If the window system or terminal frame hasn't been initialized =2D yet, or we're not interactive, write the message to stderr and exit= . */ =2D if (!sf->glyphs_initialized_p =2D /* The initial frame is a special non-displaying frame. It =2D will be current in daemon mode when there are no frames =2D to display, and in non-daemon mode before the real frame =2D has finished initializing. If an error is thrown in the =2D latter case while creating the frame, then the frame =2D will never be displayed, so the safest thing to do is =2D write to stderr and quit. In daemon mode, there are =2D many other potential errors that do not prevent frames =2D from being created, so continuing as normal is better in =2D that case. */ =2D || (!IS_DAEMON && FRAME_INITIAL_P (sf)) =2D || noninteractive) + yet, or we're not interactive, write the message to stderr and exit. + Don't do this for the minibuffer-quit condition. */ + if (!is_minibuffer_quit + && (!sf->glyphs_initialized_p + /* The initial frame is a special non-displaying frame. It + will be current in daemon mode when there are no frames + to display, and in non-daemon mode before the real frame + has finished initializing. If an error is thrown in the + latter case while creating the frame, then the frame + will never be displayed, so the safest thing to do is + write to stderr and quit. In daemon mode, there are + many other potential errors that do not prevent frames + from being created, so continuing as normal is better in + that case. */ + || (!IS_DAEMON && FRAME_INITIAL_P (sf)) + || noninteractive)) { print_error_message (data, Qexternal_debugging_output, SSDATA (context), signal); @@ -1036,12 +1039,10 @@ DEFUN ("command-error-default-function", Fcommand_e= rror_default_function, } else { =2D conditions =3D Fget (XCAR (data), Qerror_conditions); =2D clear_message (1, 0); message_log_maybe_newline (); =20 =2D if (!NILP (Fmemq (Qminibuffer_quit, conditions))) + if (is_minibuffer_quit) { Fding (Qt); } =2D-=20 2.32.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCAAxFiEEmxVnesoT5rQXvVXnswkaGpIVmT8FAmEvJHwTHG1paGFAa2Ft bml0bmlrLnRvcAAKCRCzCRoakhWZP5cDEACwU1+7dNdOwPII8AGFRq0BjlosYItc 8Zzkv2Q/CUUqUKCLI7dUO6pjjrYXdtLBa7OlTGQt8n6MJbX+TRPfXWAR7cY3CX+m egwG0JKK4ZFBUm6ferkzDxZxY0kWAhVX2w8K1jq3zziBO6HLIWevswJ/6DgAGRqn NFIWuBSdR3S7tLH5PlUgn5oJwkYW15tMbIqgcFXbQIro8qOGbI+qVuFfEEFPj2TK CGUfyvdjR+5J45bvfZ1aqlSOl0A8hA9SOitxrnMPHxGR4m66j7Uaka8XKH7F3oqV BsLtgGEntiOmzLPNxX4pu/aduDcemXRuC6tjEpmEWrW4gFk3F3YNYJKFbb4/VF23 tHKa3PhIDP2glRo7sd2aUiSez+ybk29clComVTH2No7vKS3DZM1YjJs0wiV2fste oJAMB97GpsrU//wzm+c6Pu7OX2WhqRi1zYx7OmO2I/rloha7BKdmgQi79kfNOYxS wZwAPucP75OVwgbFOeockCJV4AVfzvgnnk4luMKvdIdPHhOuYaKGdjd71TIoH7Kg WySgA9FsRtgGJcayez69VF3zZXRQqS/kbwBaPGXPt65aM60QCwkjNYq+zKnwEpcK cLjrh8zxEdYHPfxBCSyN3a5QGpszY6LiOWvXDaNaxck47yIhogPfd5kPKwUrNU25 QRADHpKvaBcXvg== =kgxU -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 01 04:11:29 2021 Received: (at 48603) by debbugs.gnu.org; 1 Sep 2021 08:11:29 +0000 Received: from localhost ([127.0.0.1]:36163 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLLLB-0008Pi-5Y for submit@debbugs.gnu.org; Wed, 01 Sep 2021 04:11:29 -0400 Received: from quimby.gnus.org ([95.216.78.240]:57238) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLLL6-0008PQ-7O for 48603@debbugs.gnu.org; Wed, 01 Sep 2021 04:11:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ZR8b95W0DcoD6y4hcX0azlblycx+6RGxPIWo014hO3E=; b=scdxAkw6SLE8INDvDN+P3AHunD A5Uck5vXJvQ13YKAO7nKZ+J1vtLz4tq1Z8+TJDjG2h6Ce7lKI5MxJwQho/m0awNffbzyyD+zef5p1 3eo80sfRkp/Znt/PSUbg3ZJW4Ns2KB57WlS/pluyhZ9nYiIXU7p1jd45T4kHdj2yv4XE=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLLKu-0000iC-VS; Wed, 01 Sep 2021 10:11:13 +0200 From: Lars Ingebrigtsen To: Subject: Re: bug#48603: 27.2; [PATCH] Quit minibuffers without aborting kmacros References: <86eedx7c0u.fsf@miha-pc> <877djmegh8.fsf@gnus.org> <86r1hu4hws.fsf@miha-pc> <877dhlf9ex.fsf@gnus.org> <87czqbzo5g.fsf@tcd.ie> <87o89cdbpf.fsf@miha-pc> Date: Wed, 01 Sep 2021 10:11:08 +0200 In-Reply-To: <87o89cdbpf.fsf@miha-pc> (miha@kamnitnik.top's message of "Wed, 01 Sep 2021 08:58:04 +0200") Message-ID: <87ilzkhg0z.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: writes: > * src/keyboard.c (Fcommand_error_default_function): Don't kill emacs > when handling the minibuffer-quit condition (bug#48603). Thanks; looks good to me, so I've now pushed it to Emacs 28. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -0.3 (/) X-Debbugs-Envelope-To: 48603 Cc: "Basil L. Contovounesios" , 48603@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) writes: > * src/keyboard.c (Fcommand_error_default_function): Don't kill emacs > when handling the minibuffer-quit condition (bug#48603). Thanks; looks good to me, so I've now pushed it to Emacs 28. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 03 13:53:30 2021 Received: (at 48603) by debbugs.gnu.org; 3 Sep 2021 17:53:30 +0000 Received: from localhost ([127.0.0.1]:45884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMDNa-0004dt-8P for submit@debbugs.gnu.org; Fri, 03 Sep 2021 13:53:30 -0400 Received: from mail-wr1-f43.google.com ([209.85.221.43]:44602) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMDNX-0004dg-Ia for 48603@debbugs.gnu.org; Fri, 03 Sep 2021 13:53:28 -0400 Received: by mail-wr1-f43.google.com with SMTP id g18so9284382wrc.11 for <48603@debbugs.gnu.org>; Fri, 03 Sep 2021 10:53:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=gHlesvFYSDq/wrbZ3yhy5DorolA/NsuFyCQo9rldLYk=; b=WO5uj+BY+XX3eyDRL9yaJNRMTuIYQYrMO9nW1uCHsssX+drgmtT3t0aJOQCSW7+0pZ cgljOMDegpMT9yeHlDm9PAJXFmA6kCfaff9MCt6JNg1yZ4fI0+N+qWBWHixDqoJXd4PH O97RdBOMtLGjj8a2+wkMQVUFbI/53rmhUia2oYQsMn/QaSnJTX80uGG5HgVTG+smV4oC ZmqGCeHNUs+1lIKmOaya60btnNMvsP5U7TXdys5mIE14y00avEDRyADJoDAFWzzwr9F9 hGg8PfUeZ0BHTj67EnuTNOqURZ3lDz3BJkryBK5IMh6GijaUZyYz287h3CWbjChGCChZ +H2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=gHlesvFYSDq/wrbZ3yhy5DorolA/NsuFyCQo9rldLYk=; b=HnROWECZSX1J8AVLNIyd9OD9PF/JSPc5bTZw7HDkplbVbbdPMmyNIpOs2gJVHn6B/g iGpEmLUAV6h4Iv7CnKPngBPahDCeH19Xn3OLV3R+QYXFN97p8rixjeW3CXaIYxJVkKko 4HaARqkjw092+KDG7UxyCTMjY92X2ebdkjLEbqDVA3GWgifSmgonixkXzGT1sz0pVhqp pMjldcRxI0IX722fpI3F9Qk4Bjkk1qhUdbJ6RW2X36uQAmmZgFEYBRBQwFEwJJl9+ayb XKJhFLO8CxZIBbYA1POTVPdLu76KrpZcoyMMe88RpPze2zw6zuQIr0VsitJq6H6No68a HHXQ== X-Gm-Message-State: AOAM531bOgK+eT3u3lEvgBuzlcczpwJ6KxluO9DILVXR21dLBeI3vMaG dNYhz/WtxzN8ZZLytzWD778ywQ== X-Google-Smtp-Source: ABdhPJxNzIH5d/AhGAZUKb7ngm86BOulGf/XvB6+wLEebnSpEItFTP90Ksrz+WokeV64KnjgIwD4lQ== X-Received: by 2002:adf:e509:: with SMTP id j9mr306164wrm.320.1630691601556; Fri, 03 Sep 2021 10:53:21 -0700 (PDT) Received: from localhost ([80.233.50.111]) by smtp.gmail.com with ESMTPSA id v28sm5309379wrv.93.2021.09.03.10.53.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Sep 2021 10:53:20 -0700 (PDT) From: "Basil L. Contovounesios" To: Subject: Re: bug#48603: 27.2; [PATCH] Quit minibuffers without aborting kmacros References: <86eedx7c0u.fsf@miha-pc> <877djmegh8.fsf@gnus.org> <86r1hu4hws.fsf@miha-pc> <877dhlf9ex.fsf@gnus.org> <87czqbzo5g.fsf@tcd.ie> <87o89cdbpf.fsf@miha-pc> Date: Fri, 03 Sep 2021 18:53:18 +0100 In-Reply-To: <87o89cdbpf.fsf@miha-pc> (miha@kamnitnik.top's message of "Wed, 01 Sep 2021 08:58:04 +0200") Message-ID: <87tuj1im0h.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: miha@kamnitnik.top [2021-09-01 08:58 +0200] wrote: > However, even with this patch, slight change in behaviour still remains: > - In Emacs 27, C-g in the minibuffer is bound to abort-recursive-edit > which makes execute-kbd-macro signal an error (a qu [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.221.43 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.221.43 listed in list.dnswl.org] X-Debbugs-Envelope-To: 48603 Cc: Lars Ingebrigtsen , 48603@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) miha@kamnitnik.top [2021-09-01 08:58 +0200] wrote: > However, even with this patch, slight change in behaviour still remains: > - In Emacs 27, C-g in the minibuffer is bound to abort-recursive-edit > which makes execute-kbd-macro signal an error (a quit). > - In Emacs 28, C-g is bound to abort-minibuffers. This command will not > make execute-kbd-macro signal any errors. > I hope this change in default behaviour is acceptable, otherwise it > wouldn't be possible to have C-g continue with kmacro execution. For > test suites, you can get back the old behaviour with > > (define-key minibuffer-local-map "\C-g" #'abort-recursive-edit) Thanks, that WFM. > Sorry for late reply, No worries, and thanks again, -- Basil From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 07 11:08:11 2021 Received: (at 48603) by debbugs.gnu.org; 7 Sep 2021 15:08:11 +0000 Received: from localhost ([127.0.0.1]:57327 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNchm-0006N5-S9 for submit@debbugs.gnu.org; Tue, 07 Sep 2021 11:08:11 -0400 Received: from kamnitnik.top ([209.250.245.214]:39946 helo=mail.kamnitnik.top) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNchl-0006Mw-4q for 48603@debbugs.gnu.org; Tue, 07 Sep 2021 11:08:09 -0400 Received: from localhost (unknown [IPv6:2a00:ee2:e04:9300:e18:5d33:4bd1:d3a4]) by mail.kamnitnik.top (Postfix) with ESMTPSA id A79BCBCF6B; Tue, 7 Sep 2021 15:08:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kamnitnik.top; s=mail; t=1631027287; bh=O0wWKBpdmErwOY+5FSN+j42lpsw+D97CIewy0wTo7Sk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=RqX9kDOzzF5wALWq79lDHs3EaJKin7kh5PmGZPW4UhMUQepWt2oon5YLlMXi89mo8 J6xzI03HtCGTN/lqqno6UeDGoFCH88UBlS26mzm/F1XcGb+/bVzJWbVL9LU8MxsvHr RKFpG7JjoEuM2XbNmqFemVm9DgvfCfnlWqV7clH62M/sUMURLZkAyPH4eDb2we2eEP FBlWB/KS46eyoLor9EmiJJlvPdU3Ivv+deFLdgKMUWFZxQPepxxG1T7yAEb/mbMvLJ FYAGSWrevOrzou7j1G3f1aKg4hz3f9cpvWU/X2o4IVjwdYGZEs8leuu7hevAGmjSh/ fxGoXbM78tKgA== From: To: Lars Ingebrigtsen Subject: Re: bug#48603: 27.2; [PATCH] Quit minibuffers without aborting kmacros In-Reply-To: <877dhlf9ex.fsf@gnus.org> References: <86eedx7c0u.fsf@miha-pc> <877djmegh8.fsf@gnus.org> <86r1hu4hws.fsf@miha-pc> <877dhlf9ex.fsf@gnus.org> Date: Tue, 07 Sep 2021 17:11:11 +0200 Message-ID: <875yvcl8ts.fsf@miha-pc> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Lars Ingebrigtsen writes: > 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 t [...] Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD X-Debbugs-Envelope-To: 48603 Cc: 48603@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Lars Ingebrigtsen writes: > 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 t [...] Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: kamnitnik.top (top)] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD 1.0 BULK_RE_SUSP_NTLD Precedence bulk and RE: from a suspicious TLD -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Lars Ingebrigtsen writes: > 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. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Allow-kmacros-to-end-with-C-g-in-minibuffer.patch Content-Transfer-Encoding: quoted-printable From=201fc801cde2cd0a7c557fdb3d4e1593eaa85518f8 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Miha=3D20Rihtar=3DC5=3DA1i=3DC4=3D8D?=3D 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. =2D-- src/keyboard.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/keyboard.c b/src/keyboard.c index f6139b30e7..a32c3e7b2b 100644 =2D-- a/src/keyboard.c +++ b/src/keyboard.c @@ -951,6 +951,10 @@ cmd_error (Lisp_Object data) Vexecuting_kbd_macro =3D Qnil; executing_kbd_macro =3D 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 (); =20 specbind (Qstandard_output, Qt); specbind (Qstandard_input, Qt); =2D-=20 2.33.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCAAxFiEEmxVnesoT5rQXvVXnswkaGpIVmT8FAmE3gQ8THG1paGFAa2Ft bml0bmlrLnRvcAAKCRCzCRoakhWZP7z3D/9L/spW6bdChI/pYlZQbbJZ46nkp4TL aniJZg1tjI5Gp4H7dqaa33UsjsFqJfDasl7yFvj7Do9CbdhM3Chiw8S3lYTdmI1u 6PQTOxCqnACxiJBs6zzBXxdDb0Cw40RJDvWebBSd+9GX2M8LYQQCm8DU2NzjrFYh dM6qaY7EUauN1uPBdGKrQvi8PTONEkGmBh7Gm/wozc7/75wUEf1G/cMr6ESMQTNu 2Nggh7fdArssd79yobDXKXC9e35I7scCCkPev3QDgYhGb59hJotCbMUMDNm0ULq2 qkIXTVHvhgYzY2Z9qkGN9sgrNFFjII1DeswmPL72bPf/VbGkyUnLkgFVeM5ktTr5 bT8p3EjdfWAV+B3NYARjCSzo0dN8dC/ShMvonMAVkpbHHGSenWMUpLrn5MrqXCQ+ z0+pDhK74F3yPYz4PTk8LLTfhTzXm2EfpUJ5H29gIK8QmWnohWcTvz4dY7n5EAoT N6LvH+JN1cqVELmWmOgQrb4nKHvYVCLJUCq4qNFYahhgNRaXi9qS1/P/krmE3YmQ IherfUsb6a0t7Cqkd+2N/oAi4szRHr/lprGX3oEiSXsQ4AN5zPC9mFkB8MPPNoFf AA+9vQlGG7M1qBg8UydR/R87eiA0QWOQOrSzDXa/p8bKKvVHhioM0PMH9ldONN3N arfzaYBghrs2PA== =70bo -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 08 03:41:09 2021 Received: (at 48603) by debbugs.gnu.org; 8 Sep 2021 07:41:09 +0000 Received: from localhost ([127.0.0.1]:58438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNsCj-0001QD-3K for submit@debbugs.gnu.org; Wed, 08 Sep 2021 03:41:09 -0400 Received: from quimby.gnus.org ([95.216.78.240]:56600) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNsCh-0001Pw-Fy for 48603@debbugs.gnu.org; Wed, 08 Sep 2021 03:41:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=iWYHlJebQtgVo+Mdgo0r5esRDlxEZ1EcKiM/qCFpguA=; b=Ujts0E/zMXHOJqh2O0Q9caoivU nkWWQXet3WyqaUuVxQh/6kF3msZXLW37wzQKRyl0DsBwvzcYZFlFBOYmq6RNXvSEooieEivqjGWtU +V6BRLDTfjdO/D362wI4v3Hv1jmGho0idPo/Ci1o3Ys9nU4PgYTqDp1sOMim39sEXVh4=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mNsCY-0000EE-Dy; Wed, 08 Sep 2021 09:41:00 +0200 From: Lars Ingebrigtsen To: Subject: Re: bug#48603: 27.2; [PATCH] Quit minibuffers without aborting kmacros References: <86eedx7c0u.fsf@miha-pc> <877djmegh8.fsf@gnus.org> <86r1hu4hws.fsf@miha-pc> <877dhlf9ex.fsf@gnus.org> <875yvcl8ts.fsf@miha-pc> Date: Wed, 08 Sep 2021 09:40:57 +0200 In-Reply-To: <875yvcl8ts.fsf@miha-pc> (miha@kamnitnik.top's message of "Tue, 07 Sep 2021 17:11:11 +0200") Message-ID: <87h7ev5xbq.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: writes: > 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". > > P [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -0.3 (/) X-Debbugs-Envelope-To: 48603 Cc: 48603@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) writes: > 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. Thanks; seems to work fine when testing, and doesn't seem to lead to any obvious regressions, so I've pushed it to Emacs 28. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sun Sep 07 01:43:39 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 06 Oct 2021 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator