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: Sun, 10 Dec 2023 05:04:27 +0200 Message-ID: References: <421e3ea8-d150-566e-f645-cbf1ccbcba61@gutov.dev> <81b6ed58-3fdc-3b5a-41a9-84d66475d5f1@gutov.dev> <5c3eb6a1-38da-8af4-419a-e0567b163e3a@gutov.dev> <8634wr6s1t.fsf@mail.linkov.net> 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="33001"; 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 To: Juri Linkov , Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 10 04:05:08 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 1rCA7u-0008H4-UU for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Dec 2023 04:05:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rCA7e-0005nK-Eq; Sat, 09 Dec 2023 22:04:50 -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 1rCA7c-0005mq-O6 for bug-gnu-emacs@gnu.org; Sat, 09 Dec 2023 22:04: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 ) id 1rCA7c-0007vr-Fj for bug-gnu-emacs@gnu.org; Sat, 09 Dec 2023 22:04:48 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rCA7p-00083o-Ta for bug-gnu-emacs@gnu.org; Sat, 09 Dec 2023 22:05:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Dec 2023 03:05:01 +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.170217749430967 (code B ref 67310); Sun, 10 Dec 2023 03:05:01 +0000 Original-Received: (at 67310) by debbugs.gnu.org; 10 Dec 2023 03:04:54 +0000 Original-Received: from localhost ([127.0.0.1]:49261 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCA7h-00083P-H5 for submit@debbugs.gnu.org; Sat, 09 Dec 2023 22:04:53 -0500 Original-Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:34321) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCA7e-00083A-Jc for 67310@debbugs.gnu.org; Sat, 09 Dec 2023 22:04:52 -0500 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id B9A073200A19; Sat, 9 Dec 2023 22:04:30 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sat, 09 Dec 2023 22:04:31 -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= 1702177470; x=1702263870; bh=ba2TRYhNb/dNiC7W8+HOr8PLB5sbtfLHiYG tkSgDrHo=; b=lWW32TALu7bq9bEbmJTSqWSPvzdu1N+TT/VZ1/04/TL3XJnqMgi BEAS97CONHDrSevlz1wuluYRmhxe2wBD0PABXJFSa+HdOzoj0wA7covMeiSiD4hu Vf3d445/mPrjNu3BNz4VzOOir6FTGFlcH68ipx9wG4Ph15xJ4ovDm05rE/XdSm41 Fu+lvEw7TOgKBe3G0jhy+hGQA5s+O+VPg5LRk+Mn44+SQdtaWMWoF3HOzNZZz9QQ unQ/x8bz2KRz3VBOnPQBUxBO7DAphyKQyz5ySD/YjFeYIMbCrALTOixAAdktgQy0 H1KJipa+SxIJGPfgY4zVTS+AkxBnjlo7gYQ== 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= 1702177470; x=1702263870; bh=ba2TRYhNb/dNiC7W8+HOr8PLB5sbtfLHiYG tkSgDrHo=; b=e00dwjZwNKEePoj+qE6+2kSSHbMoQBwIFvTC8uooy+QUBasEeC7 V5oRWRLMW0bCcR2CCNNQe/kl/MLrqB/Q3pB5utgY7Uz4QqQrPZG8IX7sM83jvFDZ i0hbKVGuVOz9yXkDMb/lOotLOTiu2L7WmaIuiZJuhq9iIyQkO4/m0sIxk0kJrYAo vzCmruSZOj607jhll4p9p9ia9ffBdq8gu/2xq9mq1ECzFE0VVHV3za5yOIXeFUFu Yhuksb5G9ecbBTZcDRdxd+qGv3Egr8Rlb8aq1Ec/bucZ6qU62HdUr/mP/yZfzGmm +2u0yY8rogGZxor8CFkTb7Mlf6rkQyCYZOg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudekledgheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 9 Dec 2023 22:04:28 -0500 (EST) Content-Language: en-US In-Reply-To: <8634wr6s1t.fsf@mail.linkov.net> 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:275892 Archived-At: Hi Juri, On 27/11/2023 19:10, Juri Linkov wrote: >> + ;; Iterate in reverse order so project--name-history is in >> + ;; the correct order. >> + (dolist (dir (reverse (project-known-project-roots))) >> ;; we filter out directories that no longer map to a project, >> ;; since they don't have a clean project-name. >> - (if-let (proj (project--find-in-directory dir)) >> - (push (cons (project-name proj) proj) ret))) >> + (when-let (proj (project--find-in-directory dir)) >> + (let ((name (project-name proj))) >> + (push name project--name-history) >> + (push (cons name proj) ret)))) > This change broke the order of 'C-x p p M-n M-n ...', > so I pushed this fix: > > diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el > index f7f057396e1..a81bb63fba4 100644 > --- a/lisp/progmodes/project.el > +++ b/lisp/progmodes/project.el > @@ -1808,7 +1808,7 @@ project-prompt-project-name > (name (project-name proj))) > (push name project--name-history) > (push (cons name proj) ret))) > - ret)) > + (reverse ret))) > ;; XXX: Just using this for the category (for the substring > ;; completion style). > (table (project--file-completion-table 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? I just tried find-file, and the future history is empty there, so I suppose this is something we added particularly for project-find-file.