From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Dmitry Gutov <dmitry@gutov.dev>
Newsgroups: gmane.emacs.bugs
Subject: bug#67310: [PATCH] Include the project--list as history when
 prompting for a project
Date: Tue, 21 Nov 2023 13:14:29 +0200
Message-ID: <421e3ea8-d150-566e-f645-cbf1ccbcba61@gutov.dev>
References: <ier8r6s42on.fsf@janestreet.com>
 <dc5ad8f4-b857-ea87-d178-bae903cee517@gutov.dev>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="33310"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.13.0
Cc: eliz@gnu.org, juri@linkov.net
To: Spencer Baugh <sbaugh@janestreet.com>, 67310@debbugs.gnu.org
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 21 12:15:21 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 1r5Oit-0008SE-QK
	for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 Nov 2023 12:15:20 +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 1r5Oic-0007Gv-24; Tue, 21 Nov 2023 06:15:02 -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 1r5Oia-0007Ea-6Q
 for bug-gnu-emacs@gnu.org; Tue, 21 Nov 2023 06:15:00 -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 1r5OiZ-0002wX-UW
 for bug-gnu-emacs@gnu.org; Tue, 21 Nov 2023 06:14:59 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1r5Oic-0004n0-Gu
 for bug-gnu-emacs@gnu.org; Tue, 21 Nov 2023 06:15:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Dmitry Gutov <dmitry@gutov.dev>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Tue, 21 Nov 2023 11:15:02 +0000
Resent-Message-ID: <handler.67310.B67310.170056528218352@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.170056528218352
 (code B ref 67310); Tue, 21 Nov 2023 11:15:02 +0000
Original-Received: (at 67310) by debbugs.gnu.org; 21 Nov 2023 11:14:42 +0000
Original-Received: from localhost ([127.0.0.1]:55253 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1r5OiI-0004lv-Be
 for submit@debbugs.gnu.org; Tue, 21 Nov 2023 06:14:42 -0500
Original-Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:60589)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dmitry@gutov.dev>) id 1r5OiG-0004lj-TU
 for 67310@debbugs.gnu.org; Tue, 21 Nov 2023 06:14:41 -0500
Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailout.west.internal (Postfix) with ESMTP id 63A573201333;
 Tue, 21 Nov 2023 06:14:32 -0500 (EST)
Original-Received: from mailfrontend1 ([10.202.2.162])
 by compute1.internal (MEProxy); Tue, 21 Nov 2023 06:14:32 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc
 :cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:sender:subject:subject:to:to; s=fm2; t=
 1700565271; x=1700651671; bh=dw1LDb+EaxpKbgb4isvH/GXBB20RDQ/oLNi
 +H8yqV+Y=; b=iw48Km1W81DtrEB/JCqzpnma5OMp/34IGDJwWZkmWKV7tCtaWd9
 lwCci0Hgz2UNzH8VVcAcr4WBZO+zS9Gd7NPm8pg2a/cpgXkH/sSFKPC7nrBdgyq1
 +zMfk5Kn1BYoZ6LF3oA3s/yNuQTYhiJXWwzop9yGhpiXEqgcw2hcop7R95SR4F/Z
 mg/qo8lmhj9M7/LZ9wNpIoKjZcN0Pgeu6GywitocnSvbwkrvwuvi0WvSs4acZg26
 PXl6SbDH7h0Hi1cIp7Y6zVJZk7GFnYz/r7RmJtzG9mV1kbNoMbL27uHlau4ffYdL
 XvVcMm28MnqRm/2aZg+Wb872c6K1jLI1c0g==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:sender:subject:subject:to:to:x-me-proxy
 :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=
 1700565271; x=1700651671; bh=dw1LDb+EaxpKbgb4isvH/GXBB20RDQ/oLNi
 +H8yqV+Y=; b=v79sD8FJBSOF5YebCngfBqVITDuBPI4y+kGOf1b3IKszZM2NXrq
 bSHgmre9pRi22Ng3aaThKiOlQsVL1LMJuz+4nPAjegbQcvyVMYom62XfGrdRcFJE
 1OGO1LNQ95VS5CgVXK8JcWznCdiDhTwkoyvtrwfaHly/WsdNbpyhGIre+OUXb0hH
 ibudzDZDdeYuV5VYBknAYrrKlNBKElMA/C6MAWEyN65Fd6B40EtbVE+Kvsw7vAxD
 jiWNBig0KDdJp3YmViJhYqx6EKm/vnHPyohpb/OaVfSfIqOoRXeq1iWtdJ90QL4b
 +qgQXUyaDTZ18KSMXZq0ycYM1r8kLLhwYlQ==
X-ME-Sender: <xms:F5FcZWcphGk3UKMiYGsJSnm5eiPDVLa6CB4nR6wgnbWjaMNx5FN7IA>
 <xme:F5FcZQNHYm9C6A4ZQmEaRBVt3AGRzhJwNRA2Tlz5rkcTybWLlOcAndrXuMGVshnyj
 RJ_llqc4oDLY0MM_GU>
X-ME-Received: <xmr:F5FcZXhGycAy-4gbD9B7Z2xs_E8qQ3y2XRAqEcxEOX-AhqQnNzLHnc9dkwGp1fHc2hfeUw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudegledgvddvucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhepkfffgggfuffhvfevfhgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi
 thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth
 htvghrnhephfeftdejleetffelhfffteefgfeggfejgfdtudeuvedttdetvdelffekvdeg
 udetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug
 hmihhtrhihsehguhhtohhvrdguvghv
X-ME-Proxy: <xmx:F5FcZT89hjbbxvws_yPFUWH5XKJF14D9ge2y6kEfqERzSWoNePy_Ow>
 <xmx:F5FcZStyhiawqgWl3w47gDGJsalioWl0ppISb0_WQn6vlQezN8t-uA>
 <xmx:F5FcZaHaWzz39JawMYqFKHxxiVT3xWvKD0yrSkLQloEc67yF-ToG6w>
 <xmx:F5FcZb55P2pL4-SPth-ZxHRH41wfO2lgaQeag0C7BwgB1d6ZAuYehQ>
Feedback-ID: i0e71465a:Fastmail
Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 21 Nov 2023 06:14:30 -0500 (EST)
Content-Language: en-US
In-Reply-To: <dc5ad8f4-b857-ea87-d178-bae903cee517@gutov.dev>
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:274710
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/274710>

On 21/11/2023 13:06, Dmitry Gutov wrote:
> On 20/11/2023 21:58, Spencer Baugh wrote:
>> +              (completing-read "Select project: " choices nil t nil 
>> 'project--list))))
> 
> I wonder if this will make 'project--list' to be automatically managed 
> my savehist-mode (because of what savehist-minibuffer-hook does).
> 
> And then the contents of this var might be restored by savehist-mode 
> (when enabled) at a time or in a way that project.el is not expecting.

Sorry, I sent this by accident, it was in drafts.

You explained this in the patch's message. But could there be a way that 
the list of overwritten anyway? Like when the user enables savehist-mode 
mid-session (or simply after project--list is used for the first time), 
and savehist-mode reads the histories from a saved file, overwriting the 
current session's values?

Perhaps it would be more reliable to have separate history variables 
(one for directory names, and one for project names), and construct 
their values dynamically before reading the project.