Hi! On 26/12/2023 15:06, Frédéric Giquel via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > Hi, > > Commits from last week on project.el > (338409c1f19e1d3a97d12edaf5ac36f1a781d08a and > 0d518b78d785613967fb1b375aa7932385991891) introduce problems when fileshistorycontainsTrampreference. > > Here is the procedure to repoduce : > - launch an 'emacs -Q' session > - eval (add-to-list 'file-name-history "/ssh:inaccessible-host:~/") to > add Tramp reference in file history > - open a local file from a project with 'find-file' > - do 'M-x project-find-file' > > This results in a 'Tramp failed to connect' error. If the host is > accessible, there is no error but we can see trace of an SSH connection > (with the associated latency). It's not something we expect when we're > working on an entirely local project. > > As far as I understand the 'project--read-file-cpd-relative' function, > a simple fix is to limit 'expand-file-name' to local files (as in the > attached patch). Thanks for the report. How about the attached patch instead? Skipping expand-file-name altogether would likely drop the respective entries from history as well. I'm curious whether expand-file-name hits the remote every time when called, though (100 times the latency would be a wait too long). If you have remote entries in history, could you try and see how the performance is when working on that remote, too?