aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2018-02-28 15:10:11 +0100
committerMichael Albinus2018-02-28 15:10:11 +0100
commit51537b9e4937d7853647871dc264f0be9412a9fa (patch)
treecc9f8bfcc19c240f606f1a29e453e3d08c3df5b6
parent172f7e5488ff91e2bef2d8217a91ffda0defb368 (diff)
downloademacs-51537b9e4937d7853647871dc264f0be9412a9fa.tar.gz
emacs-51537b9e4937d7853647871dc264f0be9412a9fa.zip
Some minor Tramp tweaks
* lisp/net/tramp-adb.el (tramp-adb-get-ls-command): Fix docstring. * lisp/net/tramp-sh.el (tramp-vc-registered-read-file-names): Quote file. * lisp/net/tramp.el (tramp-handle-substitute-in-file-name): Make it more robust.
-rw-r--r--lisp/net/tramp-adb.el2
-rw-r--r--lisp/net/tramp-sh.el10
-rw-r--r--lisp/net/tramp.el2
3 files changed, 8 insertions, 6 deletions
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index cb805067864..7ac61b843ff 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -458,7 +458,7 @@ pass to the OPERATION."
458 result))))))))) 458 result)))))))))
459 459
460(defun tramp-adb-get-ls-command (vec) 460(defun tramp-adb-get-ls-command (vec)
461 "Determine `ls' command at its arguments." 461 "Determine `ls' command and its arguments."
462 (with-tramp-connection-property vec "ls" 462 (with-tramp-connection-property vec "ls"
463 (tramp-message vec 5 "Finding a suitable `ls' command") 463 (tramp-message vec 5 "Finding a suitable `ls' command")
464 (cond 464 (cond
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index ff5d404aaac..f619ac30633 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -962,15 +962,16 @@ busybox awk '{}' </dev/null"
962(defconst tramp-vc-registered-read-file-names 962(defconst tramp-vc-registered-read-file-names
963 "echo \"(\" 963 "echo \"(\"
964while read file; do 964while read file; do
965 quoted=`echo \"$file\" | sed -e \"s/\\\"/\\\\\\\\\\\\\\\\\\\"/\"`
965 if %s \"$file\"; then 966 if %s \"$file\"; then
966 echo \"(\\\"$file\\\" \\\"file-exists-p\\\" t)\" 967 echo \"(\\\"$quoted\\\" \\\"file-exists-p\\\" t)\"
967 else 968 else
968 echo \"(\\\"$file\\\" \\\"file-exists-p\\\" nil)\" 969 echo \"(\\\"$quoted\\\" \\\"file-exists-p\\\" nil)\"
969 fi 970 fi
970 if %s \"$file\"; then 971 if %s \"$file\"; then
971 echo \"(\\\"$file\\\" \\\"file-readable-p\\\" t)\" 972 echo \"(\\\"$quoted\\\" \\\"file-readable-p\\\" t)\"
972 else 973 else
973 echo \"(\\\"$file\\\" \\\"file-readable-p\\\" nil)\" 974 echo \"(\\\"$quoted\\\" \\\"file-readable-p\\\" nil)\"
974 fi 975 fi
975done 976done
976echo \")\"" 977echo \")\""
@@ -2054,6 +2055,7 @@ file names."
2054 (t2 (tramp-tramp-file-p newname)) 2055 (t2 (tramp-tramp-file-p newname))
2055 (length (tramp-compat-file-attribute-size 2056 (length (tramp-compat-file-attribute-size
2056 (file-attributes (file-truename filename)))) 2057 (file-attributes (file-truename filename))))
2058 ;; `file-extended-attributes' exists since Emacs 24.4.
2057 (attributes (and preserve-extended-attributes 2059 (attributes (and preserve-extended-attributes
2058 (apply 'file-extended-attributes (list filename))))) 2060 (apply 'file-extended-attributes (list filename)))))
2059 2061
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index bae039dba13..60112392537 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3564,7 +3564,7 @@ support symbolic links."
3564 (concat (file-remote-p filename) 3564 (concat (file-remote-p filename)
3565 (substitute-in-file-name localname)))))) 3565 (substitute-in-file-name localname))))))
3566 ;; "/m:h:~" does not work for completion. We use "/m:h:~/". 3566 ;; "/m:h:~" does not work for completion. We use "/m:h:~/".
3567 (if (string-match "^~$" localname) 3567 (if (and (stringp localname) (string-equal "~" localname))
3568 (concat filename "/") 3568 (concat filename "/")
3569 filename)))) 3569 filename))))
3570 3570