From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#48228: json-serialize should signal error when dll is not found [MS Windows] Date: Tue, 20 Jul 2021 14:50:01 +0200 Message-ID: <871r7tf8ue.fsf@gnus.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5216"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 48228@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 20 14:51:45 2021 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 1m5pDs-000181-Jn for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 20 Jul 2021 14:51:44 +0200 Original-Received: from localhost ([::1]:37886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5pDr-0000a9-Kz for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 20 Jul 2021 08:51:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5pDC-0008CI-Is for bug-gnu-emacs@gnu.org; Tue, 20 Jul 2021 08:51:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49856) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m5pDC-0007cO-9t for bug-gnu-emacs@gnu.org; Tue, 20 Jul 2021 08:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m5pDC-0004Bb-9Z for bug-gnu-emacs@gnu.org; Tue, 20 Jul 2021 08:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Jul 2021 12:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48228 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 48228-submit@debbugs.gnu.org id=B48228.162678541316012 (code B ref 48228); Tue, 20 Jul 2021 12:51:02 +0000 Original-Received: (at 48228) by debbugs.gnu.org; 20 Jul 2021 12:50:13 +0000 Original-Received: from localhost ([127.0.0.1]:33166 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5pCP-0004AA-7D for submit@debbugs.gnu.org; Tue, 20 Jul 2021 08:50:13 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:57138) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5pCN-00049n-Bw for 48228@debbugs.gnu.org; Tue, 20 Jul 2021 08:50:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=HK3yhjj7NZDEbA0ghyptj2HSxv8yInJbeRB+Sq+dQig=; b=XTqgj4/TYxBlSJfTxmpYuuJIRX Aqd7WkwV3ips5FDd0L81Ap8cqu/GrqmZa3GeJ/heEL70WQ0G7a/phg9R4Zr4kEjf8fzwl10oEjQfb DcXNyhCqp0aS/VF+GODE/Zi89+3WQXRYJXYQ4uiihG2TUmGkRKu+deFGHbw3U4K9H/l8=; Original-Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m5pCE-0003K9-F5; Tue, 20 Jul 2021 14:50:04 +0200 X-Now-Playing: Pet Shop Boys's _Hotspot_: "Hoping for a miracle" In-Reply-To: (Dmitry Gutov's message of "Tue, 4 May 2021 18:25:05 +0300") 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" Xref: news.gmane.io gmane.emacs.bugs:210345 Archived-At: Dmitry Gutov writes: > As discussed on Emacs Help. > > Another commenter suggested signaling a specific error. Please advise > what to name it and where to put it. > > diff --git a/src/json.c b/src/json.c > index 3f1d27ad7f..ece057ae41 100644 > --- a/src/json.c > +++ b/src/json.c > @@ -596,8 +596,7 @@ DEFUN ("json-serialize", Fjson_serialize, > Sjson_serialize, 1, MANY, > } > if (!json_initialized) > { > - message1 ("jansson library not found"); > - return Qnil; > + Fsignal (Qerror, list1 (build_unibyte_string ("jansson library > not found"))); I've now applied a version of this change to Emacs 28 (with a new error symbol). The discussion here then turned towards the question of whether there should be a `json-available-p' function, and there should. But json.c is slightly unusual in this respect that it's not compiled at all if jansson isn't available, so the function will have to go somewhere else, which is rather, er, inconvenient. Anybody have an idea how to solve that problem? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no