aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2015-08-18 14:25:45 +0200
committerMichael Albinus2015-08-18 14:25:45 +0200
commitab759c2241e759ba7783323bbfef137bc0a08634 (patch)
treeeafc6954a386ef09cb9e313a9a0c06ce00cb8723
parent0e1711a0e29428173a743d38bfaba82fd56d77be (diff)
downloademacs-ab759c2241e759ba7783323bbfef137bc0a08634.tar.gz
emacs-ab759c2241e759ba7783323bbfef137bc0a08634.zip
Improve Tramp's compatibility
* lisp/net/tramp.el (tramp-get-method-parameter): * lisp/net/tramp-adb.el (tramp-adb-parse-device-names) (tramp-adb-get-device): * lisp/net/trampver.el (tramp-repository-get-version): Use `tramp-compat-replace-regexp-in-string'.
-rw-r--r--lisp/net/tramp-adb.el6
-rw-r--r--lisp/net/tramp.el3
-rw-r--r--lisp/net/trampver.el3
3 files changed, 7 insertions, 5 deletions
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index a8f52943f48..746bd675089 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -211,7 +211,7 @@ pass to the OPERATION."
211 (lambda (elt) 211 (lambda (elt)
212 (setcar 212 (setcar
213 (cdr elt) 213 (cdr elt)
214 (replace-regexp-in-string 214 (tramp-compat-replace-regexp-in-string
215 ":" tramp-prefix-port-format (car (cdr elt))))) 215 ":" tramp-prefix-port-format (car (cdr elt)))))
216 result) 216 result)
217 result)))) 217 result))))
@@ -1032,7 +1032,7 @@ E.g. a host name \"192.168.1.1#5555\" returns \"192.168.1.1:5555\"
1032 (host (tramp-file-name-host vec)) 1032 (host (tramp-file-name-host vec))
1033 (port (tramp-file-name-port vec)) 1033 (port (tramp-file-name-port vec))
1034 (devices (mapcar 'cadr (tramp-adb-parse-device-names nil)))) 1034 (devices (mapcar 'cadr (tramp-adb-parse-device-names nil))))
1035 (replace-regexp-in-string 1035 (tramp-compat-replace-regexp-in-string
1036 tramp-prefix-port-format ":" 1036 tramp-prefix-port-format ":"
1037 (cond ((member host devices) host) 1037 (cond ((member host devices) host)
1038 ;; This is the case when the host is connected to the default port. 1038 ;; This is the case when the host is connected to the default port.
@@ -1048,7 +1048,7 @@ E.g. a host name \"192.168.1.1#5555\" returns \"192.168.1.1:5555\"
1048 (not (zerop (length host))) 1048 (not (zerop (length host)))
1049 (not (tramp-adb-execute-adb-command 1049 (not (tramp-adb-execute-adb-command
1050 vec "connect" 1050 vec "connect"
1051 (replace-regexp-in-string 1051 (tramp-compat-replace-regexp-in-string
1052 tramp-prefix-port-format ":" host)))) 1052 tramp-prefix-port-format ":" host))))
1053 ;; When new device connected, running other adb command (e.g. 1053 ;; When new device connected, running other adb command (e.g.
1054 ;; adb shell) immediately will fail. To get around this 1054 ;; adb shell) immediately will fail. To get around this
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index e15732182d7..e534b5841b6 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1111,7 +1111,8 @@ If VEC is a vector, check first in connection properties.
1111Afterwards, check in `tramp-methods'. If the `tramp-methods' 1111Afterwards, check in `tramp-methods'. If the `tramp-methods'
1112entry does not exist, return nil." 1112entry does not exist, return nil."
1113 (let ((hash-entry 1113 (let ((hash-entry
1114 (replace-regexp-in-string "^tramp-" "" (symbol-name param)))) 1114 (tramp-compat-replace-regexp-in-string
1115 "^tramp-" "" (symbol-name param))))
1115 (if (tramp-connection-property-p vec hash-entry) 1116 (if (tramp-connection-property-p vec hash-entry)
1116 ;; We use the cached property. 1117 ;; We use the cached property.
1117 (tramp-get-connection-property vec hash-entry nil) 1118 (tramp-get-connection-property vec hash-entry nil)
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el
index 2f575f93037..ab671204e32 100644
--- a/lisp/net/trampver.el
+++ b/lisp/net/trampver.el
@@ -50,7 +50,8 @@
50 (ignore-errors 50 (ignore-errors
51 (call-process "git" nil '(t nil) nil "rev-parse" "HEAD"))) 51 (call-process "git" nil '(t nil) nil "rev-parse" "HEAD")))
52 (not (zerop (buffer-size))) 52 (not (zerop (buffer-size)))
53 (replace-regexp-in-string "\n" "" (buffer-string))))))))) 53 (tramp-compat-replace-regexp-in-string
54 "\n" "" (buffer-string)))))))))
54 55
55;; Check for (X)Emacs version. 56;; Check for (X)Emacs version.
56(let ((x (if (or (>= emacs-major-version 22) 57(let ((x (if (or (>= emacs-major-version 22)