Subject: bug#61663: closed (Re: bug#61663: 30.0.50; TRAMP: (kill-buffer) sometimes cannot kill modified buffer without re-establishing a connection)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 19 Mar 2023 12:45:01 +0000

Your bug report

#61663: 30.0.50; TRAMP: (kill-buffer) sometimes cannot kill modified buffer without re-establishing a connection

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
61663: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61663
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#61663: 30.0.50; TRAMP: (kill-buffer) sometimes cannot kill modified buffer without re-establishing a connection
From: Michael Albinus <[email-masked]>
To: Dima Kogan <[email-masked]>
Cc: [email-masked]
Date: Sun, 19 Mar 2023 13:44:29 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 30.1

Michael Albinus <[email-masked]> writes:

Hi Dima,

> When the buffer is modified, kill-buffer tries to unlock the respective
> file. I've modified tramp-handle-unlock-file such a way that it ceases
> to work when the connection is broken.
>
> Pushed to master. Could you, pls, check?

No further response, so I assume the bug is fixed. Closing.

Best regards, Michael.

Subject: 30.0.50; TRAMP: (kill-buffer) sometimes cannot kill modified buffer without re-establishing a connection
From: Dima Kogan <[email-masked]>
To: [email-masked]
Date: Mon, 20 Feb 2023 13:27:23 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi. This happens with a bleeding-edge emacs. I'm using a yubikey-based
ssh key, so I need to enter a passphrase and touch the yubikey to unlock
the ssh key. It looks like TRAMP is requiring this interaction even when
it shouldn't.

1. emacs -Q

2. C-x C-f /ssh:server:file

   We open some remote file using TRAMP. This is a new ssh connection,
   so I must enter the passphrase and touch the yubikey.

3. Modify the buffer by typing something into it. Do not save

4. Break the ssh link. One way is to M-x tramp-cleanup-this-connection

5. Try to kill the buffer with C-x k. Emacs says something like "Buffer
   modified. Kill anyway?" I say "yes". I would expect emacs to throw
   away the modified buffer. Instead it tries to re-establish the
   network connection to (presumably) do some cleanup. This requires the
   yubikey auth again. If I don't follow through the passphrase,
   touching prompts by pressing C-g, the modified buffer sticks around,
   and there doesn't appear to be any way to kill it.

With a "normal" ssh key, without a yubikey TRAMP still tries to
re-establish the network connection here. But it quickly fails, and the
(kill-buffer) still succeeds. With a yubikey it fails when I kill it and
the (kill-buffer) fails too. TRAMP shouldn't be trying to re-establish
the connection here probably.

Thanks!