emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r100831: * net/tramp.el (tramp-handle


From: Michael Albinus
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r100831: * net/tramp.el (tramp-handle-shell-command): Don't use hard-wired
Date: Fri, 16 Jul 2010 14:09:55 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100831
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Fri 2010-07-16 14:09:55 +0200
message:
  * net/tramp.el (tramp-handle-shell-command): Don't use hard-wired
  "/bin/sh" but `tramp-remote-sh' from `tramp-methods'.
  (tramp-find-shell): Simplify setting connection property.
  (tramp-get-ls-command): Make test for "--color=never" stronger.
modified:
  lisp/ChangeLog
  lisp/net/tramp.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-07-15 14:36:27 +0000
+++ b/lisp/ChangeLog    2010-07-16 12:09:55 +0000
@@ -1,3 +1,10 @@
+2010-07-16  Michael Albinus  <address@hidden>
+
+       * net/tramp.el (tramp-handle-shell-command): Don't use hard-wired
+       "/bin/sh" but `tramp-remote-sh' from `tramp-methods'.
+       (tramp-find-shell): Simplify setting connection property.
+       (tramp-get-ls-command): Make test for "--color=never" stronger.
+
 2010-07-15  Simon South  <address@hidden>
 
        * progmodes/delphi.el (delphi-previous-indent-of): Indent case

=== modified file 'lisp/net/tramp.el'
--- a/lisp/net/tramp.el 2010-06-12 08:59:37 +0000
+++ b/lisp/net/tramp.el 2010-07-16 12:09:55 +0000
@@ -4683,7 +4683,12 @@
   (let* ((asynchronous (string-match "[ \t]*&[ \t]*\\'" command))
         ;; We cannot use `shell-file-name' and `shell-command-switch',
         ;; they are variables of the local host.
-        (args (list "/bin/sh" "-c" (substring command 0 asynchronous)))
+        (args (list
+               (tramp-get-method-parameter
+                (tramp-file-name-method
+                 (tramp-dissect-file-name default-directory))
+                'tramp-remote-sh)
+               "-c" (substring command 0 asynchronous)))
         current-buffer-p
         (output-buffer
          (cond
@@ -6619,12 +6624,10 @@
 
         (t (tramp-message
             vec 5 "Remote `%s' groks tilde expansion, good"
-            (tramp-get-method-parameter
-             (tramp-file-name-method vec) 'tramp-remote-sh))
-           (tramp-set-connection-property
-            vec "remote-shell"
-            (tramp-get-method-parameter
-             (tramp-file-name-method vec) 'tramp-remote-sh))))))))
+            (tramp-set-connection-property
+             vec "remote-shell"
+             (tramp-get-method-parameter
+              (tramp-file-name-method vec) 'tramp-remote-sh)))))))))
 
 ;; ------------------------------------------------------------
 ;; -- Functions for establishing connection --
@@ -8316,10 +8319,13 @@
             ;; Check parameters.  On busybox, "ls" output coloring is
             ;; enabled by default sometimes.  So we try to disable it
             ;; when possible.  $LS_COLORING is not supported there.
+            ;; Some "ls" versions are sensible wrt the order of
+            ;; arguments, they fail when "-al" is after the
+            ;; "--color=never" argument (for example on FreeBSD).
             (when (zerop (tramp-send-command-and-check
                           vec (format "%s -lnd /" result)))
               (when (zerop (tramp-send-command-and-check
-                            vec (format "%s --color=never /" result)))
+                            vec (format "%s --color=never -al /" result)))
                 (setq result (concat result " --color=never")))
               (throw 'ls-found result))
             (setq dl (cdr dl))))))


reply via email to

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