From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#55278: 29.0.50; OSM package Date: Sat, 07 May 2022 11:32:56 +0800 Message-ID: <87y1ze6mqf.fsf@yahoo.com> References: <83v8uj23lg.fsf@gnu.org> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33164"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) Cc: Eli Zaretskii , 55278@debbugs.gnu.org To: Richard Stallman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 07 05:34:12 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 1nnBCs-0008Kw-Ru for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 May 2022 05:34:11 +0200 Original-Received: from localhost ([::1]:59594 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnBCq-0007bv-RX for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 06 May 2022 23:34:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnBCk-0007bV-9M for bug-gnu-emacs@gnu.org; Fri, 06 May 2022 23:34:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56272) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nnBCk-0001hY-0a for bug-gnu-emacs@gnu.org; Fri, 06 May 2022 23:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nnBCj-0004bV-OS for bug-gnu-emacs@gnu.org; Fri, 06 May 2022 23:34:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 May 2022 03:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55278 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 55278-submit@debbugs.gnu.org id=B55278.165189439217636 (code B ref 55278); Sat, 07 May 2022 03:34:01 +0000 Original-Received: (at 55278) by debbugs.gnu.org; 7 May 2022 03:33:12 +0000 Original-Received: from localhost ([127.0.0.1]:50169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnBBw-0004aO-Ha for submit@debbugs.gnu.org; Fri, 06 May 2022 23:33:12 -0400 Original-Received: from sonic315-22.consmr.mail.ne1.yahoo.com ([66.163.190.148]:44545) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnBBv-0004aA-5c for 55278@debbugs.gnu.org; Fri, 06 May 2022 23:33:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1651894385; bh=XfrTl+8U/Zt8tMo79DhfPI6YieYKvoF1s14lt7uZ/CI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=VtuGTbbqjdV/Hvu5VKx7Ecl+XuOUMQHpZZdl3SlpxlvBfp4leJ27sCnNKYVtxvN0/6NQ8rUp0WZORb7UcxGWDIIlp7KyeF34fHkftG2m+iBtmqyWcgWAR2ktQeNoktA89Ikn3nwBpSSihB44HM7yZPnbkpt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tjFLJSivHIOAyJ6fPeRAljAmi5KnhLWczgKcRor0zb4_T8nakku3_H2_fWmj4..S1MCkNsv.0VuS HbgwcXYPzYtur_C1dkLg4Dv5uajqDWaOgUYcC6vZFpiRvBPKnKNwDUqAOfqsUe_Q1oEZXt_qRbPD q4WtIc3VIambHmFofXYnNGsQ_PA09PJ.Cv0OrBPqfVOuaiScbtnlhdyu8f7vfluvWMn3aCz2R0Wx tNYmvy29hWuLwxbfmKj.T_vkRmoSZlX6gvgIU0egoM7UbJBwOjqA7mbMigiY3tqfoMLXnNSCWCmj rIgg.5H6tMxdZTaE8DLLFK71EwgzzbqvW2Gual7VFddMYir_AnseZ28lfUUPgC2jkg6l6ofYu4C7 DdNh6TtYOKCoIL6HkJaQ78JAjR3d2GsfVobsNuGpu.BTnq38Vo8s_nFkn_YCvYagesYR2OU2xu_X XK08Bohdjx.KIhdcrF0Q1j2eollVNnpUyWtH_9yl7o X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.ne1.yahoo.com with HTTP; Sat, 7 May 2022 03:33:05 +0000 Original-Received: by hermes--canary-production-sg3-795d7b4d54-92ng7 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 2caa1c76e508fcb100e2c8b10dcbc94a; Sat, 07 May 2022 03:33:02 +0000 (UTC) In-Reply-To: (Richard Stallman's message of "Fri, 06 May 2022 19:19:32 -0400") X-Mailer: WebService/1.1.20188 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo 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:231551 Archived-At: Richard Stallman writes: > That is strange. If the function json-parse-string is defined in the > Emacs sources, why compile it only if something else is enabled? Jansson is a library for parsing JSON. Emacs provides two mechanisms for parsing JSON into Lisp data, one of which is based on the Jansson library, and the other is implemented in Lisp inside json.el. OSM uses the former, but it can trivially be made to use the latter: --- a/osm.el +++ b/osm.el @@ -39,6 +39,7 @@ (require 'bookmark) (require 'dom) +(require 'json) (eval-when-compile (require 'cl-lib) (require 'subr-x)) @@ -1376,14 +1377,12 @@ (defun osm--fetch-json (url) "Get json from URL." - (json-parse-string + (json-read-from-string (let ((default-process-coding-system '(utf-8-unix . utf-8-unix))) (shell-command-to-string (concat "curl " osm-curl-options " " - (shell-quote-argument url)))) - :array-type 'list - :object-type 'alist)) + (shell-quote-argument url)))))) ;;;###autoload (defun osm-search (search &optional lucky)