aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2014-04-21 23:04:25 +0200
committerMichael Albinus2014-04-21 23:04:25 +0200
commit505fa2ab43f38f623fb8f1653371a3a35d5d4b7f (patch)
treec0d6799234d25bf07123e18f2b33ad78fe360e78
parentf0ffb9b76754ef7dcc4842e969aa16d451f117e9 (diff)
downloademacs-505fa2ab43f38f623fb8f1653371a3a35d5d4b7f.tar.gz
emacs-505fa2ab43f38f623fb8f1653371a3a35d5d4b7f.zip
* net/tramp-sh.el (tramp-sh-handle-file-name-all-completions): Set
"IFS=" when using read builtin, in order to preserve spaces in the file name. Add test messages for hunting a bug on hydra. (tramp-get-ls-command): Undo using "-b" argument. It doesn't help.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/net/tramp-sh.el18
2 files changed, 18 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f9d9521e412..c1aef0c0f90 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12014-04-21 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp-sh.el (tramp-sh-handle-file-name-all-completions): Set
4 "IFS=" when using read builtin, in order to preserve spaces in
5 the file name. Add test messages for hunting a bug on hydra.
6 (tramp-get-ls-command): Undo using "-b" argument. It doesn't help.
7
12014-04-21 Stefan Monnier <monnier@iro.umontreal.ca> 82014-04-21 Stefan Monnier <monnier@iro.umontreal.ca>
2 9
3 * progmodes/prog-mode.el (prettify-symbols--compose-symbol): 10 * progmodes/prog-mode.el (prettify-symbols--compose-symbol):
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 0dd5b79be92..ac57cbb2780 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1725,6 +1725,15 @@ be non-negative integers."
1725 'completion-ignore-case)) 1725 'completion-ignore-case))
1726 1 0))) 1726 1 0)))
1727 1727
1728 (tramp-message v 1 "Tramp test: %s" (tramp-get-ls-command v))
1729 (tramp-send-command
1730 v
1731 (format "\\cd %s 2>&1 && %s %s -a 2>/dev/null"
1732 (tramp-shell-quote-argument localname)
1733 (tramp-get-ls-command v)
1734 (if (zerop (length filename))
1735 "."
1736 (concat (tramp-shell-quote-argument filename) "* -d"))))
1728 (format (concat 1737 (format (concat
1729 "(\\cd %s 2>&1 && (%s %s -a 2>/dev/null" 1738 "(\\cd %s 2>&1 && (%s %s -a 2>/dev/null"
1730 ;; `ls' with wildcard might fail with `Argument 1739 ;; `ls' with wildcard might fail with `Argument
@@ -1734,7 +1743,7 @@ be non-negative integers."
1734 ;; wildcard. This will return "too many" entries 1743 ;; wildcard. This will return "too many" entries
1735 ;; but that isn't harmful. 1744 ;; but that isn't harmful.
1736 " || %s -a 2>/dev/null)" 1745 " || %s -a 2>/dev/null)"
1737 " | while read f; do" 1746 " | while IFS= read f; do"
1738 " if %s -d \"$f\" 2>/dev/null;" 1747 " if %s -d \"$f\" 2>/dev/null;"
1739 " then \\echo \"$f/\"; else \\echo \"$f\"; fi; done" 1748 " then \\echo \"$f/\"; else \\echo \"$f\"; fi; done"
1740 " && \\echo ok) || \\echo fail") 1749 " && \\echo ok) || \\echo fail")
@@ -1756,6 +1765,7 @@ be non-negative integers."
1756 1765
1757 ;; Now grab the output. 1766 ;; Now grab the output.
1758 (with-current-buffer (tramp-get-buffer v) 1767 (with-current-buffer (tramp-get-buffer v)
1768 (tramp-message v 1 "Tramp test: %s" (buffer-string))
1759 (goto-char (point-max)) 1769 (goto-char (point-max))
1760 1770
1761 ;; Check result code, found in last line of output. 1771 ;; Check result code, found in last line of output.
@@ -4966,12 +4976,6 @@ Return ATTR."
4966 vec (format 4976 vec (format
4967 "%s --color=never -al /dev/null" result)) 4977 "%s --color=never -al /dev/null" result))
4968 (setq result (concat result " --color=never"))) 4978 (setq result (concat result " --color=never")))
4969 ;; This should support file names with special
4970 ;; characters. If this option is not supported, such
4971 ;; file names might fail.
4972 (when (tramp-send-command-and-check
4973 vec (format "%s -b /dev/null" result))
4974 (setq result (concat result " -b")))
4975 (throw 'ls-found result)) 4979 (throw 'ls-found result))
4976 (setq dl (cdr dl)))))) 4980 (setq dl (cdr dl))))))
4977 (tramp-error vec 'file-error "Couldn't find a proper `ls' command")))) 4981 (tramp-error vec 'file-error "Couldn't find a proper `ls' command"))))