bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#50869: 28.0.50; tramp: void-function tramp-file-name-method--cmacro


From: Stefan Monnier
Subject: bug#50869: 28.0.50; tramp: void-function tramp-file-name-method--cmacro
Date: Sat, 02 Apr 2022 17:09:13 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

>> After load - unload - load tramp, I got an compile error:
>> Compiler-macro error for tramp-file-name-method: (void-function
>> tramp-file-name-method--cmacro) [7 times]

Note: this is not a compile error.  It's an error that happened during
expansion of a compiler-macro.  These are optional, so those errors only
affect the performance of the code but shouldn't affect its behavior.

IOW this sound more serious than it is.

>> How to replicate it:
>> - Start emacs
>> - load-libary tramp
>> - tramp-unload-tramp
>> - load-libary tramp
>> - tramp-unload-tramp
>> - load-libary tramp
>
> tramp-file-name-method--cmacro is a generated accessor function of the
> defstruct tramp-file-name. I'm not sure that this is native Tramp
> error. The backtrace shows as

`tramp-file-name-method--cmacro` is supposed to be a function which
inlines the code of calls to `tramp-file-name-method`.

More specifically `tramp-file-name-method--cmacro` is auto-generated
(and put on the `compiler-macro` property of the
`tramp-file-name-method` symbol) by the `cl-defsubst` used to define
`tramp-file-name-method`.

So I guess the source of the error is that unloading `tramp` undefines
the functions (both `tramp-file-name-method--cmacro` and
`tramp-file-name-method`) but leaves the `compiler-macro` property of the
`tramp-file-name-method` symbol.

We really should make it so package unloading knows how to undo
top-level `put`s.

In the men time, the `;;;###tramp-autoload` cookie placed before the
`cl-defstruct` seems to trip over another bug when I try to build the
package here:

    Debugger entered--Lisp error: (scan-error "Containing expression ends 
prematurely" 12345819 12345820)
      scan-sexps(12345782 3)
      forward-sexp(3)
      autoload-print-form((defvar cl-struct-tramp-file-name-tags))
    [...]

Maybe it's a bug in the locally-hacked Emacs I'm using to do the build,
tho.  Still, I suspect the cure might be not much better than the disease.


        Stefan






reply via email to

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