From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.bugs Subject: bug#55278: 29.0.50; OSM package Date: Sat, 07 May 2022 19:08:41 -0400 Message-ID: References: <83v8uj23lg.fsf@gnu.org> <83mtftzxgj.fsf@gnu.org> Reply-To: rms@gnu.org Content-Type: text/plain; charset=Utf-8 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15696"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 55278@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 08 01:09:15 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 1nnTY3-0003xJ-56 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 08 May 2022 01:09:15 +0200 Original-Received: from localhost ([::1]:58380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnTY1-0003JA-P6 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 May 2022 19:09:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45848) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnTXq-0003CT-Tz for bug-gnu-emacs@gnu.org; Sat, 07 May 2022 19:09:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59190) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nnTXq-0000RC-Kj for bug-gnu-emacs@gnu.org; Sat, 07 May 2022 19:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nnTXq-00009V-Fc for bug-gnu-emacs@gnu.org; Sat, 07 May 2022 19:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Richard Stallman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 May 2022 23:09:02 +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.1651964930554 (code B ref 55278); Sat, 07 May 2022 23:09:02 +0000 Original-Received: (at 55278) by debbugs.gnu.org; 7 May 2022 23:08:50 +0000 Original-Received: from localhost ([127.0.0.1]:53085 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnTXe-00008s-IT for submit@debbugs.gnu.org; Sat, 07 May 2022 19:08:50 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52502) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnTXc-00008Q-29 for 55278@debbugs.gnu.org; Sat, 07 May 2022 19:08:48 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:45030) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnTXW-0000P2-Ro for 55278@debbugs.gnu.org; Sat, 07 May 2022 19:08:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=05WKB+xlfmdlhmQhf/ytuh3rBJP8XXZPHLfM9xQxnhI=; b=hqJEctJejawk e2iPZfZH+PTL1mJkTzpG3zR+TxNzrS7kcd+PUlC9ReuR41Izljc56IA1nZQE1Fr4XvVNxMlDRFbRD CEDcPF56oW+aD1XgM6fLlmhXjWKxlDeFLzGeMq3F0IE//Q/iBkHxvHW/LMvXotzXhpQNQm/l2pBcX uGTJuPSmKO2QamnK6IcqYYLD9EalYXCBBnaDZDjJOk2Q3LCeq2auDI2xyg14esYyUrm719XoqMkkE a0bBkx4NyLvvhxrbFPmRYVTx84tOoJtMxLQdLv0iCO298MTJmHstIcslM+DMPIWCvVBIua1z7sWgc sMG97lLFIebVrQexbFbvPA==; Original-Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1nnTXV-0003vh-P8; Sat, 07 May 2022 19:08:41 -0400 In-Reply-To: <83mtftzxgj.fsf@gnu.org> (message from Eli Zaretskii on Sat, 07 May 2022 09:08:28 +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:231613 Archived-At: [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > Because the actual implementation is in the libjansson library; the > Emacs sources only wrap that by a glue to allow use to use JSON with > Emacs Lisp objects. That makes sense, by itself. But the end result is that the proper functioning of a user-level feature depends on compiling Emacs with a special library that most users have never heard of. If Emacs is compiled without libpng and therefore can't display png files, that will make sense to the user, because the user can see the relationship between one and the other. Users will accept that. But users won't see any relationship between Open Street Map and libjansson. They will say, "How was I supposed to know that???" I think we had better fix this somehow. Po Lu wrote: > 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)))))) How about making osm.el determine whether the C-level one is available, and use the fastest available one? Or perhaps define a common interface for the two, so we only need to document that interface. That would simplify Emacs overall. -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org)