From: Mattias EngdegÄrd Date: Tue, 2 Apr 2024 15:51:38 +0000 (+0200) Subject: json-insert doc fixes X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c76669849efd275e940f395e169f3da5d961da0d;p=emacs.git json-insert doc fixes * src/json.c (Fjson_insert): Precise the behaviour when the current buffer is multibyte and unibyte, respectively. * doc/lispref/text.texi (Parsing JSON): Refer to the right function. (cherry picked from commit 0670032c0dc03c0df6e11b5411b8d10fc61a7d41) --- diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index ac235cc1c57..c88e03e66e5 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -5841,7 +5841,7 @@ keyword @code{false}. It defaults to the symbol @code{:false}. @defun json-insert object &rest args This function inserts the JSON representation of @var{object} into the current buffer before point. The argument @var{args} are interpreted -as in @code{json-parse-string}. +as in @code{json-serialize}. @end defun @defun json-parse-string string &rest args diff --git a/src/json.c b/src/json.c index c3244ad04d2..0b4414956ee 100644 --- a/src/json.c +++ b/src/json.c @@ -636,8 +636,9 @@ DEFUN ("json-insert", Fjson_insert, Sjson_insert, 1, MANY, NULL, doc: /* Insert the JSON representation of OBJECT before point. This is the same as (insert (json-serialize OBJECT ...)), but potentially -faster. See the function `json-serialize' for allowed values of -OBJECT and ARGS. +faster, and with the difference that Unicode characters are inserted as +themselves into multibyte buffers, as UTF-8 bytes into unibyte buffers. +See the function `json-serialize' for allowed values of OBJECT and ARGS. usage: (json-insert OBJECT &rest ARGS) */) (ptrdiff_t nargs, Lisp_Object *args) {