emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-27 af5709f: Further enhancement on `tramp-file-local-name'


From: Michael Albinus
Subject: emacs-27 af5709f: Further enhancement on `tramp-file-local-name'
Date: Wed, 8 Jan 2020 03:54:13 -0500 (EST)

branch: emacs-27
commit af5709f16b0aa21aea8158a953e9a5a803e61018
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    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.
---
 lisp/net/tramp.el | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index e0013de..0ad65fb 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1330,8 +1330,7 @@ entry does not exist, return nil."
        t))
 
 ;; This function bypasses the file name handler approach.  It is NOT
-;; recommended to use it in any package if not absolutely necessary,
-;; because it won't work for remote file names not supported by Tramp.
+;; recommended to use it in any package if not absolutely necessary.
 ;; However, it is more performant than `file-local-name', and might be
 ;; useful where performance matters, like in operations over a bulk
 ;; list of file names.
@@ -1340,13 +1339,13 @@ entry does not exist, return nil."
 This function removes from NAME the specification of the remote
 host and the method of accessing the host, leaving only the part
 that identifies NAME locally on the remote system.  If NAME does
-not match `tramp-file-name-regexp', just NAME is returned.  The
-returned file name can be used directly as argument of
-`process-file', `start-file-process', or `shell-command'."
+not match `tramp-file-name-regexp', just `file-local-name' is
+called.  The returned file name can be used directly as argument
+of `process-file', `start-file-process', or `shell-command'."
   (or (and (tramp-tramp-file-p name)
            (string-match (nth 0 tramp-file-name-structure) name)
            (match-string (nth 4 tramp-file-name-structure) name))
-      name))
+      (tramp-compat-file-local-name name)))
 
 (defun tramp-find-method (method user host)
   "Return the right method string to use depending on USER and HOST.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]