From 5f9b29673fa29d27b7c165ecd5bbc7c3c06b138b Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sat, 24 Nov 2018 13:56:10 +0100 Subject: [PATCH] Revert patch in tramp-equal-remote * 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 | 2 +- lisp/net/tramp.el | 18 +++++++----------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 462ad83317e..b5d4893580e 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -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) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 3fbc45f8c89..fe0ba94f4c7 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -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\" \"/:/home\") + (tramp-equal-remote \"/ssh::/etc\" \"/-::/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) -- 2.39.5