unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dmitry@gutov.dev>
To: sbaugh@catern.com
Cc: Spencer Baugh <sbaugh@janestreet.com>, 64088-done@debbugs.gnu.org
Subject: bug#64088: [PATCH] Make project-root for vc projects return an absolute path
Date: Wed, 23 Aug 2023 03:24:02 +0300	[thread overview]
Message-ID: <3d4d2e2c-0ed1-6998-694d-dcc08b2ec837@gutov.dev> (raw)
In-Reply-To: <87lee7gpg1.fsf@catern.com>

On 19/08/2023 15:57, sbaugh@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 ;-)





      reply	other threads:[~2023-08-23  0:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15 20:48 bug#64088: [PATCH] Make project-root for vc projects return an absolute path Spencer Baugh
2023-06-16  5:52 ` Eli Zaretskii
2023-06-17  2:43   ` Dmitry Gutov
2023-06-17  6:25     ` Eli Zaretskii
2023-06-18  0:43       ` Dmitry Gutov
2023-06-17  2:47 ` Dmitry Gutov
2023-06-27 20:01   ` Spencer Baugh
2023-07-10  2:17     ` Dmitry Gutov
2023-07-10 23:45       ` Spencer Baugh
2023-08-12  0:45         ` Dmitry Gutov
2023-08-19 12:31           ` sbaugh
2023-08-19 12:57             ` sbaugh
2023-08-23  0:24               ` Dmitry Gutov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3d4d2e2c-0ed1-6998-694d-dcc08b2ec837@gutov.dev \
    --to=dmitry@gutov.dev \
    --cc=64088-done@debbugs.gnu.org \
    --cc=sbaugh@catern.com \
    --cc=sbaugh@janestreet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).