emacs-diffs
[Top][All Lists]
Advanced

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

emacs-27 883b349: * lisp/net/tramp.el (tramp-file-local-name): Remove `s


From: Michael Albinus
Subject: emacs-27 883b349: * lisp/net/tramp.el (tramp-file-local-name): Remove `save-match-data'.
Date: Tue, 7 Jan 2020 07:10:48 -0500 (EST)

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

    * lisp/net/tramp.el (tramp-file-local-name): Remove `save-match-data'.
---
 lisp/net/tramp.el | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 52c6a9e..e0013de 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1339,14 +1339,14 @@ entry does not exist, return nil."
   "Return the local name component of NAME.
 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.  NAME must be
-a string that matches `tramp-file-name-regexp'.  The returned
-file name can be used directly as argument of `process-file',
-`start-file-process', or `shell-command'."
-  (save-match-data
-    (and (tramp-tramp-file-p name)
-         (string-match (nth 0 tramp-file-name-structure) name)
-         (match-string (nth 4 tramp-file-name-structure) name))))
+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'."
+  (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))
 
 (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]