aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2023-08-12 03:58:53 +0300
committerDmitry Gutov2023-08-12 03:58:53 +0300
commit28ae8440c62c71da2ef7e30c73333bc5a51efba6 (patch)
treefdaa981a303f2ceae20466c771c1d137945b0e5b
parent0bd58dd2d605d5237483960c283e9e24706894e4 (diff)
downloademacs-28ae8440c62c71da2ef7e30c73333bc5a51efba6.tar.gz
emacs-28ae8440c62c71da2ef7e30c73333bc5a51efba6.zip
Unbreak project-find-file's future history when cpd is not root
* lisp/progmodes/project.el (project-find-file): Pass in buffer-file-name as absolute name (bug#63829). (project--read-file-cpd-relative): Make it relative to the appropriate common parent dir.
-rw-r--r--lisp/progmodes/project.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 24531d9d02e..fe13f4ab114 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1005,7 +1005,7 @@ for VCS directories listed in `vc-directory-exclusion-list'."
1005 (dirs (list root))) 1005 (dirs (list root)))
1006 (project-find-file-in 1006 (project-find-file-in
1007 (or (thing-at-point 'filename) 1007 (or (thing-at-point 'filename)
1008 (and buffer-file-name (file-relative-name buffer-file-name root))) 1008 buffer-file-name)
1009 dirs pr include-all))) 1009 dirs pr include-all)))
1010 1010
1011;;;###autoload 1011;;;###autoload
@@ -1058,6 +1058,11 @@ by the user at will."
1058 (setq all-files 1058 (setq all-files
1059 (delete common-parent-directory all-files)) 1059 (delete common-parent-directory all-files))
1060 t)) 1060 t))
1061 (mb-default (if (and common-parent-directory
1062 mb-default
1063 (file-name-absolute-p mb-default))
1064 (file-relative-name mb-default common-parent-directory)
1065 mb-default))
1061 (substrings (mapcar (lambda (s) (substring s cpd-length)) all-files)) 1066 (substrings (mapcar (lambda (s) (substring s cpd-length)) all-files))
1062 (_ (when included-cpd 1067 (_ (when included-cpd
1063 (setq substrings (cons "./" substrings)))) 1068 (setq substrings (cons "./" substrings))))