From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#67310: [PATCH] Include the project--list as history when prompting for a project Date: Wed, 22 Nov 2023 20:44:53 +0200 Message-ID: <5c3eb6a1-38da-8af4-419a-e0567b163e3a@gutov.dev> References: <421e3ea8-d150-566e-f645-cbf1ccbcba61@gutov.dev> <81b6ed58-3fdc-3b5a-41a9-84d66475d5f1@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34940"; 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: 67310@debbugs.gnu.org, eliz@gnu.org, juri@linkov.net To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 22 19:46:21 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 1r5sEt-0008pw-A7 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Nov 2023 19:46:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r5sEc-0001ZR-Nj; Wed, 22 Nov 2023 13:46: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 ) id 1r5sEZ-0001Y3-Ox for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2023 13:45:59 -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 1r5sEZ-0007cP-G1 for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2023 13:45:59 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r5sEc-00032J-FG for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2023 13:46:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 Nov 2023 18:46:02 +0000 Resent-Message-ID: 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.170067870911607 (code B ref 67310); Wed, 22 Nov 2023 18:46:02 +0000 Original-Received: (at 67310) by debbugs.gnu.org; 22 Nov 2023 18:45:09 +0000 Original-Received: from localhost ([127.0.0.1]:59904 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r5sDk-000319-HI for submit@debbugs.gnu.org; Wed, 22 Nov 2023 13:45:08 -0500 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:53213) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r5sDi-00030K-KN for 67310@debbugs.gnu.org; Wed, 22 Nov 2023 13:45:07 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 13DC95C0248; Wed, 22 Nov 2023 13:44:58 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 22 Nov 2023 13:44:58 -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=fm3; t= 1700678698; x=1700765098; bh=ExhPsKDNczegp7fRImedrQ96aMtkzjImRZD PnVa0KOM=; b=OKLQNQE7/88XXJYWig6ClDOBVUuBlVQ8d+5MYrOWe1xLuvRNEAG HUB5St4g3ZG14i5v4x/N0PwKBqx5xMt3YeiWZUaSOhcpe6tlHLqC5HRJZXgiohmp jqPojprCJMNfBB2OR14SAxWA1PckkSEZ/hnH9ibD6RcVK8Ssm2UuERP1diOG2jo3 J1bWR6B6x4wBTiDsN7XYKItfb/B64x8AdTH+c0v3sx4tMzRH00EAcubZH0GABq93 uVQ8dJcYtXvrInBuWqTvPn8m2HKdAjw9sqAyiX1HhSJcVPujK8biKmTt7WkZNxPI U1muHi++CEzHRU2nRzkrg5BtR8/nXy0PxyQ== 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= 1700678698; x=1700765098; bh=ExhPsKDNczegp7fRImedrQ96aMtkzjImRZD PnVa0KOM=; b=W77s6hVb36dg0q/hwKrcPbWJ6WRoN0F4vbEQodmlMvf9Uv3VFpr QArcuHBQ8VbAxc7OsG3zjCttA98fcG9c8WffuLfIlckMWwZQwmWp38yE3ab9YbUo NyuUy/Yy1iOOsGkv736VZDThza8l017AbE5xwZEmlYGdrV8sQiJIEVQCDBsv453V B21tt6tpAwbK+6Q8IwTpFUeyCBfm1T0Zvsr0pLE5vkvE+XGHygoRekHbYOQVg5BZ 5hfCxOdR+/4b7rOm7SrkMj7S3IuVgFdtGpERYpnPOCByx38X7kfOUQHB50zLdFRl sDszN1ik8ooTD+9MuNwT6MeDYuetgTrUcqQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudehuddgudduhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrg htthgvrhhnpeeigfetveehveevffehledtueekieeikeeufeegudfgfeeghfdulefgfeev ledvveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Nov 2023 13:44:56 -0500 (EST) Content-Language: en-US In-Reply-To: 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:274773 Archived-At: On 22/11/2023 18:18, Spencer Baugh wrote: > Dmitry Gutov writes: >> On 21/11/2023 17:17, Spencer Baugh wrote: >>> (if (equal pr-dir dir-choice) >>> (read-directory-name "Select directory: " default-directory nil t) >>> + (project--add-dir pr-dir) >>> pr-dir))) >>> ... >>> (if (equal pr-name dir-choice) >>> (read-directory-name "Select directory: " default-directory nil t) >>> - (let ((proj (assoc pr-name choices))) >>> - (if (stringp proj) proj (project-root (cdr proj))))))) >>> + (let* ((proj (assoc pr-name choices)) >>> + (root (project-root (cdr proj)))) >>> + (project--add-dir root) >>> + root)))) >> >> I think in the (equal pr-dir dir-choice) case we want to add the >> directory name entered by the user into the "history" anyway, don't >> we? > > Mmmmaybe? That would change behavior - currently transient projects > don't go into the project--list, and with that change they would. Do > you think they should? Hmm, maybe not. Anyway, that sentence was supposed to lead into the next paragraph anyway. > I personally never use transient projects so I don't really know how > they should behave. > >> Though perhaps there's no need to do it here: 'project-current' calls >> 'project-remember-project' anyway when maybe-prompt is non-nil. >> >> So what happens if you drop both of the above 'project--add-dir' calls? > > project-prompter is also called from project-switch-project, which > doesn't call project-remember-project but should also update the history > IMO. I suppose project-switch-project could add a project-remember-project call as well? It's just that until recently it only supported project-related commands, and those would invoke (project-current t) right away -- adding the just-selected root into the list.