aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/json.el
diff options
context:
space:
mode:
authorHelmut Eller2026-02-13 09:10:16 +0100
committerHelmut Eller2026-02-13 09:10:16 +0100
commit91c9e9883488d715a30877dfd7641ef4b3c62658 (patch)
treee2c4525147e443f86baf9d0144aeadec082d7564 /lisp/json.el
parent9a4a54af9192a6653164364c75721ee814ffb1e8 (diff)
parentf1fe4d46190263e164ccd1e066095d46a156297f (diff)
downloademacs-feature/igc.tar.gz
emacs-feature/igc.zip
Merge branch 'master' into feature/igcfeature/igc
Diffstat (limited to 'lisp/json.el')
-rw-r--r--lisp/json.el11
1 files changed, 5 insertions, 6 deletions
diff --git a/lisp/json.el b/lisp/json.el
index f2086474a8b..82cc9c71bf5 100644
--- a/lisp/json.el
+++ b/lisp/json.el
@@ -609,12 +609,11 @@ transforms an unsortable MAP into a sortable alist."
609 "Insert a JSON representation of ALIST at point. 609 "Insert a JSON representation of ALIST at point.
610Sort ALIST first if `json-encoding-object-sort-predicate' is 610Sort ALIST first if `json-encoding-object-sort-predicate' is
611non-nil. Sorting can optionally be DESTRUCTIVE for speed." 611non-nil. Sorting can optionally be DESTRUCTIVE for speed."
612 (json--print-map (if (and json-encoding-object-sort-predicate alist) 612 (json--print-map (let ((pred json-encoding-object-sort-predicate))
613 (sort (if destructive alist (copy-sequence alist)) 613 (if (and pred alist)
614 (lambda (a b) 614 (sort alist :key #'car :lessp pred
615 (funcall json-encoding-object-sort-predicate 615 :in-place destructive)
616 (car a) (car b)))) 616 alist))))
617 alist)))
618 617
619;; The following two are unused but useful to keep around due to the 618;; The following two are unused but useful to keep around due to the
620;; inherent ambiguity of lists. 619;; inherent ambiguity of lists.