[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 0d518b78d78 2/2: project--read-file-cpd-relative: Don't abbreviat
From: |
Dmitry Gutov |
Subject: |
master 0d518b78d78 2/2: project--read-file-cpd-relative: Don't abbreviate at all |
Date: |
Wed, 20 Dec 2023 10:35:13 -0500 (EST) |
branch: master
commit 0d518b78d785613967fb1b375aa7932385991891
Author: Dmitry Gutov <dmitry@gutov.dev>
Commit: Dmitry Gutov <dmitry@gutov.dev>
project--read-file-cpd-relative: Don't abbreviate at all
* lisp/progmodes/project.el (project--read-file-cpd-relative):
Don't abbreviate at all, only suffixes are shown anyway.
And expand-file-name is slightly faster.
---
lisp/progmodes/project.el | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index f7e307515de..0082f12666a 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1145,15 +1145,15 @@ by the user at will."
(_ (when included-cpd
(setq substrings (cons "./" substrings))))
(new-collection (project--file-completion-table substrings))
- (abbr-cpd (abbreviate-file-name common-parent-directory))
- (abbr-cpd-length (length abbr-cpd))
+ (abs-cpd (expand-file-name common-parent-directory))
+ (abs-cpd-length (length abs-cpd))
(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))))
+ (setq s (expand-file-name s))
+ (and (string-prefix-p abs-cpd s)
+ (not (eq abs-cpd-length (length s)))
+ (list (substring s abs-cpd-length))))
(symbol-value hist))))
(project--completing-read-strict prompt
new-collection