emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/net/tramp.el,v


From: Michael Albinus
Subject: [Emacs-diffs] Changes to emacs/lisp/net/tramp.el,v
Date: Tue, 29 Jan 2008 21:14:05 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Michael Albinus <albinus>       08/01/29 21:14:04

Index: tramp.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/net/tramp.el,v
retrieving revision 1.173
retrieving revision 1.174
diff -u -b -r1.173 -r1.174
--- tramp.el    28 Jan 2008 21:24:48 -0000      1.173
+++ tramp.el    29 Jan 2008 21:14:04 -0000      1.174
@@ -441,7 +441,7 @@
             (tramp-password-end-of-line nil))
     ("sudo"  (tramp-login-program        "sudo")
              (tramp-login-args           (("-u" "%u")
-                                         ("-s" "-p" "Password:")))
+                                         ("-s") ("-H") ("-p" "Password:")))
             (tramp-remote-sh            "/bin/sh")
             (tramp-copy-program         nil)
             (tramp-copy-args            nil)
@@ -519,7 +519,9 @@
             (tramp-default-port         22))
     ("plinkx"
              (tramp-login-program        "plink")
-            (tramp-login-args           (("-load" "%h") ("-t")
+            ;; ("%h") must be a single element, see
+            ;; `tramp-compute-multi-hops'.
+            (tramp-login-args           (("-load") ("%h") ("-t")
                                          (,(format
                                             "env 'TERM=%s' 'PROMPT_COMMAND=' 
'PS1=$ '"
                                             tramp-terminal-type))
@@ -3789,7 +3791,7 @@
           ((bufferp output-buffer) output-buffer)
           ((stringp output-buffer) (get-buffer-create output-buffer))
           (output-buffer (current-buffer))
-          (t (generate-new-buffer
+          (t (get-buffer-create
               (if asynchronous
                   "*Async Shell Command*"
                 "*Shell Command Output*")))))
@@ -3801,22 +3803,42 @@
          (if (and (not asynchronous) error-buffer)
              (with-parsed-tramp-file-name default-directory nil
                (list output-buffer (tramp-make-tramp-temp-file v)))
-           output-buffer)))
+           output-buffer))
+        (proc (get-buffer-process output-buffer)))
 
+    ;; Check whether there is another process running.  Tramp does not
+    ;; support 2 (asynchronous) processes in parallel.
+    (when proc
+      (if (yes-or-no-p "A command is running.  Kill it? ")
+         (ignore-errors (kill-process proc))
+       (error "Shell command in progress")))
+
+    (with-current-buffer output-buffer
+      (setq buffer-read-only nil
+           buffer-undo-list t)
+      (erase-buffer))
+
+    (if (integerp asynchronous)
     (prog1
        ;; Run the process.
-       (if (integerp asynchronous)
            (apply 'start-file-process "*Async Shell*" buffer args)
-         (apply 'process-file (car args) nil buffer nil (cdr args)))
+         ;; Display output.
+         (pop-to-buffer output-buffer))
+
+      (prog1
+         ;; Run the process.
+         (apply 'process-file (car args) nil buffer nil (cdr args))
       ;; Insert error messages if they were separated.
       (when (listp buffer)
-       (with-current-buffer error-buffer (insert-file-contents (cadr buffer)))
+         (with-current-buffer error-buffer
+           (insert-file-contents (cadr buffer)))
        (delete-file (cadr buffer)))
       ;; There's some output, display it.
       (when (with-current-buffer output-buffer (> (point-max) (point-min)))
        (if (functionp 'display-message-or-buffer)
-           (funcall (symbol-function 'display-message-or-buffer) output-buffer)
-         (pop-to-buffer output-buffer))))))
+             (funcall (symbol-function 'display-message-or-buffer)
+                      output-buffer)
+           (pop-to-buffer output-buffer)))))))
 
 ;; File Editing.
 
@@ -6073,7 +6095,9 @@
            (concat "^" (regexp-opt (list "localhost" (system-name)) t) "$")
            host))
        (tramp-error
-        v 'file-error "Wrong hostname `%s' for method `%s'" host method)))
+        v 'file-error
+        "Host `%s' looks like a remote host, `%s' can only use the local host"
+        host method)))
 
     ;; Result.
     target-alist))




reply via email to

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