From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Mendler Newsgroups: gmane.emacs.bugs Subject: bug#62776: 30.0.50; 'project-find-file' ignoring 'file-name-history' Date: Wed, 19 Apr 2023 14:05:27 +0200 Message-ID: References: <97545727-7123-ca74-3d2e-4ac5c6d8f25a@gutov.dev> <1310e385-f151-2a96-d7b9-cd21c082adc3@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30765"; mail-complaints-to="usenet@ciao.gmane.io" To: Dmitry Gutov , Rudolf =?UTF-8?Q?Adamkovi=C4=8D?= , 62776@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 19 14:06:35 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 1pp6a3-0007ln-2j for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Apr 2023 14:06:35 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pp6Za-0000Uy-13; Wed, 19 Apr 2023 08:06:06 -0400 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 1pp6ZW-0000US-G8 for bug-gnu-emacs@gnu.org; Wed, 19 Apr 2023 08:06:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pp6ZW-0003Rn-7k for bug-gnu-emacs@gnu.org; Wed, 19 Apr 2023 08:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pp6ZW-0004zG-3Y for bug-gnu-emacs@gnu.org; Wed, 19 Apr 2023 08:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Apr 2023 12:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62776 X-GNU-PR-Package: emacs Original-Received: via spool by 62776-submit@debbugs.gnu.org id=B62776.168190593819128 (code B ref 62776); Wed, 19 Apr 2023 12:06:02 +0000 Original-Received: (at 62776) by debbugs.gnu.org; 19 Apr 2023 12:05:38 +0000 Original-Received: from localhost ([127.0.0.1]:32939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pp6Z7-0004yR-Lo for submit@debbugs.gnu.org; Wed, 19 Apr 2023 08:05:38 -0400 Original-Received: from server.qxqx.de ([178.63.65.180]:44749 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pp6Z5-0004yD-Bw for 62776@debbugs.gnu.org; Wed, 19 Apr 2023 08:05:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de; s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=kK7sEaoHWbOJnNldLZt82wx6PUyg1zNMZeR5x68R1rM=; b=GZQw8GJy2ztxpiaBKaDFRcDzC3 K5j/NCHDXsHxt4XUmL7NDXDJVYymNzc9W+0Vlo7mj2fgflD/XrxC+6hxiJ4851EgjZ3OdKHtv/X0L wKalOj6VBhwtPICXnCx+GeaErpebTqFQj4afUFPdtKTR1xOPIgdNIxUtJKAzFer9DHp8=; Content-Language: en-US In-Reply-To: <1310e385-f151-2a96-d7b9-cd21c082adc3@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" 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:260266 Archived-At: On 4/19/23 12:47, Dmitry Gutov wrote: > On 19/04/2023 08:54, Daniel Mendler wrote: >> On 4/19/23 03:54, Dmitry Gutov wrote: >>> It's possible that vertico--history-hash is confused by our manipulation >>> of the history entries -- like how they are stored as absolute file >>> names now (bug#58447). >> Yes, that's right. A tweak to the hash manipulation would be needed. On >> the other hand we cannot handle all special cases in >> vertico--history-hash. For such cases one can set the >> vertico-sort-function or vertico-sort-override-function variables per >> command. > Perhaps there is some straightforward way to determine whether the > current completion table stops at separators or not, to be used here. Yes, one could for example check if the base string is empty, stored in `vertico--base`. Then the suffix should not be removed. However we would still strip the `default-directory` (or project directory) from all the candidates stored in the history, since the project file names are relative. Iirc this was introduced in a recent change in project.el, which was a good change in principle, but unfortunately breaks the assumptions of sorting by history. All in all this makes `project-find-file` a special case which we could handle specially in `vertico--history-hash`, but I try really hard to avoid accumulating special cases in Vertico. Another alternative would be to control the sorting directly in `project-find-file` by setting the `display-sort-function` and `cycle-sort-function`, maybe via a configuration variable. It is not really obvious where sorting is handled best. For example in my Consult package, which offers "highly tuned" completion commands, the commands usually try to control many aspects of completion (including sorting), while for other simpler commands it is better to let the completion UI do more of the work. Daniel