mirror of
https://github.com/correl/melpa.git
synced 2024-12-22 11:08:54 +00:00
Also convert json-fix.el to use cl-lib
This commit is contained in:
parent
376be7f890
commit
3b9792f778
1 changed files with 4 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
||||||
;;; Fixes for json.el such that integer plist / alist keys are rendered as strings, in order to comply with the json spec
|
;;; Fixes for json.el such that integer plist / alist keys are rendered as strings, in order to comply with the json spec
|
||||||
|
|
||||||
(require 'json)
|
(require 'json)
|
||||||
|
(require 'cl-lib)
|
||||||
|
|
||||||
(defun json-encode-key-value-pair (pair)
|
(defun json-encode-key-value-pair (pair)
|
||||||
"Encode a (key . value) PAIR as JSON, ensuring that key is encoded into a string."
|
"Encode a (key . value) PAIR as JSON, ensuring that key is encoded into a string."
|
||||||
|
@ -26,9 +27,9 @@
|
||||||
(defun json-encode-plist (plist)
|
(defun json-encode-plist (plist)
|
||||||
"Return a JSON representation of PLIST."
|
"Return a JSON representation of PLIST."
|
||||||
(json-encode-alist
|
(json-encode-alist
|
||||||
(loop while plist
|
(cl-loop while plist
|
||||||
collect (cons (car plist) (cadr plist))
|
collect (cons (car plist) (cadr plist))
|
||||||
do (setf plist (cddr plist)))))
|
do (setf plist (cddr plist)))))
|
||||||
|
|
||||||
|
|
||||||
(provide 'json-fix)
|
(provide 'json-fix)
|
||||||
|
|
Loading…
Reference in a new issue