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: Wed, 23 Jul 2008 19:17:06 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Michael Albinus <albinus>       08/07/23 19:17:05

Index: tramp.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/net/tramp.el,v
retrieving revision 1.204
retrieving revision 1.205
diff -u -b -r1.204 -r1.205
--- tramp.el    28 Jun 2008 10:16:37 -0000      1.204
+++ tramp.el    23 Jul 2008 19:17:05 -0000      1.205
@@ -282,7 +282,7 @@
             (tramp-copy-keep-date       t)
             (tramp-password-end-of-line nil))
     ("scp"   (tramp-login-program        "ssh")
-             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p")
+             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p") ("-q")
                                          ("-e" "none")))
             (tramp-remote-sh            "/bin/sh")
             (tramp-copy-program         "scp")
@@ -295,7 +295,7 @@
                                          ("-o" "StrictHostKeyChecking=no")))
             (tramp-default-port         22))
     ("scp1"  (tramp-login-program        "ssh")
-             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p")
+             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p") ("-q")
                                          ("-1" "-e" "none")))
             (tramp-remote-sh            "/bin/sh")
             (tramp-copy-program         "scp")
@@ -309,7 +309,7 @@
                                          ("-o" "StrictHostKeyChecking=no")))
             (tramp-default-port         22))
     ("scp2"  (tramp-login-program        "ssh")
-             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p")
+             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p") ("-q")
                                          ("-2" "-e" "none")))
             (tramp-remote-sh            "/bin/sh")
             (tramp-copy-program         "scp")
@@ -371,7 +371,7 @@
             (tramp-copy-keep-date       nil)
             (tramp-password-end-of-line nil))
     ("ssh"   (tramp-login-program        "ssh")
-             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p")
+             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p") ("-q")
                                          ("-e" "none")))
             (tramp-remote-sh            "/bin/sh")
             (tramp-copy-program         nil)
@@ -384,7 +384,7 @@
                                          ("-o" "StrictHostKeyChecking=no")))
             (tramp-default-port         22))
     ("ssh1"  (tramp-login-program        "ssh")
-             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p")
+             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p") ("-q")
                                          ("-1" "-e" "none")))
             (tramp-remote-sh            "/bin/sh")
             (tramp-copy-program         nil)
@@ -397,7 +397,7 @@
                                          ("-o" "StrictHostKeyChecking=no")))
             (tramp-default-port         22))
     ("ssh2"  (tramp-login-program        "ssh")
-             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p")
+             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p") ("-q")
                                          ("-2" "-e" "none")))
             (tramp-remote-sh            "/bin/sh")
             (tramp-copy-program         nil)
@@ -459,7 +459,7 @@
             (tramp-copy-keep-date       nil)
             (tramp-password-end-of-line nil))
     ("scpc"  (tramp-login-program        "ssh")
-             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p")
+             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p") ("-q")
                                          ("-o" "address@hidden:%%p")
                                          ("-o" "ControlMaster=yes")
                                          ("-e" "none")))
@@ -476,7 +476,7 @@
                                          ("-o" "StrictHostKeyChecking=no")))
             (tramp-default-port         22))
     ("scpx"  (tramp-login-program        "ssh")
-             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p")
+             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p") ("-q")
                                          ("-e" "none" "-t" "-t" "/bin/sh")))
             (tramp-remote-sh            "/bin/sh")
             (tramp-copy-program         "scp")
@@ -489,7 +489,7 @@
                                          ("-o" "StrictHostKeyChecking=no")))
             (tramp-default-port         22))
     ("sshx"  (tramp-login-program        "ssh")
-             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p")
+             (tramp-login-args           (("%h") ("-l" "%u") ("-p" "%p") ("-q")
                                          ("-e" "none" "-t" "-t" "/bin/sh")))
             (tramp-remote-sh            "/bin/sh")
             (tramp-copy-program         nil)
@@ -1076,6 +1076,10 @@
   :group 'tramp
   :type 'string)
 
+(defconst tramp-temp-buffer-name " *tramp temp*"
+  "Buffer name for a temporary buffer.
+It shall be used in combination with `generate-new-buffer-name'.")
+
 (defcustom tramp-sh-extra-args '(("/bash\\'" . "-norc -noprofile"))
   "*Alist specifying extra arguments to pass to the remote shell.
 Entries are (REGEXP . ARGS) where REGEXP is a regular expression
@@ -3674,12 +3678,13 @@
   (with-parsed-tramp-file-name default-directory nil
     (unwind-protect
        (progn
+         (unless buffer
+           ;; BUFFER can be nil.  We use a temporary buffer, which is
+           ;; killed in `tramp-process-sentinel'.
+           (setq buffer (generate-new-buffer tramp-temp-buffer-name)))
          ;; Set the new process properties.
          (tramp-set-connection-property v "process-name" name)
-         (tramp-set-connection-property
-          v "process-buffer"
-          ;; BUFFER can be nil.
-          (get-buffer-create (or buffer (current-buffer))))
+         (tramp-set-connection-property v "process-buffer" buffer)
          ;; Activate narrowing in order to save BUFFER contents.
          ;; Clear also the modification time; otherwise we might be
          ;; interrupted by `verify-visited-file-modtime'.
@@ -3693,10 +3698,9 @@
          ;; Send the command.
          (tramp-send-command
           v
-          (format "%s; echo %s; exit"
+          (format "exec %s"
                   (mapconcat 'tramp-shell-quote-argument
-                             (cons program args) " ")
-                  (tramp-shell-quote-argument tramp-end-of-output))
+                             (cons program args) " "))
           nil t) ; nooutput
          ;; Return process.
          (tramp-get-connection-process v))
@@ -5747,18 +5751,11 @@
   "Process sentinel for Tramp processes."
   (when (memq (process-status proc) '(stop exit signal))
     (tramp-flush-connection-property proc)
-    ;; The "Connection closed" and "exit" messages disturb the output
-    ;; for asynchronous processes.  That's why we have echoed the
-    ;; Tramp prompt at the end.  Trailing messages can be removed.
+    ;; Asynchronous processes might have a temporary buffer.  Kill it.
     (let ((buf (process-buffer proc)))
-      (when (buffer-live-p buf)
-        (with-current-buffer buf
-          (goto-char (point-max))
-          (re-search-backward
-           (mapconcat 'identity (split-string tramp-end-of-output "\n")
-                      "\r?\n")
-           (line-beginning-position -8) t)
-          (delete-region (point) (point-max)))))))
+      (when (and (buffer-live-p buf)
+                (string-match tramp-temp-buffer-name (buffer-name buf)))
+       (kill-buffer buf)))))
 
 (defun tramp-open-connection-setup-interactive-shell (proc vec)
   "Set up an interactive shell.
@@ -5857,7 +5854,8 @@
     (when (and (stringp old-uname) (not (string-equal old-uname new-uname)))
       (with-current-buffer (tramp-get-debug-buffer vec)
        ;; Keep the debug buffer
-       (rename-buffer " *temp*" 'unique)
+       (rename-buffer
+        (generate-new-buffer-name tramp-temp-buffer-name) 'unique)
        (funcall (symbol-function 'tramp-cleanup-connection) vec)
        (if (= (point-min) (point-max))
            (kill-buffer nil)
@@ -6351,7 +6349,7 @@
                      l-host (match-string 1 l-host)))
 
              ;; Set variables for computing the prompt for reading
-             ;; password.  They can also be derived from a gatewy.
+             ;; password.  They can also be derived from a gateway.
              (setq tramp-current-method (or g-method l-method)
                    tramp-current-user   (or g-user   l-user)
                    tramp-current-host   (or g-host   l-host))
@@ -7533,6 +7531,11 @@
 ;;   detects that the process "has died". (David Reitter)
 ;; * How can I interrupt the remote process with a signal
 ;;   (interrupt-process seems not to work)? (Markus Triska)
+;; * Avoid the local shell entirely for starting remote processes.  If
+;;   so, I think even a signal, when delivered directly to the local
+;;   SSH instance, would correctly be propagated to the remote process
+;;   automatically; possibly SSH would have to be started with
+;;   "-t". (Markus Triska)
 
 ;; Functions for file-name-handler-alist:
 ;; diff-latest-backup-file -- in diff.el




reply via email to

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