aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMichael Albinus2008-07-26 18:43:51 +0000
committerMichael Albinus2008-07-26 18:43:51 +0000
commit6ce63faf376dee5929b533f924cbd6d62c530f8f (patch)
treedc02bd42e6bb5b0355aee9d03bb9f6a5ba1b6af2 /lisp
parent7ad8fe5e2876518a8f33b80050f98dab4ff78398 (diff)
downloademacs-6ce63faf376dee5929b533f924cbd6d62c530f8f.tar.gz
emacs-6ce63faf376dee5929b533f924cbd6d62c530f8f.zip
* net/tramp.el (tramp-handle-start-file-process): Set
query-on-exit flag. Kill temporary buffer. (tramp-process-sentinel): Remove defun. (tramp-do-copy-or-rename-file-out-of-band) (tramp-maybe-open-connection):Don't call it.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/net/tramp.el26
1 files changed, 10 insertions, 16 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 17cc5938042..a9c56fa5aea 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3311,7 +3311,6 @@ be a local filename. The method used must be an out-of-band method."
3311 (append copy-args (list source target)))))) 3311 (append copy-args (list source target))))))
3312 (tramp-message 3312 (tramp-message
3313 v 6 "%s" (mapconcat 'identity (process-command p) " ")) 3313 v 6 "%s" (mapconcat 'identity (process-command p) " "))
3314 (set-process-sentinel p 'tramp-process-sentinel)
3315 (tramp-set-process-query-on-exit-flag p nil) 3314 (tramp-set-process-query-on-exit-flag p nil)
3316 (tramp-process-actions p v tramp-actions-copy-out-of-band)))) 3315 (tramp-process-actions p v tramp-actions-copy-out-of-band))))
3317 3316
@@ -3680,8 +3679,7 @@ beginning of local filename are not substituted."
3680 (let ((name1 name) 3679 (let ((name1 name)
3681 (i 0)) 3680 (i 0))
3682 (unless buffer 3681 (unless buffer
3683 ;; BUFFER can be nil. We use a temporary buffer, which is 3682 ;; BUFFER can be nil. We use a temporary buffer.
3684 ;; killed in `tramp-process-sentinel'.
3685 (setq buffer (generate-new-buffer tramp-temp-buffer-name))) 3683 (setq buffer (generate-new-buffer tramp-temp-buffer-name)))
3686 (while (get-process name1) 3684 (while (get-process name1)
3687 ;; NAME must be unique as process name. 3685 ;; NAME must be unique as process name.
@@ -3708,12 +3706,19 @@ beginning of local filename are not substituted."
3708 (mapconcat 'tramp-shell-quote-argument 3706 (mapconcat 'tramp-shell-quote-argument
3709 (cons program args) " ")) 3707 (cons program args) " "))
3710 nil t) ; nooutput 3708 nil t) ; nooutput
3709 ;; Set query flag for this process.
3710 (tramp-set-process-query-on-exit-flag
3711 (tramp-get-connection-process v) t)
3711 ;; Return process. 3712 ;; Return process.
3712 (tramp-get-connection-process v)) 3713 (tramp-get-connection-process v))
3713 ;; Save exit. 3714 ;; Save exit.
3714 (with-current-buffer (tramp-get-connection-buffer v) 3715 (with-current-buffer (tramp-get-connection-buffer v)
3715 (widen) 3716 (if (string-match tramp-temp-buffer-name (buffer-name))
3716 (goto-char (point-max))) 3717 (progn
3718 (set-process-buffer (tramp-get-connection-process v) nil)
3719 (kill-buffer (current-buffer)))
3720 (widen)
3721 (goto-char (point-max))))
3717 (tramp-set-connection-property v "process-name" nil) 3722 (tramp-set-connection-property v "process-name" nil)
3718 (tramp-set-connection-property v "process-buffer" nil)))) 3723 (tramp-set-connection-property v "process-buffer" nil))))
3719 3724
@@ -5753,16 +5758,6 @@ seconds. If not, it produces an error message with the given ERROR-ARGS."
5753 'tramp-password-end-of-line) 5758 'tramp-password-end-of-line)
5754 tramp-default-password-end-of-line)))) 5759 tramp-default-password-end-of-line))))
5755 5760
5756(defun tramp-process-sentinel (proc event)
5757 "Process sentinel for Tramp processes."
5758 (when (memq (process-status proc) '(stop exit signal))
5759 (tramp-flush-connection-property proc)
5760 ;; Asynchronous processes might have a temporary buffer. Kill it.
5761 (let ((buf (process-buffer proc)))
5762 (when (and (buffer-live-p buf)
5763 (string-match tramp-temp-buffer-name (buffer-name buf)))
5764 (kill-buffer buf)))))
5765
5766(defun tramp-open-connection-setup-interactive-shell (proc vec) 5761(defun tramp-open-connection-setup-interactive-shell (proc vec)
5767 "Set up an interactive shell. 5762 "Set up an interactive shell.
5768Mainly sets the prompt and the echo correctly. PROC is the shell 5763Mainly sets the prompt and the echo correctly. PROC is the shell
@@ -6306,7 +6301,6 @@ connection if a previous connection has died for some reason."
6306 vec 6 "%s" (mapconcat 'identity (process-command p) " ")) 6301 vec 6 "%s" (mapconcat 'identity (process-command p) " "))
6307 6302
6308 ;; Check whether process is alive. 6303 ;; Check whether process is alive.
6309 (set-process-sentinel p 'tramp-process-sentinel)
6310 (tramp-set-process-query-on-exit-flag p nil) 6304 (tramp-set-process-query-on-exit-flag p nil)
6311 (tramp-message vec 3 "Waiting 60s for local shell to come up...") 6305 (tramp-message vec 3 "Waiting 60s for local shell to come up...")
6312 (tramp-barf-if-no-shell-prompt 6306 (tramp-barf-if-no-shell-prompt