emacs-diffs
[Top][All Lists]
Advanced

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

master 338409c1f19 1/2: Fix project-find-file history (with project--rea


From: Dmitry Gutov
Subject: master 338409c1f19 1/2: Fix project-find-file history (with project--read-file-cpd-relative)
Date: Wed, 20 Dec 2023 10:35:13 -0500 (EST)

branch: master
commit 338409c1f19e1d3a97d12edaf5ac36f1a781d08a
Author: Dmitry Gutov <dmitry@gutov.dev>
Commit: Dmitry Gutov <dmitry@gutov.dev>

    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))))



reply via email to

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