From: Simon Schubert <2@0x2c.org> Date: Sun, 24 Nov 2013 22:49:37 +0000 (+0200) Subject: * lisp/json.el (json-alist-p): Only return non-nil if the alist has X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~716 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7c1bf12e5c285dc2b3955e0a911766370ac0af1e;p=emacs.git * lisp/json.el (json-alist-p): Only return non-nil if the alist has simple keys. Fixes: debbugs:13518 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7365e8c274e..acc3435ce08 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-11-24 Simon Schubert <2@0x2c.org> + + * json.el (json-alist-p): Only return non-nil if the alist has + simple keys (Bug#13518). + 2013-11-22 Mihir Rege (tiny change) * 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.") (mapconcat 'identity strings separator)) (defun json-alist-p (list) - "Non-null if and only if LIST is an alist." + "Non-null if and only if LIST is an alist with simple keys." (while (consp list) - (setq list (if (consp (car list)) + (setq list (if (and (consp (car list)) + (atom (caar list))) (cdr list) 'not-alist))) (null list))