From: Dmitry Gutov Date: Wed, 20 Dec 2023 15:20:26 +0000 (+0200) Subject: Fix project-find-file history (with project--read-file-cpd-relative) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=338409c1f19e1d3a97d12edaf5ac36f1a781d08a;p=emacs.git 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. --- 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))))