GNU bug report logs - #76417
[PATCH] Add tramp-cleanup-bufferless-connections

Previous Next

Package: emacs;

Reported by: Ship Mints <shipmints <at> gmail.com>

Date: Wed, 19 Feb 2025 17:45:02 UTC

Severity: wishlist

Tags: patch

Fixed in version 31.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 76417 <at> debbugs.gnu.org (full text, mbox):

From: Ship Mints <shipmints <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 76417 <at> debbugs.gnu.org
Subject: Re: bug#76417: [PATCH] Add tramp-cleanup-bufferless-connections
Date: Fri, 21 Feb 2025 07:34:08 -0500
[Message part 1 (text/plain, inline)]
On Thu, Feb 20, 2025 at 9:03 AM Michael Albinus <michael.albinus <at> gmx.de>
wrote:

> Ship Mints <shipmints <at> gmail.com> writes:
>
> Hi,
>
> tramp-cleanup-some-buffers is intended as frame to be customized for
> different use cases.
>
> > I did look. What concerned me was that tramp-cleanup-some-buffers-hook
> > could be altered by users, where tramp-cleanup-bufferless-connections
> > does one and only one thing without interference from potentially
> > modified hooks.
>
> You can write a wrapper function for your package, which binds
> tramp-cleanup-some-buffers-hook with proper functions, and which calls
> tramp-cleanup-some-buffers then.
>
> > It looks to me, though, that tramp-cleanup-some-buffers does things
> > differently.
>
> It is a new command of Emacs 30, so it is not very known to
> users. There's much room to customize it for different use cases.
>
> > It does (tramp-cleanup-all-connections) which is not
> > what I want.  I want only to kill unused tramp connections, not all
> > tramp connections.
>
> I've seen this also today. Hmm, perhaps we can move this call to a hook
> function, added by default, which you can suppress in your own binding
> of tramp-cleanup-some-buffers-hook.
>
> > It also kills user buffers which is not what my
> > function does--it kills only tramp-related objects not user buffers.
>
> This should also be configurable.
>
> > I could take a second look today, but it doesn't seem like they solve
> > the same problem?
>
> Yes, please do. I'm interested in pimp up this command with alternative
> scenarios.
>

I spent some more time on this and I think there's an "impedance mismatch"
between cleanup-some-buffers and cleaning up unused connections.  I'm
finding it cumbersome to mix the two as I have to move back and forth
between "buffer space" and "connection space" to achieve connection
cleanup.  My original patch seems like the cleanest approach, and can be
made shorter with a few tramp utility function changes.  Would you like to
see a patch based on those?
[Message part 2 (text/html, inline)]

This bug report was last modified 143 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.