* lisp/progmodes/project.el (project--read-file-cpd-relative): Optimize.
This commit is contained in:
parent
2b1fdbffcb
commit
cfbfd393b4
1 changed files with 3 additions and 2 deletions
|
@ -1040,13 +1040,14 @@ by the user at will."
|
||||||
(setq substrings (cons "./" substrings))))
|
(setq substrings (cons "./" substrings))))
|
||||||
(new-collection (project--file-completion-table substrings))
|
(new-collection (project--file-completion-table substrings))
|
||||||
(abbr-cpd (abbreviate-file-name common-parent-directory))
|
(abbr-cpd (abbreviate-file-name common-parent-directory))
|
||||||
|
(abbr-cpd-length (length abbr-cpd))
|
||||||
(relname (cl-letf ((history-add-new-input nil)
|
(relname (cl-letf ((history-add-new-input nil)
|
||||||
((symbol-value hist)
|
((symbol-value hist)
|
||||||
(mapcan
|
(mapcan
|
||||||
(lambda (s)
|
(lambda (s)
|
||||||
(and (string-prefix-p abbr-cpd s)
|
(and (string-prefix-p abbr-cpd s)
|
||||||
(not (eq (length abbr-cpd) (length s)))
|
(not (eq abbr-cpd-length (length s)))
|
||||||
(list (substring s (length abbr-cpd)))))
|
(list (substring s abbr-cpd-length))))
|
||||||
(symbol-value hist))))
|
(symbol-value hist))))
|
||||||
(project--completing-read-strict prompt
|
(project--completing-read-strict prompt
|
||||||
new-collection
|
new-collection
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue