]> git.eshelyaron.com Git - emacs.git/commitdiff
Revert patch in tramp-equal-remote
authorMichael Albinus <michael.albinus@gmx.de>
Sat, 24 Nov 2018 12:56:10 +0000 (13:56 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Sat, 24 Nov 2018 12:56:10 +0000 (13:56 +0100)
* lisp/net/tramp-sh.el (tramp-timeout-session):
Use `tramp-file-name-equal-p'.

* lisp/net/tramp.el (tramp-equal-remote): Revert patch.

lisp/net/tramp-sh.el
lisp/net/tramp.el

index 462ad83317ea02fc125f2a4694cd5815a5caa3e9..b5d4893580e5252361149999f9a3fd5e40132997 100644 (file)
@@ -4704,7 +4704,7 @@ Goes through the list `tramp-inline-compress-commands'."
   "Close the connection VEC after a session timeout.
 If there is just some editing, retry it after 5 seconds."
   (if (and tramp-locked tramp-locker
-          (tramp-equal-remote vec tramp-current-connection))
+          (tramp-file-name-equal-p vec (car tramp-current-connection)))
       (progn
        (tramp-message
         vec 5 "Cannot timeout session, trying it again in %s seconds." 5)
index 3fbc45f8c89341fcd4a8ee0bfaff20596d4a2d9f..fe0ba94f4c7bdb46c9f048e134f80a72013c4205 100644 (file)
@@ -1230,6 +1230,7 @@ If nil, return `tramp-default-port'."
   (or (tramp-file-name-port vec)
       (tramp-get-method-parameter vec 'tramp-default-port)))
 
+;; Comparision of file names is performed by `tramp-equal-remote'.
 (defun tramp-file-name-equal-p (vec1 vec2)
   "Check, whether VEC1 and VEC2 denote the same `tramp-file-name'."
   (and (tramp-file-name-p vec1) (tramp-file-name-p vec2)
@@ -4068,6 +4069,7 @@ If it doesn't exist, generate a new one."
   (with-tramp-connection-property (tramp-get-connection-process vec) "device"
     (cons -1 (setq tramp-devices (1+ tramp-devices)))))
 
+;; Comparision of vectors is performed by `tramp-file-name-equal-p'.
 (defun tramp-equal-remote (file1 file2)
   "Check, whether the remote parts of FILE1 and FILE2 are identical.
 The check depends on method, user and host name of the files.  If
@@ -4077,20 +4079,14 @@ account.
 
 Example:
 
-  (tramp-equal-remote \"/ssh::/etc\" \"/<your host name>:/home\")
+  (tramp-equal-remote \"/ssh::/etc\" \"/-:<your host name>:/home\")
 
 would yield t.  On the other hand, the following check results in nil:
 
-  (tramp-equal-remote \"/sudo::/etc\" \"/su::/etc\")
-
-FILE1 and FILE2 could also be Tramp vectors."
-  (or (and (tramp-tramp-file-p file1)
-          (tramp-tramp-file-p file2)
-          (string-equal (file-remote-p file1) (file-remote-p file2)))
-      (and (tramp-file-name-p file1)
-          (tramp-file-name-p file2)
-          (string-equal (tramp-make-tramp-file-name file1 'localname)
-                        (tramp-make-tramp-file-name file2 'localname)))))
+  (tramp-equal-remote \"/sudo::/etc\" \"/su::/etc\")"
+  (and (tramp-tramp-file-p file1)
+       (tramp-tramp-file-p file2)
+       (string-equal (file-remote-p file1) (file-remote-p file2))))
 
 ;;;###tramp-autoload
 (defun tramp-mode-string-to-int (mode-string)