]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix project-find-file history (with project--read-file-cpd-relative)
authorDmitry Gutov <dmitry@gutov.dev>
Wed, 20 Dec 2023 15:20:26 +0000 (17:20 +0200)
committerDmitry Gutov <dmitry@gutov.dev>
Wed, 20 Dec 2023 15:20:26 +0000 (17:20 +0200)
* 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

index 0fa623616b6b85407ae6c8e552c37cb707bd8b72..f7e307515de5ccd86c8a78b3ac0ee92ab6ab73c2 100644 (file)
@@ -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))))