Subject: Re: bug#54240: emacs/lisp/emacs-lisp/derived.el patch

From: Lars Ingebrigtsen <[email-masked]>
Date: Fri, 04 Mar 2022 16:19:59 +0100

Michael Heerdegen <[email-masked]> writes:

> To me this looks like a regression introduced when converting to lexical
> binding.  Look at the symbol 'mode': it's implicitly quoted so it can't
> refer to the lexical variable and you get the error reported.

Oh, yeah -- I was thinking that the mode had to be lexically bound
there, but of course it isn't really, since eval is ... eval.  (Whenever
there's an eval in code, there's a bug somewhere.)

Would adding LEXICAL to the eval form fix the issue here, or would that
interact oddly with the defvar?

> The patch unquotes too much however, looks like we want something like
>
>> > - (define-abbrev-table (derived-mode-abbrev-table-name mode) nil)
>> > + (define-abbrev-table (derived-mode-abbrev-table-name ',mode) nil)
>
> (does that work?)

Tongjie Chen <[email-masked]> writes:

> Thanks Michael. I tested this improved quoting and it worked. Once the abbrev
> table is defined, jdee will no longer run into problems. 

OK, I'll push Michael's change to emacs-28, because this is a regression
from Emacs 27.2, I think.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no