Eli Zaretskii writes: > Thanks, please see a few comments below. Thanks for reviewing. > json-serialize-use-plists is the literal name of a variable, so it > should have the @code markup, not @var. > Thanks for these doc comments, but I've gotten rid of json-serialize-use-plists, after coming to the conclusion that the map type (hashtable, alist, or plist) can be reliably auto-detected in json-serialize. As a consequence, less stuff to document.. >> + if ( EQ (Vjson_serialize_use_plists, Qt) ) { >> + key_symbol = XCAR (tail); >> + tail = XCDR(tail); >> + CHECK_CONS (tail); >> + value = XCAR (tail); >> + if (EQ (tail, li.tortoise)) circular_list (lisp); >> + } else { >> + Lisp_Object pair = XCAR (tail); > > Our style is to write > > [...] > > Also, please don't leav any whitespace between the opening parenthesis > and the following character, and similarly with closing parens. IOW, > this: OK, got it. > Here I'd use intern_1 instead, it would allow you to avoid > unnecessarily consing Lisp objects. (Yes, I realize that the same > comment applies to the existing code.) Riight, intern_1 sounds good... I know I can't just malloc() stuff as usually right? But also, I have no idea what I'm doing, I aped this from somewhere where it looked more-or-less responsibly done. json_object_foreach (json, key_str, value) { USE_SAFE_ALLOCA; char *keyword_key_str = SAFE_ALLOCA (1 + strlen(key_str) + 1); keyword_key_str[0]=':'; strcpy(&keyword_key_str[1],key_str); Lisp_Object key = intern_1(keyword_key_str, strlen(key_str)+1); result = Fcons (key, result); /* build the plist as value-key since we're going to reverse it in the end.*/ result = Fcons (json_to_lisp (value, object_type), result); SAFE_FREE (); } New patch after my sig João