Subject: bug#57065: 29.0.50; Double evaluation in `c-make-no-parens-syntax-table`

From: Alan Mackenzie <[email-masked]>
Date: Sat, 27 Aug 2022 09:46:05 +0000

Hello, Stefan.

Thanks for debugging and fixing this.

There was another instance of the same bug in cc-langs.el, so I've fixed
that in a followup commit, even though that was unlikely to cause any
problems.

Of course, both fixes have gone into the upstream version.

Thanks again!

-- 
Alan Mackenzie (Nuremberg, Germany).

On Thu, Aug 25, 2022 at 17:00:56 -0400, Stefan Monnier wrote:
> Pushed to `master`, closing,

>         Stefan

> Stefan Monnier [2022-08-09 03:53:53] wrote:
> > The patch below seems to be necessary to avoid a double-evaluation.
> > This can be seen if you do something like

> >     (c-lang-defconst c-make-mode-syntax-table my-lang #'my-fun)

> > or

> >     (c-lang-defconst c-make-mode-syntax-table my-lang (symbol-value 'my-fun))

> > or

> >     (c-lang-defconst c-make-mode-syntax-table my-lang
> >       (lambda () ..))

> > where you'll get errors like "void-variable `my-fun`" or "void-function
> > `closure`.

> >         Stefan

> > diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
> > index c5964165c8d..7826f38ca1a 100644
> > --- a/lisp/progmodes/cc-langs.el
> > +++ b/lisp/progmodes/cc-langs.el
> > @@ -403,7 +403,7 @@ c-make-no-parens-syntax-table
> >    t  (if (c-lang-const c-recognize-<>-arglists)
> >       `(lambda ()
> >  	;(if (c-lang-const c-recognize-<>-arglists)
> > -	(let ((table (funcall ,(c-lang-const c-make-mode-syntax-table))))
> > +	(let ((table (funcall ',(c-lang-const c-make-mode-syntax-table))))
> >  	  (modify-syntax-entry ?\( "." table)
> >  	  (modify-syntax-entry ?\) "." table)
> >  	  (modify-syntax-entry ?\[ "." table)