From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Eshel Yaron via "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
Newsgroups: gmane.emacs.bugs
Subject: bug#69056: 30.0.50; history-add-new-input and recursive minibuffers
Date: Sun, 11 Feb 2024 16:54:43 +0100
Message-ID: <m11q9jngho.fsf@dazzs-mbp.home>
Reply-To: Eshel Yaron <me@eshelyaron.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="22441"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: Gnus/5.13 (Gnus v5.13)
To: 69056@debbugs.gnu.org
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 11 16:56:09 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 1rZCBc-0005cA-SH
	for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 11 Feb 2024 16:56:08 +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 1rZCBJ-0001aP-Oc; Sun, 11 Feb 2024 10:55:49 -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 1rZCBH-0001a4-Nb
 for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2024 10:55:48 -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 1rZCBH-0003L9-Eb
 for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2024 10:55:47 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1rZCBW-00050d-Li
 for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2024 10:56:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Eshel Yaron <me@eshelyaron.com>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Sun, 11 Feb 2024 15:56:02 +0000
Resent-Message-ID: <handler.69056.B.170766691219123@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: report 69056
X-GNU-PR-Package: emacs
X-Debbugs-Original-To: bug-gnu-emacs@gnu.org
Original-Received: via spool by submit@debbugs.gnu.org id=B.170766691219123
 (code B ref -1); Sun, 11 Feb 2024 15:56:02 +0000
Original-Received: (at submit) by debbugs.gnu.org; 11 Feb 2024 15:55:12 +0000
Original-Received: from localhost ([127.0.0.1]:56558 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1rZCAi-0004yM-DP
 for submit@debbugs.gnu.org; Sun, 11 Feb 2024 10:55:12 -0500
Original-Received: from lists.gnu.org ([2001:470:142::17]:39692)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@eshelyaron.com>) id 1rZCAh-0004y4-2r
 for submit@debbugs.gnu.org; Sun, 11 Feb 2024 10:55:11 -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 <me@eshelyaron.com>) id 1rZCAL-0001V3-8z
 for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2024 10:54:49 -0500
Original-Received: from mail.eshelyaron.com ([107.175.124.16] helo=eshelyaron.com)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <me@eshelyaron.com>) id 1rZCAJ-00030X-FG
 for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2024 10:54:49 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
 s=mail; t=1707666886;
 bh=0plnITl3t7O43lUJw2EOXDLSUBU0wHNFq36DtcPIf54=;
 h=From:To:Subject:Date:From;
 b=WDlVY++KwvqfMqZI+UqFTgu/VWih3AFAT1sX83Y+jlqAdyZtyB/Zu8wz+4rrF8zm+
 kzto92y9kjEOXG7Y3zcjA7WHo8obeo81s8jF/wRm33YkpP+xk2m4Gvl+hZBmR3Hi7Y
 Z/ePPJ1Rl1m2DRaPoyT+iKowcukGBHLg8Ok3IQnJ1H+qjWAlV+Y3X/+um5omj8ThPL
 nfEwXQfDxQ/ND7NxTvsW9IFFCb37PXWEziJgJcF+6M1f3opIa1FditT2zofLjNzfSo
 bvjEFSz1KRV/NK780E2aPQEi4NvbKtq8dHl5AQMYchH9QKtaaIw8zxs4VfRHIOJDrV
 zHWUj6sQRQmIQ==
Received-SPF: pass client-ip=107.175.124.16; envelope-from=me@eshelyaron.com; 
 helo=eshelyaron.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 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, SPF_HELO_PASS=-0.001, 
 SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
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:279848
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/279848>


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.