>> >>> -=C2=A0 (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.=C2=A0 E.g. if you had changed
=C2=A0 =C2=A0 (or (char-after (point)) :json-eof)
to
=C2=A0 =C2=A0 (char-after)
it would give you nil at EOB (instead of 0).
Agreed.
I'm wondering wh=
at the purpose of `following-char' is. Even in the rare cases where you=
want to treat EOB and a following null character identically it would be c=
leaner to write (or (char-after) 0).