From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Eli Zaretskii <eliz@gnu.org>
Newsgroups: gmane.emacs.bugs
Subject: bug#69056: 30.0.50; history-add-new-input and recursive minibuffers
Date: Sun, 11 Feb 2024 18:47:13 +0200
Message-ID: <86il2vrlri.fsf@gnu.org>
References: <m11q9jngho.fsf@dazzs-mbp.home>
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="36694"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: 69056@debbugs.gnu.org
To: Eshel Yaron <me@eshelyaron.com>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 11 17:48:11 2024
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
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 <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1rZCzz-0009M1-Ko
	for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 11 Feb 2024 17:48:11 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces@gnu.org>)
	id 1rZCzc-0001WL-2f; Sun, 11 Feb 2024 11:47:48 -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 <Debian-debbugs@debbugs.gnu.org>)
 id 1rZCza-0001WB-GO
 for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2024 11:47:46 -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 <Debian-debbugs@debbugs.gnu.org>)
 id 1rZCza-0005Ff-8A
 for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2024 11:47:46 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1rZCzq-0007E0-GE
 for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2024 11:48:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Eli Zaretskii <eliz@gnu.org>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Sun, 11 Feb 2024 16:48:02 +0000
Resent-Message-ID: <handler.69056.B69056.170767006227723@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 69056
X-GNU-PR-Package: emacs
Original-Received: via spool by 69056-submit@debbugs.gnu.org id=B69056.170767006227723
 (code B ref 69056); Sun, 11 Feb 2024 16:48:02 +0000
Original-Received: (at 69056) by debbugs.gnu.org; 11 Feb 2024 16:47:42 +0000
Original-Received: from localhost ([127.0.0.1]:59484 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1rZCzW-0007D3-46
 for submit@debbugs.gnu.org; Sun, 11 Feb 2024 11:47:42 -0500
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43482)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@gnu.org>) id 1rZCzS-0007Ci-U6
 for 69056@debbugs.gnu.org; Sun, 11 Feb 2024 11:47:39 -0500
Original-Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@gnu.org>)
 id 1rZCz7-0005Bj-5v; Sun, 11 Feb 2024 11:47:17 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=vLp6EONXvpZizCA41i98JJYfrdzD2XVJfF/NVIi0uKc=; b=XO6FHIVjbtT1
 TubXytyNo465ZEMzIHlcgP96IoJHW/L1xWNIvKKvwmqQjrGILjI1AsgIxitilHTFpHIGs8lcj9QeV
 u8w0w42K8phPMo3fXr374kalVCNbFV7WdX5BXGAiusG4A8+Vh7mUcfVIRrh1u9TNz/d3zBfATTenB
 vFT0iRUYtzvCk5B/gMrzZZSv4KhnbJRRiXT3b72AZTvPtnGA/12Cr5TQeceFQmAGFqn0YgFgnApIw
 8wDl3IuDuSeZsjYaWYWAsA2O1TOyxfP1F48Kdr/3UCYDDHt8W8hAqGDn1hrFEM5yRe1mFwAerXDBP
 0GNXyDfARVgON02bD34+hQ==;
In-Reply-To: <m11q9jngho.fsf@dazzs-mbp.home> (bug-gnu-emacs@gnu.org)
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" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=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:279850
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/279850>

> Date: Sun, 11 Feb 2024 16:54:43 +0100
> From:  Eshel Yaron via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> 
> 1. emacs -Q
> 2. (setq enable-recursive-minibuffers t)
> 3. M-y
> 4. In the minibuffer (with the prompt "Yank from kill-ring: "),
>    type M-x calendar RET (or any other command).
> 5. M-x M-p
>    Expected: "calendar" is inserted in the minibuffer.
>    Observed: error saying "Beginning of history; no preceding item".
> 
> The problem is that the minibuffer history of M-x isn't recorded when
> you invoke M-x from within the minibuffer of read-from-kill-ring (M-y).
> The reason is that read-from-kill-ring let binds history-add-new-input,
> and that affects all recursive minibuffers as well, so no minibuffer
> history is recorded until you exit the first (non-recursive) minibuffer.
> 
> AFAICT This issue affects all uses history-add-new-input, unfortunately,
> not only read-from-kill-ring, since it's always used via let-bindings.

I'm not sure we should be interested in fixing this.  Recursive
minibuffers are not supposed to start a completely new command loop
unaffected by whatever was before it, so we shouldn't try.  Even if
this particular case is solved (which I'm not sure we can), there are
a legion of other similar situations, where something let-bound by a
command entering the minibuffer affects all the recursive minibuffers.
Let-binding in commands that prompt users is ubiquitous in Emacs.

It's easy enough to work around the problem: C-g (perhaps more than
once), then start afresh.

So I tend to close this as wontfix.