1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

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.
This commit is contained in:
Michael Albinus 2018-02-28 15:10:11 +01:00
parent 172f7e5488
commit 51537b9e49
3 changed files with 8 additions and 6 deletions

View file

@ -458,7 +458,7 @@ pass to the OPERATION."
result)))))))))
(defun tramp-adb-get-ls-command (vec)
"Determine `ls' command at its arguments."
"Determine `ls' command and its arguments."
(with-tramp-connection-property vec "ls"
(tramp-message vec 5 "Finding a suitable `ls' command")
(cond

View file

@ -962,15 +962,16 @@ busybox awk '{}' </dev/null"
(defconst tramp-vc-registered-read-file-names
"echo \"(\"
while read file; do
quoted=`echo \"$file\" | sed -e \"s/\\\"/\\\\\\\\\\\\\\\\\\\"/\"`
if %s \"$file\"; then
echo \"(\\\"$file\\\" \\\"file-exists-p\\\" t)\"
echo \"(\\\"$quoted\\\" \\\"file-exists-p\\\" t)\"
else
echo \"(\\\"$file\\\" \\\"file-exists-p\\\" nil)\"
echo \"(\\\"$quoted\\\" \\\"file-exists-p\\\" nil)\"
fi
if %s \"$file\"; then
echo \"(\\\"$file\\\" \\\"file-readable-p\\\" t)\"
echo \"(\\\"$quoted\\\" \\\"file-readable-p\\\" t)\"
else
echo \"(\\\"$file\\\" \\\"file-readable-p\\\" nil)\"
echo \"(\\\"$quoted\\\" \\\"file-readable-p\\\" nil)\"
fi
done
echo \")\""
@ -2054,6 +2055,7 @@ file names."
(t2 (tramp-tramp-file-p newname))
(length (tramp-compat-file-attribute-size
(file-attributes (file-truename filename))))
;; `file-extended-attributes' exists since Emacs 24.4.
(attributes (and preserve-extended-attributes
(apply 'file-extended-attributes (list filename)))))

View file

@ -3564,7 +3564,7 @@ support symbolic links."
(concat (file-remote-p filename)
(substitute-in-file-name localname))))))
;; "/m:h:~" does not work for completion. We use "/m:h:~/".
(if (string-match "^~$" localname)
(if (and (stringp localname) (string-equal "~" localname))
(concat filename "/")
filename))))