aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Schubert2013-11-25 00:49:37 +0200
committerDmitry Gutov2013-11-25 00:49:37 +0200
commit7c1bf12e5c285dc2b3955e0a911766370ac0af1e (patch)
tree01f2366a87192e32902a741e62035f830a793ed0
parent64e415297c09d9c92a6b1460c19f97fb4446844d (diff)
downloademacs-7c1bf12e5c285dc2b3955e0a911766370ac0af1e.tar.gz
emacs-7c1bf12e5c285dc2b3955e0a911766370ac0af1e.zip
* lisp/json.el (json-alist-p): Only return non-nil if the alist has
simple keys. Fixes: debbugs:13518
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/json.el5
2 files changed, 8 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7365e8c274e..acc3435ce08 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12013-11-24 Simon Schubert <2@0x2c.org>
2
3 * json.el (json-alist-p): Only return non-nil if the alist has
4 simple keys (Bug#13518).
5
12013-11-22 Mihir Rege <mihirrege@gmail.com> (tiny change) 62013-11-22 Mihir Rege <mihirrege@gmail.com> (tiny change)
2 7
3 * progmodes/js.el (js--ctrl-statement-indentation): Fix indent 8 * progmodes/js.el (js--ctrl-statement-indentation): Fix indent
diff --git a/lisp/json.el b/lisp/json.el
index aaa7bb0c499..21523c1aa8b 100644
--- a/lisp/json.el
+++ b/lisp/json.el
@@ -126,9 +126,10 @@ without indentation.")
126 (mapconcat 'identity strings separator)) 126 (mapconcat 'identity strings separator))
127 127
128(defun json-alist-p (list) 128(defun json-alist-p (list)
129 "Non-null if and only if LIST is an alist." 129 "Non-null if and only if LIST is an alist with simple keys."
130 (while (consp list) 130 (while (consp list)
131 (setq list (if (consp (car list)) 131 (setq list (if (and (consp (car list))
132 (atom (caar list)))
132 (cdr list) 133 (cdr list)
133 'not-alist))) 134 'not-alist)))
134 (null list)) 135 (null list))