lisp/net/tramp.el: Fix performance regression with completions
* lisp/net/tramp.el (tramp-skeleton-file-name-all-completions): Use `file-directory-p' directly instead of calling `file-symlink-p' and file-truename first. Since `file-directory-p' already follows symlinks, symlinked directories are handled correctly without the extra indirection.
This commit is contained in:
committed by
Michael Albinus
parent
5bd8f3a44a
commit
358a7ba0f6
@@ -3027,16 +3027,14 @@ BODY is the backend specific code."
|
||||
(format
|
||||
"file-name-all-completions-%s"
|
||||
tramp-fnac-add-trailing-slash)
|
||||
;; Mark symlinked directories. Other
|
||||
;; directories are already marked.
|
||||
;; Mark directories, including symlinks to
|
||||
;; directories.
|
||||
(mapcar
|
||||
(lambda (x)
|
||||
(let ((f (file-name-concat ,directory x)))
|
||||
(if (and tramp-fnac-add-trailing-slash
|
||||
(not (string-suffix-p "/" x))
|
||||
(file-directory-p
|
||||
(if (file-symlink-p f)
|
||||
(file-truename f) f)))
|
||||
(file-directory-p f))
|
||||
(concat x "/") x)))
|
||||
;; Some storage systems do not return "." and "..".
|
||||
(seq-union
|
||||
|
||||
Reference in New Issue
Block a user