]> git.eshelyaron.com Git - emacs.git/commitdiff
net/tramp.el (tramp-process-sentinel): Avoid error when process buffer killed.
authorMichael Olson <mwolson@gnu.org>
Sat, 9 Feb 2008 05:52:07 +0000 (05:52 +0000)
committerMichael Olson <mwolson@gnu.org>
Sat, 9 Feb 2008 05:52:07 +0000 (05:52 +0000)
lisp/ChangeLog
lisp/net/tramp.el

index 13559f13778216c78144ec5136ba1a4f94933c48..245ea7b3f07532e6085efca9ac0ee78aa33017fe 100644 (file)
@@ -1,3 +1,9 @@
+2008-02-09  Michael Olson  <mwolson@gnu.org>
+
+       * 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  <miles@gnu.org>
 
        * net/rcirc.el (rcirc-omit-mode): Suppress invisibility ellipsis.
index 50c79638fd026d795763d3dbca9a3cd7de489df6..e2df6ae99c81e9e4e168230d0f4bea7c14178a85 100644 (file)
@@ -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.