Subject: bug#60730: 29.0.60; Free variable with :buffer keyword in ert-with-temp-file

From: Eli Zaretskii <[email-masked]>
Date: Sat, 28 Jan 2023 18:13:20 +0200

> From: "J.P." <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Sat, 28 Jan 2023 07:56:22 -0800
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> >> Not sure if that's the right call, though. If this keyword is already
> >> seeing action in the wild, perhaps it's worth ensuring that its argument
> >> arrives unquoted? Or maybe another type check (to accompany the one for
> >> `name') would do?
> >
> > Can you show the results of macro-expansion both when coding has a
> > value and when it is nil (and then coding-system-for-write is nil or
> > has a non-nil value)?
> 
> `coding-system-for-write' nil, keyword nil
> 
>   (ert-with-temp-file myfile :coding nil)
>   (let* ((coding-system-for-write nil) ...)
> 
>   ;; keyword absent
> 
>   (ert-with-temp-file myfile)
>   (let* ((coding-system-for-write nil) ...)
> 
> `coding-system-for-write' nil, keyword non-nil
> 
>   (ert-with-temp-file myfile :coding utf-8)
>   (let* ((coding-system-for-write utf-8) ...)
> 
>   ;; keyword quoted
> 
>   (ert-with-temp-file myfile :coding 'utf-8)
>   (let* ((coding-system-for-write 'utf-8) ...)
> 
> `coding-system-for-write' non-nil, keyword nil
> 
>   (setq coding-system-for-write 'utf-8)
> 
>   (ert-with-temp-file myfile :coding nil)
>   (let* ((coding-system-for-write utf-8) ...)
> 
>   ;; keyword absent
> 
>   (ert-with-temp-file myfile myfile)
>   (let* ((coding-system-for-write utf-8) ...)
> 
> `coding-system-for-write' non-nil, keyword non-nil
> 
>   (setq coding-system-for-write 'utf-8)
> 
>   (ert-with-temp-file myfile :coding raw-text)
>   (let* ((coding-system-for-write raw-text) ...)
> 
>   ;; keyword quoted
> 
>   (ert-with-temp-file myfile :coding 'raw-text)
>   (let* ((coding-system-for-write 'raw-text) ...)

Thanks, but I'm not sure I follow: coding-system's name should always
be quoted, as it's a symbol.  So why things like the below:

   (ert-with-temp-file myfile :coding raw-text)

are relevant?  AFAIU, they are a mistake: raw-text should be quoted,
as in 'raw-text.

Is the problem that a coding-system symbol is not quoted?