From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#21798: 25.0.50; [PATCH] Add support for retrieving paths to JSON elements Date: Fri, 6 Nov 2015 19:15:47 +0200 Message-ID: <563CE043.9060404@yandex.ru> References: <1446281162.2607.0@smtp.gmail.com> <5634CEE7.3070200@yandex.ru> <1446407553.4906.0@smtp.gmail.com> <1446420466.13180.0@smtp.gmail.com> <56381558.7050607@yandex.ru> <1446827488.11140.2@smtp.gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1446830182 18097 80.91.229.3 (6 Nov 2015 17:16:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Nov 2015 17:16:22 +0000 (UTC) Cc: 21798@debbugs.gnu.org To: Simen =?UTF-8?Q?Heggest=C3=B8yl?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 06 18:16:11 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZukcU-0006lH-2D for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Nov 2015 18:16:10 +0100 Original-Received: from localhost ([::1]:40146 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZukcT-0007d8-GH for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Nov 2015 12:16:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56687) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZukcP-0007d2-V9 for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2015 12:16:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZukcM-0002V2-OS for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2015 12:16:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37119) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZukcM-0002Us-LF for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2015 12:16:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZukcM-000259-39 for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2015 12:16:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Nov 2015 17:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21798 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 21798-submit@debbugs.gnu.org id=B21798.14468301537986 (code B ref 21798); Fri, 06 Nov 2015 17:16:02 +0000 Original-Received: (at 21798) by debbugs.gnu.org; 6 Nov 2015 17:15:53 +0000 Original-Received: from localhost ([127.0.0.1]:56060 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZukcC-00024j-F1 for submit@debbugs.gnu.org; Fri, 06 Nov 2015 12:15:52 -0500 Original-Received: from mail-wm0-f54.google.com ([74.125.82.54]:38751) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZukcA-00024b-RB for 21798@debbugs.gnu.org; Fri, 06 Nov 2015 12:15:51 -0500 Original-Received: by wmec201 with SMTP id c201so23251447wme.1 for <21798@debbugs.gnu.org>; Fri, 06 Nov 2015 09:15:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=ukSBR79eVTaOGfSso/NWAey1QciwUBd6sxWo9M7MGrk=; b=izdfsCNS6yKo/49J8leD4YKo2VROAu+JuA9mzY/LKO0PkQ5mvjkWiAb08TNlCaUA7n xJg3pAdXHxQRMZJiNVRbX7yfHaRK2Lh3YFtU+bb2YNkUN0kvWgVuIIrxt8jUl6ds+K1j RzxpibU2HdA8ChqMQHEq6Ftx66n7ROOmi+JsEt+aFFscI/fxfE+hheqPOl4ogfnRq6sv q5izC0t5mJPg8e79QP3orOWOZl/SAmqImiZGG/QedTPngCzmLPo5J7nQUxOH8+hsp2xX a8Q9KIVtl4E6kcOU60ai0N7RXTk+jSPNPOvMj1wJyponBgbIArWQu6XCPuH6+UpVkax0 8v6w== X-Received: by 10.28.146.146 with SMTP id u140mr11089375wmd.85.1446830150113; Fri, 06 Nov 2015 09:15:50 -0800 (PST) Original-Received: from [10.9.0.103] (nat.webazilla.com. [78.140.128.228]) by smtp.googlemail.com with ESMTPSA id e79sm3950943wmd.16.2015.11.06.09.15.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Nov 2015 09:15:48 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Thunderbird/42.0 In-Reply-To: <1446827488.11140.2@smtp.gmail.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:108501 Archived-At: On 11/06/2015 06:31 PM, Simen Heggestøyl wrote: > I'm reluctant to use advises for it, not based on my own experience, but > based on advice from the Elisp manual: > >> [...] advice should be reserved for the cases where you cannot modify >> a function’s behavior in any other way. [...] In particular, Emacs’s >> own source files should not put advice on functions in Emacs. (There >> are currently a few exceptions to this convention, but we aim to >> correct them.) > > Here we do have a chance to modify the functions' behavior. I happen to think that an advice with a short lifetime is okay, but yes, these are the guidelines. > How about a sort of compromise between our approaches: provide > 'json-read-object' and 'json-read-array' with pre- and post-read > callback functions, that are only called when they're set. That would > make it possible to leverage the power of 'json-read-object' and > 'json-read-array' by binding the callback functions, without mixing > alien logic into them. That sounds fine to me in terms of design, but it might add some performance overhead. So some testing is needed. > That would also make it a lot cleaner when adding other extensions to > them in the future, compared to my original suggestion. > > If that sounds good to you, I'll cook up a new patch! Please go ahead.