Skip to content

Commit af5709f

Browse files
committed
Further enhancement on `tramp-file-local-name'
* lisp/net/tramp.el (tramp-file-local-name): Call `file-local-name' if NAME is not a Tramp file name.
1 parent fb43244 commit af5709f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lisp/net/tramp.el

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,8 +1330,7 @@ entry does not exist, return nil."
13301330
t))
13311331

13321332
;; This function bypasses the file name handler approach. It is NOT
1333-
;; recommended to use it in any package if not absolutely necessary,
1334-
;; because it won't work for remote file names not supported by Tramp.
1333+
;; recommended to use it in any package if not absolutely necessary.
13351334
;; However, it is more performant than `file-local-name', and might be
13361335
;; useful where performance matters, like in operations over a bulk
13371336
;; list of file names.
@@ -1340,13 +1339,13 @@ entry does not exist, return nil."
13401339
This function removes from NAME the specification of the remote
13411340
host and the method of accessing the host, leaving only the part
13421341
that identifies NAME locally on the remote system. If NAME does
1343-
not match `tramp-file-name-regexp', just NAME is returned. The
1344-
returned file name can be used directly as argument of
1345-
`process-file', `start-file-process', or `shell-command'."
1342+
not match `tramp-file-name-regexp', just `file-local-name' is
1343+
called. The returned file name can be used directly as argument
1344+
of `process-file', `start-file-process', or `shell-command'."
13461345
(or (and (tramp-tramp-file-p name)
13471346
(string-match (nth 0 tramp-file-name-structure) name)
13481347
(match-string (nth 4 tramp-file-name-structure) name))
1349-
name))
1348+
(tramp-compat-file-local-name name)))
13501349

13511350
(defun tramp-find-method (method user host)
13521351
"Return the right method string to use depending on USER and HOST.

0 commit comments

Comments
 (0)