help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Non file buffers and default-directory


From: Michael Albinus
Subject: Re: Non file buffers and default-directory
Date: Wed, 19 Apr 2023 17:17:34 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Manuel Giraud <manuel@ledu-giraud.fr> writes:

> Hi Michael,

Hi Manual,

>> Perhaps tramp-cleanup-all-connections should close only buffers which
>> have a remote process or a remote buffer-file-name? Since I don't know
>> of unexpected side effects, this behavior could be controlled by a user
>> option?
>
> Yes but then won't TRAMP keep trying to connect to the remote server or
> ask for a password for those buffers that don't have a remote process or
> file?  If so, maybe a better approach is that those kind of buffers
> should get a "special" default-directory at startup... but there might
> be cases where it is a bad idea.  I don't know.  That's why I asked this
> question: I find it annoying but people might have ways to avoid it.

Usually, tramp-cleanup-all-connections is sufficient.
tramp-cleanup-all-buffers let the remote buffers disappear in order to
not let you reconnect via a mistake, like openening a file in dired.

We could improve my proposal by adding a hook, which tells you which
buffers to remove. This hook could contain predicates for checking a
remote buffer-file-name, a remote process, or a romete dired buffer. And
this might be a new command in parallel to
tramp-cleanup-all-{buffers,connections}.  Whether this is sufficient
we'll see, but this mechanism could be tuned after first experiences.

> Best regards,

Best regards, Michael.



reply via email to

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