From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: sbaugh@catern.com
Newsgroups: gmane.emacs.bugs
Subject: bug#67310: [PATCH] Include the project--list as history when
 prompting for a project
Date: Thu, 14 Dec 2023 01:02:58 +0000 (UTC)
Message-ID: <87wmthtx5p.fsf@catern.com>
References: <ier8r6s42on.fsf@janestreet.com>
 <dc5ad8f4-b857-ea87-d178-bae903cee517@gutov.dev>
 <421e3ea8-d150-566e-f645-cbf1ccbcba61@gutov.dev>
 <ier34wz3zkx.fsf@janestreet.com>
 <81b6ed58-3fdc-3b5a-41a9-84d66475d5f1@gutov.dev>
 <ierr0khlq19.fsf@janestreet.com>
 <5c3eb6a1-38da-8af4-419a-e0567b163e3a@gutov.dev>
 <iercyw1l6rz.fsf@janestreet.com>
 <dc3b5328-8719-8948-e617-e3e8cf13f274@gutov.dev>
 <ier8r6nkv58.fsf@janestreet.com> <8634wr6s1t.fsf@mail.linkov.net>
 <dfbd2b3e-a14b-b5b4-a7c0-aa837ea6220c@gutov.dev>
 <861qbujehq.fsf@mail.linkov.net>
 <780dbb13-c0ca-9082-936b-3c2ab34084dc@gutov.dev>
 <861qbtq630.fsf@mail.linkov.net>
 <8c67f590-d31a-44be-1c33-c0c75e4da63c@gutov.dev>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="5028"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cc: 67310@debbugs.gnu.org, Spencer Baugh <sbaugh@janestreet.com>, eliz@gnu.org,
 Juri Linkov <juri@linkov.net>
To: Dmitry Gutov <dmitry@gutov.dev>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 14 02:04:16 2023
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 1rDa98-00013o-Fy
	for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Dec 2023 02:04:15 +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 1rDa8i-0007Ev-TB; Wed, 13 Dec 2023 20:03: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 1rDa8g-0007EY-FI
 for bug-gnu-emacs@gnu.org; Wed, 13 Dec 2023 20:03: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 1rDa8g-0005Lr-69
 for bug-gnu-emacs@gnu.org; Wed, 13 Dec 2023 20:03: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 1rDa8w-0000LY-3P
 for bug-gnu-emacs@gnu.org; Wed, 13 Dec 2023 20:04:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: sbaugh@catern.com
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Thu, 14 Dec 2023 01:04:02 +0000
Resent-Message-ID: <handler.67310.B67310.17025158051281@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 67310
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
Original-Received: via spool by 67310-submit@debbugs.gnu.org id=B67310.17025158051281
 (code B ref 67310); Thu, 14 Dec 2023 01:04:02 +0000
Original-Received: (at 67310) by debbugs.gnu.org; 14 Dec 2023 01:03:25 +0000
Original-Received: from localhost ([127.0.0.1]:59897 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1rDa8K-0000Ka-NN
 for submit@debbugs.gnu.org; Wed, 13 Dec 2023 20:03:25 -0500
Original-Received: from s.wrqvwxzv.outbound-mail.sendgrid.net ([149.72.154.232]:54832)
 by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from
 <bounces+21787432-b3f5-67310=debbugs.gnu.org@em8926.catern.com>)
 id 1rDa8G-0000KI-RA
 for 67310@debbugs.gnu.org; Wed, 13 Dec 2023 20:03:24 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com;
 h=from:subject:in-reply-to:references:mime-version:to:cc:content-type:
 content-transfer-encoding:cc:content-type:from:subject:to;
 s=s1; bh=H2jBYpfqPg0SE4LrRXFptxa7xynPV/9vYqdnY4OUEkQ=;
 b=KAvYAQnQv6Qea0/fNKAoWMc8bLhzpVtuoPbKfuB+Iecvs9gJ+GW1FL1CQYuO621YR/Oh
 7ZWAV7xsUwI5YXWEA0L7wyFhzB2LUHt1UeFuce64VcOfGhaAdoO4uTxqU0mCucm+VEW/+/
 R++jpBatKxvB8tY4OaSpZgJQrAfuze291oqSmySR3Voyrftc0bnd3zo2JotlYHACUCUcq4
 MK1xsn85rG+p3tnTDe/JeAXOwyhtFnrtGK7YibOsOwD3OJu3pF8DyfB6SCj2kwXhnTZdAn
 sko0rVEzLZhUYpUqmJGUzOhh/B5rPbEipFAF2AP2HJA0zKWmNhgPgFlEcV8hBcjA==
Original-Received: by filterdrecv-6b68c9f446-xmb8m with SMTP id
 filterdrecv-6b68c9f446-xmb8m-1-657A5442-10
 2023-12-14 01:02:58.281265135 +0000 UTC m=+4947721.640721966
Original-Received: from earth.catern.com (unknown) by geopod-ismtpd-30 (SG) with ESMTP
 id 8tMMcuOTQ-G3dUzRlNwofg Thu, 14 Dec 2023 01:02:58.216 +0000 (UTC)
Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=74.101.51.129;
 helo=localhost; envelope-from=sbaugh@catern.com; receiver=gutov.dev 
Original-Received: from localhost (unknown [74.101.51.129])
 by earth.catern.com (Postfix) with ESMTPSA id 1CD526324F;
 Wed, 13 Dec 2023 20:01:22 -0500 (EST)
In-Reply-To: <8c67f590-d31a-44be-1c33-c0c75e4da63c@gutov.dev> (Dmitry Gutov's
 message of "Tue, 12 Dec 2023 02:21:07 +0200")
X-SG-EID: ZgbRq7gjGrt0q/Pjvxk7wM0yQFRdOkTJAtEbkjCkHbJVsJKTyi3du9eES3s+64dPxmY181xWJM9fipML/wNdFZ/NA3hVG6Rwfh4vj+qxFuq+qcwAB5ryFbvKJTjqcVSjsfGE7L5YNyTVQi8Ge9YtWYM7bWBcAyKHUsCQ8numvFdDMa1++pYx7vt3HS9dju+KuAGKOEqjZHU6P5Pyxuqcmw==
X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q==
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:276163
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/276163>

Dmitry Gutov <dmitry@gutov.dev> writes:
> On 11/12/2023 19:12, Juri Linkov wrote:
>>>>>> This change broke the order of 'C-x p p M-n M-n ...',
>>>>> Could you remind me which behavior in 'M-n M-n' the aforementioned change
>>>>> relates to? Is this supposed to be like input history as well, or the
>>>>> contents of the completions table in a certain order?
>>>> It's inappropriate to overwrite the history with the recently visited projects.
>>>> Only user input should be added to history variables because it's actually
>>>> the history of user input.  Therefore, the remaining way to access a list
>>>> of recently visited projects is the future history with 'M-n M-n'.
>>>
>>> But... we do overwrite it now, manually constructing the value of input
>>> history from project--list every time.
>>>
>>> So it seems like both "past history" and "future history" show the same
>>> information now. If so, it might make sense to keep only one.
>> It's usually not good to overwrite past history.  So it's better
>> to keep only future history.
>
> I'm not sure the actual input history is useful here: in most cases,
> it will be empty or almost empty. project history is different from
> all others because we almost always detect it automatically. And also
> because the total set of projects is relatively small, for each user.
>
> And "future history" is different for every command, including the
> logic of how it's formed. Most users are also unaware of its
> existence, so it wouldn't be a good idea to rely only on it.

Yes, I think it's okay for project history to be treated as minibuffer
history even though it's not actual input history.  It's not a huge
deal, especially since the history didn't exist before.

I worry that making M-n produce project--list and M-p produce input
history will be confusing for users.  It would be like how history and
defaults in switch-to-buffer works, which is also quite confusing.  I
personally have no intuitive grasp of when I should use history and
which I should use defaults in switch-to-buffer.