GNU bug report logs - #60311
json-available-p: make dynamically correct for Windows

Previous Next

Package: emacs;

Reported by: Mattias Engdegård <mattias.engdegard <at> gmail.com>

Date: Sun, 25 Dec 2022 14:33:01 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mattias Engdegård <mattias.engdegard <at> gmail.com>
Cc: 60311 <at> debbugs.gnu.org
Subject: Re: bug#60311: json-available-p: make dynamically correct for Windows
Date: Sun, 25 Dec 2022 17:40:47 +0200
> From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
> Date: Sun, 25 Dec 2022 15:32:06 +0100
> 
> The implementation of `json-available-p`,
> 
>   (and (fboundp 'json-serialize)
>        (condition-case nil
>            (json-serialize t)
>          (:success t)
>          (json-unavailable nil))))
> 
> probably isn't quite right on Windows: `json-serialize` is pure so it will be called at compile time and the result, "true", used in the code (actually not even that since the result is never used). Thus, if libjansson could not be loaded during actual Emacs use (as opposed to when Emacs was built), this would never be detected and json-available-p would still return t.

Yes, you are right.  But please come up with a smaller changeset which
only changes what strictly needs to be changed.  Or if you want, I can
do this myself.

AFAIU, we just need a C implementation of json-available-p, since
doing this in Lisp doesn't work.  So that's the change I expect,
nothing more, nothing less.  Like we do with other optional libraries
and features, there's more than enough examples in the codebase.

Thanks.




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

Previous Next


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