aboutsummaryrefslogtreecommitdiffstats
path: root/src/json.c
diff options
context:
space:
mode:
authorEli Zaretskii2019-04-13 10:07:15 +0300
committerEli Zaretskii2019-04-13 10:07:15 +0300
commit2475687d2f0ca6a605d091bb7acb723d0dace27b (patch)
tree977ae5a872959d149f09e759a20a0a5370ce1379 /src/json.c
parent7ddd08bd3ebc48998062a7d29274cf080256a48f (diff)
downloademacs-2475687d2f0ca6a605d091bb7acb723d0dace27b.tar.gz
emacs-2475687d2f0ca6a605d091bb7acb723d0dace27b.zip
Improve documentation changes of a recent commit
* doc/lispref/text.texi (Parsing JSON): Improve wording of the documentation of 'json-parse-string' and 'json-parse-buffer'. * src/json.c (Fjson_parse_string, Fjson_parse_buffer): Doc fix. (Bug#34763)
Diffstat (limited to 'src/json.c')
-rw-r--r--src/json.c42
1 files changed, 32 insertions, 10 deletions
diff --git a/src/json.c b/src/json.c
index eb323b498c7..74e0534065f 100644
--- a/src/json.c
+++ b/src/json.c
@@ -948,23 +948,22 @@ json_to_lisp (json_t *json, struct json_configuration *conf)
948DEFUN ("json-parse-string", Fjson_parse_string, Sjson_parse_string, 1, MANY, 948DEFUN ("json-parse-string", Fjson_parse_string, Sjson_parse_string, 1, MANY,
949 NULL, 949 NULL,
950 doc: /* Parse the JSON STRING into a Lisp object. 950 doc: /* Parse the JSON STRING into a Lisp object.
951
952This is essentially the reverse operation of `json-serialize', which 951This is essentially the reverse operation of `json-serialize', which
953see. The returned object will be a vector, hashtable, alist, or 952see. The returned object will be a vector, list, hashtable, alist, or
954plist. Its elements will be the JSON null value, the JSON false 953plist. Its elements will be the JSON null value, the JSON false
955value, t, numbers, strings, or further vectors, hashtables, alists, or 954value, t, numbers, strings, or further vectors, hashtables, alists, or
956plists. If there are duplicate keys in an object, all but the last 955plists. If there are duplicate keys in an object, all but the last
957one are ignored. If STRING doesn't contain a valid JSON object, an 956one are ignored. If STRING doesn't contain a valid JSON object, this
958error of type `json-parse-error' is signaled. The arguments ARGS are 957function signals an error of type `json-parse-error'.
959a list of keyword/argument pairs: 958
959The arguments ARGS are a list of keyword/argument pairs:
960 960
961The keyword argument `:object-type' specifies which Lisp type is used 961The keyword argument `:object-type' specifies which Lisp type is used
962to represent objects; it can be `hash-table', `alist' or `plist'. It 962to represent objects; it can be `hash-table', `alist' or `plist'. It
963defaults to `hash-table'. 963defaults to `hash-table'.
964 964
965The keyword argument `:array-type' specifies which Lisp type is used 965The keyword argument `:array-type' specifies which Lisp type is used
966to represent arrays; it can be `array' or `list'. It defaults to 966to represent arrays; it can be `array' (the default) or `list'.
967`array'.
968 967
969The keyword argument `:null-object' specifies which object to use 968The keyword argument `:null-object' specifies which object to use
970to represent a JSON null value. It defaults to `:null'. 969to represent a JSON null value. It defaults to `:null'.
@@ -1042,9 +1041,32 @@ json_read_buffer_callback (void *buffer, size_t buflen, void *data)
1042DEFUN ("json-parse-buffer", Fjson_parse_buffer, Sjson_parse_buffer, 1041DEFUN ("json-parse-buffer", Fjson_parse_buffer, Sjson_parse_buffer,
1043 0, MANY, NULL, 1042 0, MANY, NULL,
1044 doc: /* Read JSON object from current buffer starting at point. 1043 doc: /* Read JSON object from current buffer starting at point.
1045This is similar to `json-parse-string', which see. Move point after 1044Move point after the end of the object if parsing was successful.
1046the end of the object if parsing was successful. On error, point is 1045On error, don't move point.
1047not moved. 1046
1047The returned object will be a vector, list, hashtable, alist, or
1048plist. Its elements will be the JSON null value, the JSON false
1049value, t, numbers, strings, or further vectors, lists, hashtables,
1050alists, or plists. If there are duplicate keys in an object, all
1051but the last one are ignored.
1052
1053If the current buffer doesn't contain a valid JSON object, the
1054function signals an error of type `json-parse-error'.
1055
1056The arguments ARGS are a list of keyword/argument pairs:
1057
1058The keyword argument `:object-type' specifies which Lisp type is used
1059to represent objects; it can be `hash-table', `alist' or `plist'. It
1060defaults to `hash-table'.
1061
1062The keyword argument `:array-type' specifies which Lisp type is used
1063to represent arrays; it can be `array' (the default) or `list'.
1064
1065The keyword argument `:null-object' specifies which object to use
1066to represent a JSON null value. It defaults to `:null'.
1067
1068The keyword argument `:false-object' specifies which object to use to
1069represent a JSON false value. It defaults to `:false'.
1048usage: (json-parse-buffer &rest args) */) 1070usage: (json-parse-buffer &rest args) */)
1049 (ptrdiff_t nargs, Lisp_Object *args) 1071 (ptrdiff_t nargs, Lisp_Object *args)
1050{ 1072{