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#70996: project-find-file defaults Date: Wed, 12 Jun 2024 23:04:07 +0300 Message-ID: References: <867cft2ggx.fsf@mail.linkov.net> <86cyoqjdcq.fsf@mail.linkov.net> <67beb5e6-8e74-4320-ba2f-7ceca2aae963@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="4180"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 70996@debbugs.gnu.org, Stefan Monnier , Juri Linkov To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 12 22:05:31 2024 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 1sHUDp-0000n6-TI for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 Jun 2024 22:05:30 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sHUDQ-00027d-SD; Wed, 12 Jun 2024 16:05:04 -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 1sHUDP-00027V-Pg for bug-gnu-emacs@gnu.org; Wed, 12 Jun 2024 16:05:04 -0400 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 1sHUDP-00041Y-HI for bug-gnu-emacs@gnu.org; Wed, 12 Jun 2024 16:05:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sHUDO-0008LU-Ft for bug-gnu-emacs@gnu.org; Wed, 12 Jun 2024 16:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 Jun 2024 20:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70996 X-GNU-PR-Package: emacs Original-Received: via spool by 70996-submit@debbugs.gnu.org id=B70996.171822265731925 (code B ref 70996); Wed, 12 Jun 2024 20:05:02 +0000 Original-Received: (at 70996) by debbugs.gnu.org; 12 Jun 2024 20:04:17 +0000 Original-Received: from localhost ([127.0.0.1]:46515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sHUCf-0008Iq-7C for submit@debbugs.gnu.org; Wed, 12 Jun 2024 16:04:17 -0400 Original-Received: from fout4-smtp.messagingengine.com ([103.168.172.147]:53075) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sHUCd-0008IM-FP for 70996@debbugs.gnu.org; Wed, 12 Jun 2024 16:04:16 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfout.nyi.internal (Postfix) with ESMTP id D23FA13801B4; Wed, 12 Jun 2024 16:04:10 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 12 Jun 2024 16:04:10 -0400 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:subject:subject:to:to; s=fm3; t=1718222650; x=1718309050; bh=XD/EJQHX97+zEKeVO25VoJxWNedgPHUlj1DCqm1h/zU=; b= WOoraGHQX3JWV3taJ9/n6E3p4Fc24gAUHQfL5lAJE6VOv5doeptr/W0x05OATnrF YuV0wWm4hCzp1w2JWZ4J6UKajdmGsU5p1tcvB/9Kxlcn8rS7SjNZCc4PP8P4TOxP Vp0m8FSoOj1x2TOZwK0Ei4jXUwvDIcFiaihZiu1hnD6nabhnMCTefjfgOIDvWz8d Zg707WuLTcVd59em45JCiuCmYU1rB26Yr9MBCwD5CmWD+aROPbwJGLCrIhriyn6V T6D8kahWmAxptU6v+GBajq3W/DKMMq0WnoitwPADPm+zBZpdIRZwBsWOzqYWsxYu we9ye1pyor6bhyWrzTUXFg== 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:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1718222650; x= 1718309050; bh=XD/EJQHX97+zEKeVO25VoJxWNedgPHUlj1DCqm1h/zU=; b=J s5P832eZDwGVy2BxUSrKZwj6i+XmIGcZ+n9pcsDB0/+fOB0z/kMJkiaCVHeSDudL 57ABnNluMk5k9tlZhn25DV79eqdqLBy94rNq3Mn8Rqqayb30wx18S+op5Bqhoplb l5xviWVZYdpZnCGIvKTdXalr4xql/Po57eCuzqRZ59cEAZxA2WoiO1Il01KeTmqt iBg6DukMG7HBVsvW/Qqezn7pCUk9Di6n6lPF52S0ash839lyImV5zr1xDFOOTfvR ynynqtoA7T8Mb+4dXJ5EubVuG3xoEVE7UK9PtPpJJ0f7QJh5tzNlejWoQMzMWPW8 g1GS5mHUgkdjnbN2eW0nQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedugedgudegfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuhffvvehfjggtgfesthekredttddvjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrg htthgvrhhnpedvleeijeevkeejleffgeduiedujeffhfevudduffdvveetkeegveffjefg ffelueenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Jun 2024 16:04:09 -0400 (EDT) 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:287171 Archived-At: On 12/06/2024 16:52, Dmitry Gutov wrote: > > In case you agree with my concerns above (I'm happy to be convinced > otherwise), we could try to do something like > >   (completion-try-completion (thing-at-point 'filename) >                              TABLE nil LEN) > > Unfortunately, we currently call thing-at-point earlier than > project-files is called. So some rethinking would have to be done (a > breaking change to project-find-file-in, apparently). Actually, we could do the check inside project-find-file-in. The tricky part is that project--file-completion-table (which adds the metadata property to the table, allowing for laxer matching due to the entry in completion-category-defaults) is called later - in project--read-file-cpd-relative and project--read-file-absolute. And one reason for that is project--read-file-cpd-relative mapcar's the list through 'substring'. Which requires a list as input, and IIRC so the previous version first called 'all-completions'. Which wasn't free, especially with larger lists - but perhaps since the completion table is functional we could get away with returning a copy of the list when the prefix is empty... Or maybe project--read-file-cpd-relative could use something like completion-table-subvert, which seems like it can avoid extra copying... Alternatively, we'd change the calling convention even more and pass down a function that returns the list of "future history". And takes the completion table as argument, I suppose.