From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#66998: 29.1; Regression for recursive keyboard macros + minibuffers in (I think) Emacs 28 Date: Fri, 31 May 2024 10:16:37 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38867"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, eliz@gnu.org, 66998@debbugs.gnu.org To: control@debbugs.gnu.org, Morgon Kanter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 31 12:17:22 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sCzK5-0009uU-LU for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 31 May 2024 12:17:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCzJd-0007dr-T7; Fri, 31 May 2024 06:16:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCzJc-0007co-48 for bug-gnu-emacs@gnu.org; Fri, 31 May 2024 06:16:52 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sCzJb-0000O1-Rx for bug-gnu-emacs@gnu.org; Fri, 31 May 2024 06:16:51 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sCzJm-0004o2-A9 for bug-gnu-emacs@gnu.org; Fri, 31 May 2024 06:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 31 May 2024 10:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66998 X-GNU-PR-Package: emacs Original-Received: via spool by 66998-submit@debbugs.gnu.org id=B66998.171715062018456 (code B ref 66998); Fri, 31 May 2024 10:17:02 +0000 Original-Received: (at 66998) by debbugs.gnu.org; 31 May 2024 10:17:00 +0000 Original-Received: from localhost ([127.0.0.1]:53270 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCzJj-0004nb-J7 for submit@debbugs.gnu.org; Fri, 31 May 2024 06:16:59 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:23940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCzJf-0004nE-OX for 66998@debbugs.gnu.org; Fri, 31 May 2024 06:16:58 -0400 Original-Received: (qmail 51262 invoked by uid 3782); 31 May 2024 12:16:38 +0200 Original-Received: from muc.de (p4fe154df.dip0.t-ipconnect.de [79.225.84.223]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 31 May 2024 12:16:37 +0200 Original-Received: (qmail 8265 invoked by uid 1000); 31 May 2024 10:16:37 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:286270 Archived-At: tag 66998 + notabug close 66998 quit Hello, Morgon. Sorry, I didn't get around to resolving this back in November. So .... On Thu, Nov 09, 2023 at 13:41:26 -0500, Morgon Kanter wrote: > Hi Alan, > tl;dr: you're right, not a bug, just user error :-) > Trying this one more time, I rediscovered how to turn on "plain text > mode". So I hope this one doesn't get garbled HTML. > First, this was the original code that got garbled. It should be > visible in the mailing list archive in a web browser. Pasted again > here: > > (defun config:macro-query (arg) > > "Prompt for input using minibuffer during kbd macro execution. > > With prefix argument, allows you to select what prompt string to use. > > If the input is non-empty, it is inserted at point." > > (interactive "P") > > (let* ((prompt (if arg (read-from-minibuffer "PROMPT: ") "Input: ")) > > (input (minibuffer-with-setup-hook (lambda () (kbd-macro-query t)) > > (read-from-minibuffer prompt)))) > Your intuition was totally right. This isn't really a bug, and > probably not a regression in behavior either. Use of C-M-c to exit the > recursive edit before the minibuffer works as expected. The only > "problem" is that you need to press C-M-c to terminate the minibuffer, > rather than RET. That's a bit awkward and weird, but it's livable. I > could probably temporarily rebind RET to make it more ergonomic. But > the truth is that from Emacs's perspective this isn't even something > that *should* be fixed -- you *should* be exiting the recursive edit > before you exit the minibuffer, in that order! > So this, at least, is WAI and this bug should be closed. I'm closing the bug as "not a bug" with this post. Thanks for taking the trouble to report it! > > So I think the error message "Not in most nested command loop" is > > correct, even if its not very clear in this context. > > What are you actually trying to achieve in your real Lisp code with this > > recursive edit? At first acquaintance, it looks rather unusual. > What I am trying to achieve is the ability to prompt the user as part > of a keyboard macro, and receive input which the macro will then do > something with. Importantly, this input could be different every time > the keyboard macro is run. Ordinarily if you were to prompt the user > for input, all those actions would be considered part of the keyboard > macro and simply re-run every time. So you need to invoke the > recursive edit to make it work. -- Alan Mackenzie (Nuremberg, Germany).