From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Morgon Kanter Newsgroups: gmane.emacs.bugs Subject: bug#66998: 29.1; Regression for recursive keyboard macros + minibuffers in (I think) Emacs 28 Date: Thu, 9 Nov 2023 13:41:26 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33070"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eliz@gnu.org, 66998@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 09 19:55:44 2023 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 1r1ABs-0008Rm-ME for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 Nov 2023 19:55:44 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r1ABX-0000vT-N3; Thu, 09 Nov 2023 13:55:23 -0500 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 1r1ABW-0000vF-UI for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2023 13:55:22 -0500 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 1r1ABW-0006Rd-MA for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2023 13:55:22 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r1AC9-0005LL-PN for bug-gnu-emacs@gnu.org; Thu, 09 Nov 2023 13:56:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Morgon Kanter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Nov 2023 18:56:01 +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.169955613720498 (code B ref 66998); Thu, 09 Nov 2023 18:56:01 +0000 Original-Received: (at 66998) by debbugs.gnu.org; 9 Nov 2023 18:55:37 +0000 Original-Received: from localhost ([127.0.0.1]:48742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1ABk-0005KY-Jq for submit@debbugs.gnu.org; Thu, 09 Nov 2023 13:55:37 -0500 Original-Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:45379) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r19yx-0004te-4s for 66998@debbugs.gnu.org; Thu, 09 Nov 2023 13:42:25 -0500 Original-Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-5b99bfca064so930134a12.3 for <66998@debbugs.gnu.org>; Thu, 09 Nov 2023 10:41:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699555298; x=1700160098; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ZTgR9D7ML9dz19Lu4DfzaYd/RigEb4s9WQHXd8oZMZk=; b=mZ/Jd3zlVIfoeb+w4PX6b0fBxVu/sqoc6jtjIquQOc5/rogOzWGWdi2oC+yqgZRhvs qMwuG40gtjbGMd1MkKpV2yIR1BOsOHVZqmUZxkvb/RmzrThH3vXdww5XxLoX/eTBqFPN dcEdqRo6huPHTfh7P3HeHHGYtV2okIBPRnWxTymTZuUEvbDvWUD3SQqXW/MqNGebuyEZ uToOAKo8rr1/mK9K6V/d+simcq9jcFkM5zTK1ZrRgIgOFRzJU5ZNIpTVSY8iWRI5njAI PZm0T3e2R8UWorFId1OLNHLLsopJImQJVQ+VV0TLKRfrmIH2PF4AcEJ9/FpBYHlCr5Mt ipAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699555298; x=1700160098; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZTgR9D7ML9dz19Lu4DfzaYd/RigEb4s9WQHXd8oZMZk=; b=tA6/K8EvzBQdDLkFhU4+nup3UPd+A+j/FuudKWHkYH2SZGa2R8h5doQRTDVBS978yu RiHuqmqzSucC6dK0gfHu0+A2WR3mipNKhBL3GCJlTC8iKL5ZzLmbpjBKgWj5gnPyqxk3 5LV49dIFfgC436I6xnMkMITBE39n1H+JOUfVVUmDjtfdkzaudmuTvbrjvLnSP4xP2LF9 GaFUkEydg14M4Si27LAGMh+x+tNcRl6yMDwE8oJksYnWXukgEUMVwqcd6VeJp0l/gf1e tJk/QFX0brCrXsb3sUZWij//dTKX2l6NLVxrUDnOB6Ta8x/pBw9qzDPOS3gD8O+eYuv6 Mojw== X-Gm-Message-State: AOJu0Yxz42Spm/MdCPGBh5/Tz+rgxM0bO1rYfl0+7Gxu2ZhpbQRELZjC uQta0RIBRVSiBIhN+4CC4VL+lJQpu4GIV7Is X-Google-Smtp-Source: AGHT+IGsNReWpxsBSe//xDHgZ+BygPBiuGy5j62YaO9oewnxqE6OPCVclvY+mMvi6U0RPqMEFqXPjLGfNlOBWCJcv8o= X-Received: by 2002:a17:90b:1b0b:b0:280:a464:e9d4 with SMTP id nu11-20020a17090b1b0b00b00280a464e9d4mr2527928pjb.8.1699555297835; Thu, 09 Nov 2023 10:41:37 -0800 (PST) In-Reply-To: X-Mailman-Approved-At: Thu, 09 Nov 2023 13:55:34 -0500 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:274068 Archived-At: 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. > 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.