From 338409c1f19e1d3a97d12edaf5ac36f1a781d08a Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Wed, 20 Dec 2023 17:20:26 +0200 Subject: [PATCH] Fix project-find-file history (with project--read-file-cpd-relative) * lisp/progmodes/project.el (project--transplant-file-name): Don't abbreviate here (bug#67901, bug#63829). (project--read-file-cpd-relative): Do it here instead. The reader functions should decide on the preferred format themselves. --- lisp/progmodes/project.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 0fa623616b6..f7e307515de 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1110,10 +1110,9 @@ This has the effect of sharing more history between projects." (defun project--transplant-file-name (filename project) (when-let ((old-root (get-text-property 0 'project filename))) - (abbreviate-file-name - (expand-file-name - (file-relative-name filename old-root) - (project-root project))))) + (expand-file-name + (file-relative-name filename old-root) + (project-root project)))) (defun project--read-file-cpd-relative (prompt all-files &optional predicate @@ -1151,6 +1150,7 @@ by the user at will." (relname (cl-letf (((symbol-value hist) (mapcan (lambda (s) + (setq s (abbreviate-file-name s)) (and (string-prefix-p abbr-cpd s) (not (eq abbr-cpd-length (length s))) (list (substring s abbr-cpd-length)))) -- 2.39.5