From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#60311: json-available-p: make dynamically correct for Windows Date: Sun, 25 Dec 2022 17:40:47 +0200 Message-ID: <83wn6f330g.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1143"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60311@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 25 16:41:25 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p9T7s-000077-Ng for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Dec 2022 16:41:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p9T7X-0003dP-Dh; Sun, 25 Dec 2022 10:41:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p9T7W-0003dA-DZ for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 10:41:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p9T7W-0001h6-03 for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 10:41:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p9T7V-0003TQ-MK for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 10:41:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Dec 2022 15:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60311 X-GNU-PR-Package: emacs Original-Received: via spool by 60311-submit@debbugs.gnu.org id=B60311.167198285613331 (code B ref 60311); Sun, 25 Dec 2022 15:41:01 +0000 Original-Received: (at 60311) by debbugs.gnu.org; 25 Dec 2022 15:40:56 +0000 Original-Received: from localhost ([127.0.0.1]:49932 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9T7P-0003Sw-LL for submit@debbugs.gnu.org; Sun, 25 Dec 2022 10:40:55 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9T7M-0003SW-5E for 60311@debbugs.gnu.org; Sun, 25 Dec 2022 10:40:53 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p9T7G-0001fY-V3; Sun, 25 Dec 2022 10:40:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=S6Yf5Qg5UTGvnLqFYLJ5//gflGjk+SbyHLl2LsUZgLg=; b=JI9ftRLHI84M5PBROTQT iZoX6z0sas0enIxGmNFvQU9T9vPzd1hIXCn+e9GVmR+nHZFxxHQarRUhyw2x4iVGYEMcZ2vzV7B4f 1KW8NeeUDGl9/5BUcx1pAVSo95aI0RXga2dcMfWM2KpvVUTgvRHdDp0ifssNgFYpL7/TQyspBePk+ VZ0Sb9a0nkt3X3YY36BQBC8ZiZBFa643kaqsPZJId2UGa+fne34N3KeA9tSNg76h8HwGuBWcIwhoc VPUN1eFFuZYLT8Fvbe/iFknjHTcn+cIf6nDl5Zjgk/gvVJBRXAydw8fpZ/6PAVVk0uGuvqYZabGck OlpoDbIuW8uEbg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p9T7G-00080C-AA; Sun, 25 Dec 2022 10:40:46 -0500 In-Reply-To: (message from Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= on Sun, 25 Dec 2022 15:32:06 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:251853 Archived-At: > From: Mattias EngdegÄrd > 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.