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

Previous Next

Package: emacs;

Reported by: "J.P." <jp <at> neverwas.me>

Date: Wed, 11 Jan 2023 13:51:01 UTC

Severity: normal

Found in version 29.0.60

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #28 received at 60730 <at> debbugs.gnu.org (full text, mbox):

From: "J.P." <jp <at> neverwas.me>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: stefankangas <at> gmail.com, 60730 <at> debbugs.gnu.org
Subject: Re: bug#60730: 29.0.60; Free variable with :buffer keyword in
 ert-with-temp-file
Date: Sat, 28 Jan 2023 20:35:47 -0800
"J.P." <jp <at> neverwas.me> writes:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>> 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.

If, as you say, an argument to `:coding' should only ever be quoted, e.g.,

  :coding 'raw-text

then `coding' will end up quoted as well, so something like this might
be enough:

  diff --git a/lisp/emacs-lisp/ert-x.el b/lisp/emacs-lisp/ert-x.el
  index 98a017c8a8e..aa02c79d32f 100644
  --- a/lisp/emacs-lisp/ert-x.el
  +++ b/lisp/emacs-lisp/ert-x.el
  @@ -484,7 +484,7 @@ ert-with-temp-file
             (suffix (or suffix ert-temp-file-suffix
                         (ert--with-temp-file-generate-suffix
                          (or (macroexp-file-name) buffer-file-name)))))
  -      `(let* ((coding-system-for-write ,(or coding coding-system-for-write))
  +      `(let* ((coding-system-for-write ,(or coding `',coding-system-for-write))
                 (,temp-file (,(if directory 'file-name-as-directory 'identity)
                              (make-temp-file ,prefix ,directory ,suffix ,text)))
                 (,name ,(if directory




This bug report was last modified 2 years and 169 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.