diff options
| author | Eli Zaretskii | 2019-04-13 10:07:15 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2019-04-13 10:07:15 +0300 |
| commit | 2475687d2f0ca6a605d091bb7acb723d0dace27b (patch) | |
| tree | 977ae5a872959d149f09e759a20a0a5370ce1379 /src/json.c | |
| parent | 7ddd08bd3ebc48998062a7d29274cf080256a48f (diff) | |
| download | emacs-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.c | 42 |
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) | |||
| 948 | DEFUN ("json-parse-string", Fjson_parse_string, Sjson_parse_string, 1, MANY, | 948 | DEFUN ("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 | |||
| 952 | This is essentially the reverse operation of `json-serialize', which | 951 | This is essentially the reverse operation of `json-serialize', which |
| 953 | see. The returned object will be a vector, hashtable, alist, or | 952 | see. The returned object will be a vector, list, hashtable, alist, or |
| 954 | plist. Its elements will be the JSON null value, the JSON false | 953 | plist. Its elements will be the JSON null value, the JSON false |
| 955 | value, t, numbers, strings, or further vectors, hashtables, alists, or | 954 | value, t, numbers, strings, or further vectors, hashtables, alists, or |
| 956 | plists. If there are duplicate keys in an object, all but the last | 955 | plists. If there are duplicate keys in an object, all but the last |
| 957 | one are ignored. If STRING doesn't contain a valid JSON object, an | 956 | one are ignored. If STRING doesn't contain a valid JSON object, this |
| 958 | error of type `json-parse-error' is signaled. The arguments ARGS are | 957 | function signals an error of type `json-parse-error'. |
| 959 | a list of keyword/argument pairs: | 958 | |
| 959 | The arguments ARGS are a list of keyword/argument pairs: | ||
| 960 | 960 | ||
| 961 | The keyword argument `:object-type' specifies which Lisp type is used | 961 | The keyword argument `:object-type' specifies which Lisp type is used |
| 962 | to represent objects; it can be `hash-table', `alist' or `plist'. It | 962 | to represent objects; it can be `hash-table', `alist' or `plist'. It |
| 963 | defaults to `hash-table'. | 963 | defaults to `hash-table'. |
| 964 | 964 | ||
| 965 | The keyword argument `:array-type' specifies which Lisp type is used | 965 | The keyword argument `:array-type' specifies which Lisp type is used |
| 966 | to represent arrays; it can be `array' or `list'. It defaults to | 966 | to represent arrays; it can be `array' (the default) or `list'. |
| 967 | `array'. | ||
| 968 | 967 | ||
| 969 | The keyword argument `:null-object' specifies which object to use | 968 | The keyword argument `:null-object' specifies which object to use |
| 970 | to represent a JSON null value. It defaults to `:null'. | 969 | to represent a JSON null value. It defaults to `:null'. |
| @@ -1042,9 +1041,32 @@ json_read_buffer_callback (void *buffer, size_t buflen, void *data) | |||
| 1042 | DEFUN ("json-parse-buffer", Fjson_parse_buffer, Sjson_parse_buffer, | 1041 | DEFUN ("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. |
| 1045 | This is similar to `json-parse-string', which see. Move point after | 1044 | Move point after the end of the object if parsing was successful. |
| 1046 | the end of the object if parsing was successful. On error, point is | 1045 | On error, don't move point. |
| 1047 | not moved. | 1046 | |
| 1047 | The returned object will be a vector, list, hashtable, alist, or | ||
| 1048 | plist. Its elements will be the JSON null value, the JSON false | ||
| 1049 | value, t, numbers, strings, or further vectors, lists, hashtables, | ||
| 1050 | alists, or plists. If there are duplicate keys in an object, all | ||
| 1051 | but the last one are ignored. | ||
| 1052 | |||
| 1053 | If the current buffer doesn't contain a valid JSON object, the | ||
| 1054 | function signals an error of type `json-parse-error'. | ||
| 1055 | |||
| 1056 | The arguments ARGS are a list of keyword/argument pairs: | ||
| 1057 | |||
| 1058 | The keyword argument `:object-type' specifies which Lisp type is used | ||
| 1059 | to represent objects; it can be `hash-table', `alist' or `plist'. It | ||
| 1060 | defaults to `hash-table'. | ||
| 1061 | |||
| 1062 | The keyword argument `:array-type' specifies which Lisp type is used | ||
| 1063 | to represent arrays; it can be `array' (the default) or `list'. | ||
| 1064 | |||
| 1065 | The keyword argument `:null-object' specifies which object to use | ||
| 1066 | to represent a JSON null value. It defaults to `:null'. | ||
| 1067 | |||
| 1068 | The keyword argument `:false-object' specifies which object to use to | ||
| 1069 | represent a JSON false value. It defaults to `:false'. | ||
| 1048 | usage: (json-parse-buffer &rest args) */) | 1070 | usage: (json-parse-buffer &rest args) */) |
| 1049 | (ptrdiff_t nargs, Lisp_Object *args) | 1071 | (ptrdiff_t nargs, Lisp_Object *args) |
| 1050 | { | 1072 | { |