From fd35d9d668e8b27b3987eb9b885e0c693142578e Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Sat, 9 Feb 2008 05:52:07 +0000 Subject: [PATCH] net/tramp.el (tramp-process-sentinel): Avoid error when process buffer killed. --- lisp/ChangeLog | 6 ++++++ lisp/net/tramp.el | 15 +++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 13559f13778..245ea7b3f07 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2008-02-09 Michael Olson + + * net/tramp.el (tramp-process-sentinel): Avoid error when process + buffer has been killed, such as by + `tramp-cleanup-all-connections'. + 2008-02-09 Miles Bader * net/rcirc.el (rcirc-omit-mode): Suppress invisibility ellipsis. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 50c79638fd0..e2df6ae99c8 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -5654,12 +5654,15 @@ seconds. If not, it produces an error message with the given ERROR-ARGS." ;; 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. - (with-current-buffer (process-buffer proc) - (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))))) + (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))))))) (defun tramp-open-connection-setup-interactive-shell (proc vec) "Set up an interactive shell. -- 2.39.5