tramp-devel
[Top][All Lists]
Advanced

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

Re: Fwd: tramp removes valid recentf files when a remote is unreachable


From: Michael Albinus
Subject: Re: Fwd: tramp removes valid recentf files when a remote is unreachable
Date: Tue, 06 Apr 2021 14:58:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Marc Herbert <marc.herbert@gmail.com> writes:

> Hi,

Hi Marc,

> I use both tramp and recentf constantly.
>
> I use remote systems which are sometimes off, suspended or on a
> different network and I don't always remember to wake them up /
> connect to the VPN / etc. on every first attempt. When I try to open a
> file on a system that is unreachable, all the files on that system get
> cleared from the recentf list. This should be very easy to reproduce.
> It is very time-consuming when there are many files buried below long
> paths with many directories.
>
> I configured recentf-auto-cleanup to "never" but tramp does not care
> about that setting. I also tried various tramp settings but found none
> that made a difference.

Well, that variable is not intended for this case.

> I found that this was added a few years ago because that could make
> Emacs unusable:
> https://lists.gnu.org/archive/html/tramp-devel/2019-02/msg00005.html
> That does not seem to be the case anymore, well not for me anyway. Not
> arguing about the default behavior I think it should be at least
> possible to customize it and turn it off somewhere. Is it?

After loading Tramp and recentf, you might call these lines in your
.emacs:

--8<---------------cut here---------------start------------->8---
(remove-hook 'tramp-cleanup-connection-hook
             #'tramp-recentf-cleanup)
(remove-hook 'tramp-cleanup-all-connections-hook
             #'tramp-recentf-cleanup-all))))
--8<---------------cut here---------------end--------------->8---

Likely, in your case just the first form is sufficient, don't know. If
this works well for you, I might add it to Tramp's FAQ.

> Thanks in advance!
>
> Marc

Best regards, Michael.



reply via email to

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