|
From: | Stefan Monnier |
Subject: | Re: [Emacs-diffs] master 8764544: Treat control characters in JSON strings as invalid |
Date: | Thu, 28 Sep 2017 17:22:44 -0400 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
>> >>> - (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
[Prev in Thread] | Current Thread | [Next in Thread] |