From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 8764544: Treat control characters in JSON strings as invalid Date: Thu, 28 Sep 2017 17:22:44 -0400 Message-ID: References: <20170818000543.9841.93700@vcs0.savannah.gnu.org> <20170818000544.84B5E2052C@vcs0.savannah.gnu.org> <20170818141330.GA848@holos.localdomain> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1506633834 8100 195.159.176.226 (28 Sep 2017 21:23:54 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 28 Sep 2017 21:23:54 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Philipp Stephani Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 28 23:23:50 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxgHa-0001P2-JX for ged-emacs-devel@m.gmane.org; Thu, 28 Sep 2017 23:23:46 +0200 Original-Received: from localhost ([::1]:60973 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxgHg-0006Iy-8g for ged-emacs-devel@m.gmane.org; Thu, 28 Sep 2017 17:23:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxgGk-0006HP-Hd for emacs-devel@gnu.org; Thu, 28 Sep 2017 17:22:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dxgGf-0000we-KF for emacs-devel@gnu.org; Thu, 28 Sep 2017 17:22:54 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:33811) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxgGf-0000w2-FI for emacs-devel@gnu.org; Thu, 28 Sep 2017 17:22:49 -0400 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id v8SLMjDX018818; Thu, 28 Sep 2017 17:22:45 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id D2D1466268; Thu, 28 Sep 2017 17:22:44 -0400 (EDT) In-Reply-To: (Philipp Stephani's message of "Thu, 28 Sep 2017 20:19:01 +0000") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6126=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6126> : inlines <6098> : streams <1765023> : uri <2508156> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:218870 Archived-At: >> >>> - (or (char-after (point)) :json-eof)) >> >> I wonder why it used :json-eof instead of using nil ? >> >> Any idea? >> > Not sure--it has been there since json.el was added to Emacs. >> Then why use 0 now instead of nil? > Because `following-char' returns 0 at EOB. "At the end of the buffer or > accessible region, return 0." But it also returns 0 in other cases. E.g. if you had changed (or (char-after (point)) :json-eof) to (char-after) it would give you nil at EOB (instead of 0). Stefan