aboutsummaryrefslogtreecommitdiff
path: root/compat-28.el
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2023-01-06 22:20:27 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2023-01-06 22:28:48 +0100
commitd6a4ed48bca8c99e9e9d9617eaa4ae4a0dceca46 (patch)
tree2b988fd15c068ed342167daad092be8cd062f009 /compat-28.el
parent02f4d3a795fdfc9cf4da6086137e3bfa39747cba (diff)
Move json functions to compat.el
These functions are defined conditionally. Therefore they must not be part of the versioned files. Conditionally-defined functions are a special complicated edge case, which need more testing. Therefore the json functions are currently marked as UNTESTED.
Diffstat (limited to 'compat-28.el')
-rw-r--r--compat-28.el11
1 files changed, 5 insertions, 6 deletions
diff --git a/compat-28.el b/compat-28.el
index a3e2e4a..7f0ca86 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -155,6 +155,7 @@ If COUNT is non-nil and a natural number, the function will
;;;; Defined in json.c
+;; TODO Check interaction with conditionally defined json functions
(compat-defun json-serialize (object &rest args) ;; <UNTESTED>
"Handle top-level JSON values."
:explicit t
@@ -163,19 +164,16 @@ If COUNT is non-nil and a natural number, the function will
(apply #'json-serialize object args)
(substring (json-serialize (list object)) 1 -1)))
+;; TODO Check interaction with conditionally defined json functions
(compat-defun json-insert (object &rest args) ;; <UNTESTED>
"Handle top-level JSON values."
:explicit t
:min-version "27"
(if (or (listp object) (vectorp object))
(apply #'json-insert object args)
- ;; `compat-json-serialize' is not sharp-quoted as the byte
- ;; compiled doesn't always know that the function has been
- ;; defined, but it will only be used in this function if the
- ;; prefixed definition of `json-serialize' (see above) has also
- ;; been defined.
- (insert (apply 'compat-json-serialize object args))))
+ (insert (apply #'compat--json-serialize object args))))
+;; TODO Check interaction with conditionally defined json functions
(compat-defun json-parse-string (string &rest args) ;; <UNTESTED>
"Handle top-level JSON values."
:explicit t
@@ -187,6 +185,7 @@ If COUNT is non-nil and a natural number, the function will
;; is we can access the first element.
(elt (apply #'json-parse-string (concat "[" string "]") args) 0)))
+;; TODO Check interaction with conditionally defined json functions
(compat-defun json-parse-buffer (&rest args) ;; <UNTESTED>
"Handle top-level JSON values."
:explicit t