Q: why do I get errors when calling a command from a specific buffer, but not in any other buffer?
Scratch all of what I had previously said about
call-interactively
(see strikethrough below for reference). It's not even remotely that.
I've done some additional investigation, and have narrowed the problem down to something even more baffling:
- visit buffer
mymode.el
, which defines some classes - call
eval-buffer
onmymode.el
- call
initialize-my-mode
command - get error
slot-boundp: Wrong type argument: eieio-object-p, #s(my-class-constructor "slot-1" "slot-2" "slot-3" "slot-4")
However, if, after calling eval-buffer
, I switch to any other
buffer besides mymode.el
and call the initialize-my-mode
command, I get no errors.
Why would I get eieio
errors when I call a command when visiting a specific buffer, but not any other buffer?
I have zero idea what could be happening here. I know it would be helpful to provide a minimal working example, but the classes are buried so deeply inside this mode that I cannot put one together in a timely fashion. I have to punt on tracking this bug down due to some big family commitments (toddler + newborn in the house, sorry!).
I'll be going back to the stable Emacs 26, but I'll leave this item up here in case anyone has any idea what's going on.
PS Apropos one of the bug reports in the comments, I have
eieio-backward-compatibility
set to nil
.
Q: are there any differences between M-x command
and (call-interactively #'command)
?
I have an obscure bug I'm trying to hunt down, and can't even begin to think of how to do it.
the summary version
Here's the short version, abstracting away the details. I have an interactive command some-command
that takes no arguments. When I call it via execute-extended-command
(i.e., M-x some-command
), I get the error message some error message
.
When I call it via elisp as (call-interactively #'some-command)
, it runs without error. Likewise, when I call it via straight elisp as (some-command)
, it runs without error.
what's happening here?
What could possibly be causing the command to throw an error when
invoked via M-x
but not any other way?
the error message in sketch
For the morbidly curious, the error message is as follows, abstracting away some of the idiosyncrasies:
slot-boundp: Wrong type argument: eieio-object-p, #s(my-class-constructor "slot-1" "slot-2" "slot-3" "slot-4")
FWIW
This error started to show up when I upgraded to the snapshot
version of Emacs (27.0.50). I've had other problems with eieio
in the process.