From: Michael Albinus Date: Sun, 19 Jan 2025 10:30:10 +0000 (+0100) Subject: Fix Tramp error handling process buffer X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=19611ffb51d046eeb93b4e95fcfc8afc72a81ffc;p=emacs.git Fix Tramp error handling process buffer * lisp/net/tramp-cache.el (tramp-list-connections): * lisp/net/tramp-cmds.el (tramp-cleanup-connection): Use connection property " connected" for a check of active connections. * lisp/net/tramp.el (tramp-get-buffer): Set connection property " connected". (cherry picked from commit 40a8d0ebf0ca6199697c95a308201e739dd9540d) --- diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 80a490cdbc6..1625eb8e8f9 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -554,7 +554,7 @@ PROPERTIES is a list of file properties (strings)." (lambda (key) (and (tramp-file-name-p key) (null (tramp-file-name-localname key)) - (tramp-connection-property-p key " process-buffer") + (tramp-connection-property-p key " connected") key)) (hash-table-keys tramp-cache-data)))) diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index fd86066a34c..7d88fcefb34 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -171,7 +171,7 @@ interactively, a Tramp connection has to be selected." (get-buffer (tramp-debug-buffer-name vec))) (unless keep-debug (get-buffer (tramp-trace-buffer-name vec))) - (tramp-get-connection-property vec " process-buffer"))) + (tramp-get-connection-property vec " connected"))) (when (bufferp buf) (kill-buffer buf))) ;; Flush file cache. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 507bb243497..25d977fd4f1 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2005,10 +2005,11 @@ Unless DONT-CREATE, the buffer is created when it doesn't exist yet." (or (get-buffer (tramp-buffer-name vec)) (unless dont-create (with-current-buffer (get-buffer-create (tramp-buffer-name vec)) - ;; We use the existence of connection property " process-buffer" - ;; as indication, whether a connection is active. + ;; We use the existence of connection property " connected" + ;; as indication, whether a connection is active. It keeps + ;; the connection buffer, for cleanup. (tramp-set-connection-property - vec " process-buffer" + vec " connected" (tramp-get-connection-property vec " process-buffer")) (setq buffer-undo-list t default-directory