nprofile1qy2hwumn8ghj7un9d3shjtnddaehgu3wwp6kyqpqu5e7lvg4hfwj833c4wgqymsgn7agd7tg9geexrwc6qlezu9ntrxssr93qq (nprofile…93qq) I'll explain in a bit more detail, just in case. `append' concatenates lists, e.g.
(append '(1 2) '(3 4)) => (1 2 3 4)
You can use `push':
(setq my/test '((:b 2) (:c 3)))
(push '(:a 1) my/test) => ((:a 1) (:b 2) (:c 3))
This adds the item to the front of the list, because Lisp lists are just cons cells:
'((:a 1) . ((:b 2) . ((:c 3) . nil))) => ((:a 1) (:b 2) (:c 3))
So, adding any item to a list is just (cons <new-item> old-list). Which is what `push' does, see the docstring:
> This is morally equivalent to (setf PLACE (cons NEWELT PLACE)),
> except that PLACE is evaluated only once (after NEWELT).
`append' is a more complex function, which iterates over every argument and concatenates the result into one list.
Hence, unlike `push', it is O(n), which is also the complexity of adding an element to the end of list in Lisp, so it's almost never done. But, if you want that, nothing stops you from doing as nprofile1qy2hwumn8ghj7un9d3shjtnddaehgu3wwp6kyqpqqmshcslmwan3erj3ulczepe8q8a8xdyfkndnk8fudgtg8ccwg6zqlsl9jz (nprofile…l9jz) suggests:
(append list (list plist))
`(,@list ,plist)
or
(append list `(,plist))
Unless you're doing that in a loop, in which case you'd be better off with `push' and `nreverse'.
Also, json.el prefers alists to plists, although it tries to do its best. E.g.:
(json-encode '(:a 1 :b 2 :c 3)) => {"a": 1, "b": 2, "c": 3}
(json-encode '((:a 1 :b 2 :c 3))) => {"a": [1, "b", 2, "c", 3]}
Because the second object is indistinguishable from:
(json-encode '((:a . (1 :b 2 :c 3)))) => {"a": [1, "b", 2, "c", 3]}
And with alists, there's no such confusion:
(json-encode '((:a . 1) (:b . 2) (:c . 3))) => {"a": 1, "b": 2, "c": 3}
(json-encode '(((:a . 1) (:b . 2) (:c . 3)))) => [{"a": 1, "b": 2, "c": 3}]