]> git.eshelyaron.com Git - emacs.git/commitdiff
json-insert doc fixes
authorMattias EngdegÄrd <mattiase@acm.org>
Tue, 2 Apr 2024 15:51:38 +0000 (17:51 +0200)
committerEshel Yaron <me@eshelyaron.com>
Wed, 3 Apr 2024 06:47:57 +0000 (08:47 +0200)
* 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)

doc/lispref/text.texi
src/json.c

index ac235cc1c57b2ce7d6f97b8a82c8fcb2eda25dc9..c88e03e66e5580da7248626ae53d648b05929588 100644 (file)
@@ -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
index c3244ad04d2f0346b18a796056c0e0326767b1af..0b4414956ee1582d45ea9889e05dc8e7b3fec406 100644 (file)
@@ -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)
 {