Subject: Re: bug#50205: 27.2; crashes or hangs when opening a specific file using tramp

From: Michael Albinus <[email-masked]>
Date: Thu, 02 Sep 2021 09:22:00 +0200

Mani Kancherla <[email-masked]> writes:

> Hi Michael,

Hi Mani,

> Looks like the workaround for the installation issue is to run "M-x
> tramp-recompile-elpa", but it complains there is no such command. So,
> I just opened ~/.emacs.d/elpa/tramp-2.5.1.1/tramp.el in emacs and from
> the menu selected Emacs-Lisp> Byte-Compile This File. I am not sure if
> it does the same thing. After that I restarted emacs and M-x
> tramp-version shows 2.5.1.1. With this, I still see the problem (still
> hangs or crashes).

Byte-compiling tramp*.el files is right, but the problem is that Emacs
should not have loaded the built-in Tramp already. Tramp comes with the
file tramp-compat.el, which offers defsubsts and defmacros different for
Emacs versions. If Tramp is loaded already when byte-compiling, the
loaded version of tramp-compat.el would be used.

A recipe to cure this in your environment would be:

1. Remove all byte-compiled Tramp files.

# rm -f ~/.emacs.d/elpa/tramp-2.5.1.1/tramp*.elc

2. Start Emacs with Tramp's source files

# emacs -L ~/.emacs.d/elpa/tramp-2.5.1.1 -l tramp

This should not give you the error.

3. Recompile Tramp ELPA package *with this running Emacs instance*

M-x tramp-recompile-elpa

Now everything shall be fine, and if you start Emacs again, using the
Tramp ELPA package, there shouldn't be the error.

> Thanks,
> Mani

Best regards, Michael.