unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Mattias Engdegård" <mattias.engdegard@gmail.com>
Cc: 60311@debbugs.gnu.org
Subject: bug#60311: json-available-p: make dynamically correct for Windows
Date: Sun, 25 Dec 2022 17:40:47 +0200	[thread overview]
Message-ID: <83wn6f330g.fsf@gnu.org> (raw)
In-Reply-To: <FDA1AAF8-F02A-4FDF-8B5E-ED009842B753@gmail.com> (message from Mattias Engdegård on Sun, 25 Dec 2022 15:32:06 +0100)

> From: Mattias Engdegård <mattias.engdegard@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.





  parent reply	other threads:[~2022-12-25 15:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-25 14:32 bug#60311: json-available-p: make dynamically correct for Windows Mattias Engdegård
2022-12-25 15:34 ` Mattias Engdegård
2022-12-25 15:40 ` Eli Zaretskii [this message]
2022-12-25 16:24   ` Eli Zaretskii
2022-12-25 17:26     ` Eli Zaretskii
2022-12-26 12:11   ` Mattias Engdegård
2022-12-26 13:29     ` Eli Zaretskii
2022-12-25 18:43 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83wn6f330g.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=60311@debbugs.gnu.org \
    --cc=mattias.engdegard@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).