From: Daniel Colascione Date: Tue, 3 Sep 2019 20:16:21 +0000 (-0700) Subject: Run tramp cleanup in correct buffer X-Git-Tag: emacs-27.0.90~1553^2~48 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5f089ac93f18fbd6e8131b81e1c6b403894b5759;p=emacs.git Run tramp cleanup in correct buffer Fixes bug #37297. * lisp/net/tramp.el (tramp-process-sentinel): Do process-end cleanup in the tramp buffer, not a random file buffer. --- diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index d419f9d87d0..fdad43ef6fa 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -4210,10 +4210,11 @@ the remote host use line-endings as defined in the variable (when vec (tramp-message vec 5 "Sentinel called: `%S' `%s'" proc event) (tramp-flush-connection-properties proc) - (tramp-flush-directory-properties vec "")) - (goto-char (point-max)) - (when (and prompt (re-search-backward (regexp-quote prompt) nil t)) - (delete-region (point) (point-max)))))) + (tramp-flush-directory-properties vec "") + (with-current-buffer (tramp-get-buffer vec) + (goto-char (point-max)) + (when (and prompt (re-search-backward (regexp-quote prompt) nil t)) + (delete-region (point) (point-max)))))))) (defun tramp-get-inode (vec) "Returns the virtual inode number.