tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: resurrection fo the *tramp... buffers


From: Michael Albinus
Subject: Re: resurrection fo the *tramp... buffers
Date: Sun, 29 Jan 2017 10:42:53 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

"Ben Hyde" <address@hidden> writes:

 Hi Ben,

> I tried setting debug-on-entry for a few things; but I’ve yet to find
> something that fires only when it birthing a fresh *tramp… buffer.
> Not that I looked very hard.

A new Tramp buffer is created in function `tramp-get-buffer'. But this
is called many times; creation a new buffer is not its major
functionality.

You could apply the appended patch, which separates creating the buffer
into a new function `tramp-create-buffer'. This could be used for
`debug-on-entry' then.

> * ben

Best regards, Michael.

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/tramp.el b/lisp/tramp.el
index fc7fdd3..4ae9c4c 100644
--- a/lisp/tramp.el
+++ b/lisp/tramp.el
@@ -1300,10 +1300,13 @@ necessary only.  This function will be used in file 
name completion."
             tramp-postfix-host-format))
          (when localname localname)))
 
+(defun tramp-create-buffer (vec)
+  (get-buffer-create (tramp-buffer-name vec)))
+
 (defun tramp-get-buffer (vec)
   "Get the connection buffer to be used for VEC."
   (or (get-buffer (tramp-buffer-name vec))
-      (with-current-buffer (get-buffer-create (tramp-buffer-name vec))
+      (with-current-buffer (tramp-create-buffer vec)
        ;; We use the existence of connection property "process-buffer"
        ;; as indication, whether a connection is active.
        (tramp-set-connection-property
--8<---------------cut here---------------end--------------->8---



reply via email to

[Prev in Thread] Current Thread [Next in Thread]