GNU bug report logs - #73044
[PATCH] Add project-find-file-in-root

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Thu, 5 Sep 2024 14:03:01 UTC

Severity: normal

Tags: patch

Fixed in version 31.1

Done: Dmitry Gutov <dmitry <at> gutov.dev>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 73044 in the body.
You can then email your comments to 73044 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#73044; Package emacs. (Thu, 05 Sep 2024 14:03:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Spencer Baugh <sbaugh <at> janestreet.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 05 Sep 2024 14:03:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Spencer Baugh <sbaugh <at> janestreet.com>
To: bug-gnu-emacs <at> gnu.org
Cc: dmitry <at> gutov.dev
Subject: [PATCH] Add project-find-file-in-root
Date: Thu, 05 Sep 2024 10:01:46 -0400
[Message part 1 (text/plain, inline)]
Tags: patch


Several users have asked me for a command which is just
find-file, but starting from the project root.  In large
projects, where project-files is expensive, this will have
substantially better performance than project-find-file.

Also, it allows opening files which aren't included in
project-files without paying the further cost of running
project--files-in-directory (which is what happens when passing
INCLUDE-ALL=t to project-find-file).

Also, it may help with user confusion about why
project-find-file doesn't behave like find-file.  (which I've
encountered a few times)

This command is equivalent to C-x p o C-x C-f, but it's nice to
be able to bind it to a specific key.

Overall, this is easy enough to provide, so let's just do that.

In GNU Emacs 29.2.50 (build 16, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.15.12, Xaw scroll bars) of 2024-08-26 built on
 igm-qws-u22796a
Repository revision: e6d04c06a7eb6ce932b52a346368d02b7a811a00
Repository branch: emacs-29
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Rocky Linux 8.10 (Green Obsidian)

Configured using:
 'configure --with-x-toolkit=lucid --without-gpm --without-gconf
 --without-selinux --without-imagemagick --with-modules --with-gif=no
 --with-cairo --with-rsvg --without-compress-install
 --with-native-compilation=aot --with-tree-sitter
 PKG_CONFIG_PATH=/usr/local/home/garnish/libtree-sitter/0.22.6-1/lib/pkgconfig/'

[0001-Add-project-find-file-in-root.patch (text/patch, attachment)]

Reply sent to Dmitry Gutov <dmitry <at> gutov.dev>:
You have taken responsibility. (Fri, 06 Sep 2024 16:21:02 GMT) Full text and rfc822 format available.

Notification sent to Spencer Baugh <sbaugh <at> janestreet.com>:
bug acknowledged by developer. (Fri, 06 Sep 2024 16:21:02 GMT) Full text and rfc822 format available.

Message #10 received at 73044-done <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Spencer Baugh <sbaugh <at> janestreet.com>, 73044-done <at> debbugs.gnu.org
Subject: Re: bug#73044: [PATCH] Add project-find-file-in-root
Date: Fri, 6 Sep 2024 19:20:16 +0300
Version: 31.1

Hi Spencer,

On 05/09/2024 17:01, Spencer Baugh via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
> Several users have asked me for a command which is just
> find-file, but starting from the project root.  In large
> projects, where project-files is expensive, this will have
> substantially better performance than project-find-file.
> 
> Also, it allows opening files which aren't included in
> project-files without paying the further cost of running
> project--files-in-directory (which is what happens when passing
> INCLUDE-ALL=t to project-find-file).
> 
> Also, it may help with user confusion about why
> project-find-file doesn't behave like find-file.  (which I've
> encountered a few times)
> 
> This command is equivalent to C-x p o C-x C-f, but it's nice to
> be able to bind it to a specific key.
> 
> Overall, this is easy enough to provide, so let's just do that.

Makes sense, thanks, pushed to master (adding the 'interactive' form and 
a NEWS entry).

The name is a little verbose - if anybody has a better idea later, 
they're welcome to suggest it, there is some time to do a change.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73044; Package emacs. (Fri, 06 Sep 2024 17:45:02 GMT) Full text and rfc822 format available.

Message #13 received at 73044 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: sbaugh <at> janestreet.com, 73044 <at> debbugs.gnu.org
Subject: Re: bug#73044: [PATCH] Add project-find-file-in-root
Date: Fri, 06 Sep 2024 20:44:47 +0300
> Resent-To: bug-gnu-emacs <at> gnu.org
> Date: Fri, 6 Sep 2024 19:20:16 +0300
> From: Dmitry Gutov <dmitry <at> gutov.dev>
> 
> > This command is equivalent to C-x p o C-x C-f, but it's nice to
> > be able to bind it to a specific key.
> > 
> > Overall, this is easy enough to provide, so let's just do that.
> 
> Makes sense, thanks, pushed to master (adding the 'interactive' form and 
> a NEWS entry).

Thanks, but why only NEWS?  I think this should be in the user manual
as well.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73044; Package emacs. (Fri, 06 Sep 2024 20:06:01 GMT) Full text and rfc822 format available.

Message #16 received at 73044 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: sbaugh <at> janestreet.com, 73044 <at> debbugs.gnu.org
Subject: Re: bug#73044: [PATCH] Add project-find-file-in-root
Date: Fri, 6 Sep 2024 23:05:06 +0300
On 06/09/2024 20:44, Eli Zaretskii wrote:
>> Resent-To:bug-gnu-emacs <at> gnu.org
>> Date: Fri, 6 Sep 2024 19:20:16 +0300
>> From: Dmitry Gutov<dmitry <at> gutov.dev>
>>
>>> This command is equivalent to C-x p o C-x C-f, but it's nice to
>>> be able to bind it to a specific key.
>>>
>>> Overall, this is easy enough to provide, so let's just do that.
>> Makes sense, thanks, pushed to master (adding the 'interactive' form and
>> a NEWS entry).
> Thanks, but why only NEWS?  I think this should be in the user manual
> as well.

I don't know, to me it seems like a niche enough feature, having lived 
without this addition for a number of major releases.

Spencer seems to agree, having submitted the patch without a default 
binding.

But if someone wants to describe it in the manual, I of course wouldn't 
mind. They can mention the situations described in this report.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73044; Package emacs. (Sat, 07 Sep 2024 06:13:02 GMT) Full text and rfc822 format available.

Message #19 received at 73044 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: sbaugh <at> janestreet.com, 73044 <at> debbugs.gnu.org
Subject: Re: bug#73044: [PATCH] Add project-find-file-in-root
Date: Sat, 07 Sep 2024 09:10:36 +0300
> Date: Fri, 6 Sep 2024 23:05:06 +0300
> Cc: 73044 <at> debbugs.gnu.org, sbaugh <at> janestreet.com
> From: Dmitry Gutov <dmitry <at> gutov.dev>
> 
> On 06/09/2024 20:44, Eli Zaretskii wrote:
> >> Resent-To:bug-gnu-emacs <at> gnu.org
> >> Date: Fri, 6 Sep 2024 19:20:16 +0300
> >> From: Dmitry Gutov<dmitry <at> gutov.dev>
> >>
> >>> This command is equivalent to C-x p o C-x C-f, but it's nice to
> >>> be able to bind it to a specific key.
> >>>
> >>> Overall, this is easy enough to provide, so let's just do that.
> >> Makes sense, thanks, pushed to master (adding the 'interactive' form and
> >> a NEWS entry).
> > Thanks, but why only NEWS?  I think this should be in the user manual
> > as well.
> 
> I don't know, to me it seems like a niche enough feature, having lived 
> without this addition for a number of major releases.
> 
> Spencer seems to agree, having submitted the patch without a default 
> binding.
> 
> But if someone wants to describe it in the manual, I of course wouldn't 
> mind. They can mention the situations described in this report.

If you consider this not important enough to be in the manual, please
mark the NEWS entry with "---", to convey your opinion.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73044; Package emacs. (Sun, 08 Sep 2024 02:15:02 GMT) Full text and rfc822 format available.

Message #22 received at 73044 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: sbaugh <at> janestreet.com, 73044 <at> debbugs.gnu.org
Subject: Re: bug#73044: [PATCH] Add project-find-file-in-root
Date: Sun, 8 Sep 2024 05:14:30 +0300
On 07/09/2024 09:10, Eli Zaretskii wrote:
> If you consider this not important enough to be in the manual, please
> mark the NEWS entry with "---", to convey your opinion.

Added, thanks.

Also split the entry into two lines.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73044; Package emacs. (Sun, 15 Sep 2024 18:16:01 GMT) Full text and rfc822 format available.

Message #25 received at 73044 <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: 73044 <at> debbugs.gnu.org, dmitry <at> gutov.dev,  sbaugh <at> janestreet.com
Subject: Re: bug#73044: [PATCH] Add project-find-file-in-root
Date: Sun, 15 Sep 2024 19:14:40 +0100
Hello,

On Fri 06 Sep 2024 at 07:20pm +03, Dmitry Gutov wrote:

> The name is a little verbose - if anybody has a better idea later, they're
> welcome to suggest it, there is some time to do a change.

How about project-root-find-file ?

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73044; Package emacs. (Mon, 16 Sep 2024 23:14:02 GMT) Full text and rfc822 format available.

Message #28 received at 73044 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Sean Whitton <spwhitton <at> spwhitton.name>, 73044 <at> debbugs.gnu.org,
 sbaugh <at> janestreet.com
Subject: Re: bug#73044: [PATCH] Add project-find-file-in-root
Date: Tue, 17 Sep 2024 02:12:54 +0300
On 15/09/2024 21:14, Sean Whitton wrote:
> Hello,
> 
> On Fri 06 Sep 2024 at 07:20pm +03, Dmitry Gutov wrote:
> 
>> The name is a little verbose - if anybody has a better idea later, they're
>> welcome to suggest it, there is some time to do a change.
> 
> How about project-root-find-file ?

Nice! Renamed, thanks.

It does seem to create the necessary distinction.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 15 Oct 2024 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 247 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.