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 wrote: > Lars Ingebrigtsen 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