aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/net/tramp.el48
2 files changed, 33 insertions, 22 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b7cce56092e..db118187f1d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12007-01-09 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
4 (tramp-process-actions): Add optional parameter TIMEOUT.
5 (tramp-open-connection-telnet, tramp-open-connection-rsh)
6 (tramp-open-connection-su): Add timeout of 60".
7
12007-01-09 Richard Stallman <rms@gnu.org> 82007-01-09 Richard Stallman <rms@gnu.org>
2 9
3 * progmodes/compile.el (compile): Doc fix. 10 * progmodes/compile.el (compile): Doc fix.
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 822a995230e..4d3ee29c4d6 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -2,7 +2,7 @@
2;;; tramp.el --- Transparent Remote Access, Multiple Protocol 2;;; tramp.el --- Transparent Remote Access, Multiple Protocol
3 3
4;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 4;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
5;; 2005, 2006 Free Software Foundation, Inc. 5;; 2005, 2006, 2007 Free Software Foundation, Inc.
6 6
7;; Author: Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net> 7;; Author: Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net>
8;; Michael Albinus <michael.albinus@gmx.de> 8;; Michael Albinus <michael.albinus@gmx.de>
@@ -5540,32 +5540,36 @@ The terminal type can be configured with `tramp-terminal-type'."
5540 (let (found item pattern action todo) 5540 (let (found item pattern action todo)
5541 (erase-buffer) 5541 (erase-buffer)
5542 (tramp-message 9 "Waiting 60s for prompt from remote shell") 5542 (tramp-message 9 "Waiting 60s for prompt from remote shell")
5543 (with-timeout (60 (throw 'tramp-action 'timeout)) 5543 (while (not found)
5544 (while (not found) 5544 (tramp-accept-process-output p 1)
5545 (tramp-accept-process-output p 1) 5545 (goto-char (point-min))
5546 (setq todo actions)
5547 (while todo
5546 (goto-char (point-min)) 5548 (goto-char (point-min))
5547 (setq todo actions) 5549 (setq item (pop todo))
5548 (while todo 5550 (setq pattern (symbol-value (nth 0 item)))
5549 (goto-char (point-min)) 5551 (setq action (nth 1 item))
5550 (setq item (pop todo)) 5552 (tramp-message 10 "Looking for regexp \"%s\" from remote shell"
5551 (setq pattern (symbol-value (nth 0 item))) 5553 pattern)
5552 (setq action (nth 1 item)) 5554 (when (re-search-forward (concat pattern "\\'") nil t)
5553 (tramp-message 10 "Looking for regexp \"%s\" from remote shell" 5555 (setq found (funcall action p multi-method method user host)))))
5554 pattern) 5556 found))
5555 (when (re-search-forward (concat pattern "\\'") nil t)
5556 (setq found (funcall action p multi-method method user host)))))
5557 found)))
5558 5557
5559(defun tramp-process-actions (p multi-method method user host actions) 5558(defun tramp-process-actions
5560 "Perform actions until success." 5559 (p multi-method method user host actions &optional timeout)
5560 "Perform actions until success or TIMEOUT."
5561 (tramp-message 10 "%s" (mapconcat 'identity (process-command p) " ")) 5561 (tramp-message 10 "%s" (mapconcat 'identity (process-command p) " "))
5562 (let (exit) 5562 (let (exit)
5563 (while (not exit) 5563 (while (not exit)
5564 (tramp-message 9 "Waiting for prompts from remote shell") 5564 (tramp-message 9 "Waiting for prompts from remote shell")
5565 (setq exit 5565 (setq exit
5566 (catch 'tramp-action 5566 (catch 'tramp-action
5567 (tramp-process-one-action 5567 (if timeout
5568 p multi-method method user host actions) 5568 (with-timeout (timeout)
5569 (tramp-process-one-action
5570 p multi-method method user host actions))
5571 (tramp-process-one-action
5572 p multi-method method user host actions))
5569 nil))) 5573 nil)))
5570 (unless (eq exit 'ok) 5574 (unless (eq exit 'ok)
5571 (tramp-clear-passwd user host) 5575 (tramp-clear-passwd user host)
@@ -5689,7 +5693,7 @@ Maybe the different regular expressions need to be tuned.
5689 (set-buffer (tramp-get-buffer multi-method method user host)) 5693 (set-buffer (tramp-get-buffer multi-method method user host))
5690 (erase-buffer) 5694 (erase-buffer)
5691 (tramp-process-actions p multi-method method user host 5695 (tramp-process-actions p multi-method method user host
5692 tramp-actions-before-shell) 5696 tramp-actions-before-shell 60)
5693 (tramp-open-connection-setup-interactive-shell 5697 (tramp-open-connection-setup-interactive-shell
5694 p multi-method method user host) 5698 p multi-method method user host)
5695 (tramp-post-connection multi-method method user host))))) 5699 (tramp-post-connection multi-method method user host)))))
@@ -5762,7 +5766,7 @@ arguments, and xx will be used as the host name to connect to.
5762 5766
5763 (set-buffer buf) 5767 (set-buffer buf)
5764 (tramp-process-actions p multi-method method user host 5768 (tramp-process-actions p multi-method method user host
5765 tramp-actions-before-shell) 5769 tramp-actions-before-shell 60)
5766 (tramp-message 7 "Initializing remote shell") 5770 (tramp-message 7 "Initializing remote shell")
5767 (tramp-open-connection-setup-interactive-shell 5771 (tramp-open-connection-setup-interactive-shell
5768 p multi-method method user host) 5772 p multi-method method user host)
@@ -5823,7 +5827,7 @@ prompt than you do, so it is not at all unlikely that the variable
5823 (tramp-set-process-query-on-exit-flag p nil) 5827 (tramp-set-process-query-on-exit-flag p nil)
5824 (set-buffer (tramp-get-buffer multi-method method user host)) 5828 (set-buffer (tramp-get-buffer multi-method method user host))
5825 (tramp-process-actions p multi-method method user host 5829 (tramp-process-actions p multi-method method user host
5826 tramp-actions-before-shell) 5830 tramp-actions-before-shell 60)
5827 (tramp-open-connection-setup-interactive-shell 5831 (tramp-open-connection-setup-interactive-shell
5828 p multi-method method user host) 5832 p multi-method method user host)
5829 (tramp-post-connection multi-method method 5833 (tramp-post-connection multi-method method