emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Has eval-and-compile changed in emacs 27?


From: Stefan Monnier
Subject: Re: Has eval-and-compile changed in emacs 27?
Date: Thu, 25 Feb 2021 11:18:20 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> https://github.com/erlang/otp/blob/master/lib/tools/emacs/erldoc.el
> suddenly has a compiler warning under emacs 27, which has no warnings
> before.
>
>     erldoc.el:535:1:Warning: the function ‘json-encode’ might not be
>     defined at runtime.

That's weird.  I haven't downloaded the whole thing, but I tried to
reproduce it by byte-compiling a file containing:

    (defun sm-foo-from-erldoc (json table output)
      (with-temp-buffer
        (if (not json)
            (pp table (current-buffer))
          (eval-and-compile (require 'json))
          (let ((json-encoding-pretty-print t))
            (insert (json-encode table))))
        (unless (file-directory-p (file-name-directory output))
          (make-directory (file-name-directory output) t))
        (write-region nil nil output nil nil nil 'ask)))

and that doesn't give me any such warning, neither with Debian's 27.1 nor
with `master`.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]