Subject: bug#45518: Ctrl-G Fails to Interrupt Hung Tramp Remote-Compile in Emacs 27.1

From: Duncan Greatwood <[email-masked]>
Date: Wed, 30 Dec 2020 13:13:31 -0800

Hi Michael,

On Wed, Dec 30, 2020 at 2:36 AM Michael Albinus <[email-masked]>
> wrote:
> Duncan Greatwood <[email-masked]> writes:
> Hi Duncan,
> > In emacs 26.2, Ctrl-G (usually ctrl-g three times) would interrupt the
> > hung Tramp window, and indeed cause the errors to be displayed in the
> > window as best as Tramp is able.
> >
> > In emacs 27.1, Ctrl-G does nothing in this
> > "tramp-hung-while-compiling" situation. I also tried ctrl-c ctrl-c,
> > but that also does nothing. It appears that the only way to kill the
> > hung Tramp compile is to force-quit emacs as a whole at the OS level.
> Well, in this area several changes have been applied since Emacs 27.1
> has been released. Could you, pls, try the Tramp ELPA version (2.5.0)?
>
[DG] I note in passing that in my emacs 27.1 build, I already have Tramp
2.5.0 installed as per:
    M-x list-packages
    ...
      tramp              2.5.0         available

Nonetheless, I downloaded from this page:
https://elpa.gnu.org/packages/tramp.html
    tramp-2.5.0.tar, 2020-Dec-29, 1.61 MiB
I expanded the tar to a local directory, call it ~/.../tramp-2.5.0

I then added the following to my .emacs file:
    (add-to-list 'load-path (expand-file-name "~/.../tramp-2.5.0"))
    (require 'tramp)

Happy news - with this addition to .emacs, pressing ctrl-g three times once
again interrupts the hung Tramp window, and .emacs as a whole does not
crash.

I tried adding and removing the .emacs lines several times, and the matter
produces perfectly: ctrl-gx3 always works when the .emacs lines are
present, and never works when they are not in emacs 27.1.

The only slight wrinkle I noticed with this newest version of tramp (vs.
emacs 26.2 tramp) is that, after pressing ctrl-gx3, it feels I have to
click around to another window and back in order to see the error output
from the compile appear in the tramp compile window, wheres in emacs 26.2
the error output would start appearing in the tramp compile window as soon
as ctrl-gx3 was pressed. No terrible hardship but JFYI.

Is there anything I can do that would help diagnose / pinpoint or whatever?
Either with the ctrl-gx3 matter, or indeed with the underlying hang in the
tramp compile window which requires the use of ctrl-gx3.

Best regards,
Duncan

> Even if it still blocks Emacs, there is a new option to write Tramp
> traces to file. This would help us to find the culprit, if still
> evident.
> > Thanks as always.
> > D.
> Best regards, Michael.