GNU bug report logs - #64088
[PATCH] Make project-root for vc projects return an absolute path

Previous Next

Package: emacs;

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

Date: Thu, 15 Jun 2023 20:49:02 UTC

Severity: normal

Tags: patch

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

Bug is archived. No further changes may be made.

Full log


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

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: sbaugh <at> catern.com
Cc: Spencer Baugh <sbaugh <at> janestreet.com>, 64088-done <at> debbugs.gnu.org
Subject: Re: bug#64088: [PATCH] Make project-root for vc projects return an
 absolute path
Date: Wed, 23 Aug 2023 03:24:02 +0300
On 19/08/2023 15:57, sbaugh <at> catern.com wrote:
>>> Meaning it will be called N times (for the number of projects) every
>>> time the list is displayed, instead of just once, when the project is
>>> saved/visited. But maybe it's fine too? How slow could that be?
>> I was sad about this but I think I've got the solution now: We just
>> maintain project--list in abbreviated form and project-list-file in
>> expanded form.

Here's something else I thought of: project--write-project-list is 
called every time a different project is returned by (project-current t) 
-- i.e. when MAYBE-PROMPT=t, and when the found dir is not at the top of 
the project history already.

So under certain conditions (slow CPU/spinning media/long project 
history) it might slow down (project-current t) calls. In my testing 
it's totally fine, though, and there are possible mitigations (limit the 
history and/or move saving to kill-hook). Just something to keep in mind.

>> I think that solves all the problems: the persistent file is independent
>> of user configuration, so if the user changes their abbreviations
>> they'll get new ones the next time the file is read (presumably the next
>> time they run Emacs).  But project--list is abbreviated, so
>> project-prompt-project-dir gets abbreviated dirs.
>>
>> It does mean that if they change their directory-abbrev-alist while
>> Emacs is running they could get duplicate entries, but that already
>> could happen before this patch, and it's not a big problem IMO.
>>
>> See patch below.
> Oops, this patch needed a few tweaks.  Especially, skipping the
> expansion and abbreviation for remote files, to avoid making unnecesary
> remote connections.

Thanks! Pushed to master, and finally closing ;-)




This bug report was last modified 1 year and 331 days ago.

Previous Next


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