emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 r116998: * net/tramp-sh.el (tramp-sh-handle-file-


From: Michael Albinus
Subject: [Emacs-diffs] emacs-24 r116998: * net/tramp-sh.el (tramp-sh-handle-file-name-all-completions): Set
Date: Mon, 21 Apr 2014 21:04:38 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116998
revision-id: address@hidden
parent: address@hidden
committer: Michael Albinus <address@hidden>
branch nick: emacs-24
timestamp: Mon 2014-04-21 23:04:25 +0200
message:
  * 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.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/net/tramp-sh.el           trampsh.el-20100913133439-a1faifh29eqoi4nh-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-04-21 20:31:22 +0000
+++ b/lisp/ChangeLog    2014-04-21 21:04:25 +0000
@@ -1,3 +1,10 @@
+2014-04-21  Michael Albinus  <address@hidden>
+
+       * 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.
+
 2014-04-21  Stefan Monnier  <address@hidden>
 
        * progmodes/prog-mode.el (prettify-symbols--compose-symbol):

=== modified file 'lisp/net/tramp-sh.el'
--- a/lisp/net/tramp-sh.el      2014-04-20 21:35:55 +0000
+++ b/lisp/net/tramp-sh.el      2014-04-21 21:04:25 +0000
@@ -1725,6 +1725,15 @@
                                 'completion-ignore-case))
                              1 0)))
 
+             (tramp-message v 1 "Tramp test: %s" (tramp-get-ls-command v))
+             (tramp-send-command
+              v
+              (format "\\cd %s 2>&1 && %s %s -a 2>/dev/null"
+                      (tramp-shell-quote-argument localname)
+                      (tramp-get-ls-command v)
+                      (if (zerop (length filename))
+                          "."
+                        (concat (tramp-shell-quote-argument filename) "* 
-d"))))
               (format (concat
                        "(\\cd %s 2>&1 && (%s %s -a 2>/dev/null"
                        ;; `ls' with wildcard might fail with `Argument
@@ -1734,7 +1743,7 @@
                        ;; wildcard.  This will return "too many" entries
                        ;; but that isn't harmful.
                        " || %s -a 2>/dev/null)"
-                       " | while read f; do"
+                       " | while IFS= read f; do"
                        " if %s -d \"$f\" 2>/dev/null;"
                        " then \\echo \"$f/\"; else \\echo \"$f\"; fi; done"
                        " && \\echo ok) || \\echo fail")
@@ -1756,6 +1765,7 @@
 
            ;; Now grab the output.
            (with-current-buffer (tramp-get-buffer v)
+            (tramp-message v 1 "Tramp test: %s" (buffer-string))
              (goto-char (point-max))
 
              ;; Check result code, found in last line of output.
@@ -4966,12 +4976,6 @@
                      vec (format
                           "%s --color=never -al /dev/null" result))
                 (setq result (concat result " --color=never")))
-              ;; This should support file names with special
-              ;; characters.  If this option is not supported, such
-              ;; file names might fail.
-              (when (tramp-send-command-and-check
-                     vec (format "%s -b /dev/null" result))
-                (setq result (concat result " -b")))
               (throw 'ls-found result))
             (setq dl (cdr dl))))))
      (tramp-error vec 'file-error "Couldn't find a proper `ls' command"))))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]