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 17:46:11 +0200 Message-ID: References: <97545727-7123-ca74-3d2e-4ac5c6d8f25a@gutov.dev> <1310e385-f151-2a96-d7b9-cd21c082adc3@gutov.dev> <360f88a8-8dd9-5fd3-51ef-4b670aad2272@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="20371"; 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 17:47:27 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 1ppA1n-000525-Hl for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Apr 2023 17:47:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppA1W-0000re-Hr; Wed, 19 Apr 2023 11:47:10 -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 1ppA1R-0000rL-5l for bug-gnu-emacs@gnu.org; Wed, 19 Apr 2023 11:47:08 -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 1ppA1O-0000QD-Sp for bug-gnu-emacs@gnu.org; Wed, 19 Apr 2023 11:47:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ppA1O-0008BL-9V for bug-gnu-emacs@gnu.org; Wed, 19 Apr 2023 11:47: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 15:47: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.168191918431394 (code B ref 62776); Wed, 19 Apr 2023 15:47:02 +0000 Original-Received: (at 62776) by debbugs.gnu.org; 19 Apr 2023 15:46:24 +0000 Original-Received: from localhost ([127.0.0.1]:35580 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppA0m-0008AI-44 for submit@debbugs.gnu.org; Wed, 19 Apr 2023 11:46:24 -0400 Original-Received: from server.qxqx.de ([178.63.65.180]:43789 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppA0j-00089v-9u for 62776@debbugs.gnu.org; Wed, 19 Apr 2023 11:46:22 -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=kcLOLxKSD/P67sz7HLhVDaJe3g7P+JTVrF2M/z4OszU=; b=TfBbvd9HcwCCq20NNy56z29IHX DTy4zU8UfbNgnvnLGUKATZXGEHh0hs0L8rytXQDPymqDSCKm6qM2Vu+wEZiaqsJtOPl9SvUYz+adL L5d2E4hMnoJ79/yTMOSIK4LPaEHB89vjx0n1ZwPYE9YQTMJy+obj+xlXbRYZEXSiMlwM=; Content-Language: en-US In-Reply-To: <360f88a8-8dd9-5fd3-51ef-4b670aad2272@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:260274 Archived-At: On 4/19/23 17:28, Dmitry Gutov wrote: > On 19/04/2023 15:05, Daniel Mendler wrote: >> 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. > > From my outside perspective, it seems appropriate to handle inside this > function, if it's at all possible to do without mentioning the exact > command name, etc. This seems almost not possible. The behavior would be quite specific for `project-find-file` (or even only to the specific `project-read-file-name-function`. If we need per-command special handling one can always override `vertico-sort-function` manually. > IIUC the issue is that is has (added) special handling for file name > completion, and predicates that on the name of the history variable. It > can/should be combined with an extra check which makes sure that the > completion table uses '/' as field separators. Maybe using the > `completion-boundaries` thingy. Or just straight calling > `completion-boundaries` on the history elements to extract the first > segment instead of hardcoding '/'. Vertico already handles completion boundaries. This is how the base string `vertico--base` is computed. But as already mentioned, this is unfortunately not the only issue. The issue is also that `project-find-file` removes the base directory. The entries in the history hash would need the same treatment. Daniel