diff options
| author | Michael Albinus | 2020-01-08 09:54:04 +0100 |
|---|---|---|
| committer | Michael Albinus | 2020-01-08 09:54:04 +0100 |
| commit | af5709f16b0aa21aea8158a953e9a5a803e61018 (patch) | |
| tree | 6483a5ab60b1a566a242cf80138aa80e7182cc02 | |
| parent | fb432446f5378b99e284e237cf1341600ddb1636 (diff) | |
| download | emacs-af5709f16b0aa21aea8158a953e9a5a803e61018.tar.gz emacs-af5709f16b0aa21aea8158a953e9a5a803e61018.zip | |
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.
| -rw-r--r-- | lisp/net/tramp.el | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index e0013def5d0..0ad65fb8bd0 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1330,8 +1330,7 @@ entry does not exist, return nil." | |||
| 1330 | t)) | 1330 | t)) |
| 1331 | 1331 | ||
| 1332 | ;; This function bypasses the file name handler approach. It is NOT | 1332 | ;; This function bypasses the file name handler approach. It is NOT |
| 1333 | ;; recommended to use it in any package if not absolutely necessary, | 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. | ||
| 1335 | ;; However, it is more performant than `file-local-name', and might be | 1334 | ;; However, it is more performant than `file-local-name', and might be |
| 1336 | ;; useful where performance matters, like in operations over a bulk | 1335 | ;; useful where performance matters, like in operations over a bulk |
| 1337 | ;; list of file names. | 1336 | ;; list of file names. |
| @@ -1340,13 +1339,13 @@ entry does not exist, return nil." | |||
| 1340 | This function removes from NAME the specification of the remote | 1339 | This function removes from NAME the specification of the remote |
| 1341 | host and the method of accessing the host, leaving only the part | 1340 | host and the method of accessing the host, leaving only the part |
| 1342 | that identifies NAME locally on the remote system. If NAME does | 1341 | that identifies NAME locally on the remote system. If NAME does |
| 1343 | not match `tramp-file-name-regexp', just NAME is returned. The | 1342 | not match `tramp-file-name-regexp', just `file-local-name' is |
| 1344 | returned file name can be used directly as argument of | 1343 | called. The returned file name can be used directly as argument |
| 1345 | `process-file', `start-file-process', or `shell-command'." | 1344 | of `process-file', `start-file-process', or `shell-command'." |
| 1346 | (or (and (tramp-tramp-file-p name) | 1345 | (or (and (tramp-tramp-file-p name) |
| 1347 | (string-match (nth 0 tramp-file-name-structure) name) | 1346 | (string-match (nth 0 tramp-file-name-structure) name) |
| 1348 | (match-string (nth 4 tramp-file-name-structure) name)) | 1347 | (match-string (nth 4 tramp-file-name-structure) name)) |
| 1349 | name)) | 1348 | (tramp-compat-file-local-name name))) |
| 1350 | 1349 | ||
| 1351 | (defun tramp-find-method (method user host) | 1350 | (defun tramp-find-method (method user host) |
| 1352 | "Return the right method string to use depending on USER and HOST. | 1351 | "Return the right method string to use depending on USER and HOST. |