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 20:43:11 +0200 Message-ID: <83mt7b2ukg.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="40371"; 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 19:44:18 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 1p9Vyr-000AKo-Vb for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Dec 2022 19:44:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p9Vyf-00018i-L2; Sun, 25 Dec 2022 13:44:05 -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 1p9Vyd-00018V-3Z for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 13:44:03 -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 1p9Vyc-0003BG-Jh for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 13:44:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p9Vyb-0003bB-U0 for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 13:44: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 18:44: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.167199379713760 (code B ref 60311); Sun, 25 Dec 2022 18:44:01 +0000 Original-Received: (at 60311) by debbugs.gnu.org; 25 Dec 2022 18:43:17 +0000 Original-Received: from localhost ([127.0.0.1]:50155 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9Vxt-0003Zr-FI for submit@debbugs.gnu.org; Sun, 25 Dec 2022 13:43:17 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46292) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9Vxr-0003Zd-Il for 60311@debbugs.gnu.org; Sun, 25 Dec 2022 13:43:16 -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 1p9Vxl-000376-IR; Sun, 25 Dec 2022 13:43:10 -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=ACOWf4DE8x41rwum1v4ipvFjxC3yEkiuCGXp1fh9Xog=; b=CTip4foJQ21GSnoXebwq rnwPZnhj6kJtkr7yBG6pSVfxRHOvBZ4VMDA8PEk589eVydjl34/3p2fmyzbpvA6gUcgTYJnDakd0f PBvBftvRSipD6IgT/ObIM1kXpJIEEidPNBu/PCuCODDcOlaFJoAkz659qlr0xHHyBzklUBiLB/JjA Uns0RDou2Jp+14qy8+NErwao+xfDVXeB17rlktnx8sKxOMVXM8Or7bK/zC7i23AhRiBSz9oZ5Uw1k jS6qBS7YNlXp/XqEON2K2LiaO5pz2gI1unN5lb+JmKuj7JtCzto4Mkk+RR+Aw9Ov2bZd0VCiIsEp1 5ownUU1WQ9NbwA==; 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 1p9Vxk-00087h-Un; Sun, 25 Dec 2022 13:43:09 -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:251866 Archived-At: > From: Mattias EngdegÄrd > Date: Sun, 25 Dec 2022 15:32:06 +0100 > > --- a/lisp/subr.el > +++ b/lisp/subr.el > @@ -6905,11 +6905,11 @@ internal--format-docstring-line > > (defun json-available-p () > "Return non-nil if Emacs has libjansson support." > - (and (fboundp 'json-serialize) > - (condition-case nil > - (json-serialize t) > - (:success t) > - (json-unavailable nil)))) > + (declare (side-effect-free error-free)) > + (and (eval-when-compile (fboundp 'json-serialize)) > + ;; If `json--available-p' is present, we need to call it at run-time. > + (or (not (eval-when-compile (fboundp 'json--available-p))) > + (json--available-p)))) Btw, I don't understand this use of eval-when-compile here. Can you explain why should we care at compile time whether these functions are fboundp? IOW, why not just (and (fboundp 'json--available-p) (json--available-p)) ?