bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#58447: [PATCH] In project-find-file, add absolute file name to histo


From: Juri Linkov
Subject: bug#58447: [PATCH] In project-find-file, add absolute file name to history
Date: Tue, 13 Dec 2022 19:28:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)

>>> Would you say the new behavior is worse than what we had before?
>>
>> Unfortunately, yes.  It turned out that it interferes too much
>> in normal workflows of using 'C-x p f'.  I suggest to keep
>> the history of 'C-x p f' with relative filenames intact,
>> and add absolute filenames to 'file-name-history' that already
>> contains absolute filenames.
>
> Until now, `C-x p f' and `C-x C-f' have always shared the same history
> variable, `file-name-history'.  Reverting this change to go back to the
> even more broken (IMO) behavior of adding relative file names to the
> history of `C-x C-f' et al.

I agree that the old behavior was broken, and the new fixes it,
but only for `C-x C-f', at the expense of `C-x p f'.

> How about computing the history of `C-x p f' dynamically by filtering
> the elements of `file-name-history' which belong to the current project?
> This is simpler than the other viable solution, to introduce
> project-dependent histories.

This makes sense.  OTOH, sometimes such a need arises to revisit
the same project-relative file in another directory tree
with a similar file structure.  For example, in the directory
with the Emacs master branch visit 'C-x p f lisp/progmodes/project.el'.
Then revisit the same file in the directory with the emacs-29 branch
with 'C-x p f M-p'.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]