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

From: Tongjie Chen <[email-masked]>
Date: Thu, 3 Mar 2022 22:28:23 -0500

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

A strange thing is when eval the previous non patched defun, jdee will
work. Wonder if "mode" was leaked somewhere.

On Thu, Mar 3, 2022 at 7:36 PM Michael Heerdegen <[email-masked]>
wrote:

> Lars Ingebrigtsen <[email-masked]> writes:
>
> > > - (define-abbrev-table (derived-mode-abbrev-table-name mode) nil)
> > > + ,(define-abbrev-table (derived-mode-abbrev-table-name mode) nil)
> >
> > The code looks correct the way it is, I think?
>
> 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.
>
> 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?)
>
> Michael.
>

-- 
Best,
Tongjie