Previous: Plists and Alists, Up: Property Lists
The following functions can be used to manipulate property lists.
They all compare property names using eq
.
This returns the value of the property property stored in the property list plist. It accepts a malformed plist argument. If property is not found in the plist, it returns
nil
. For example,(plist-get '(foo 4) 'foo) ⇒ 4 (plist-get '(foo 4 bad) 'foo) ⇒ 4 (plist-get '(foo 4 bad) 'bad) ⇒ nil (plist-get '(foo 4 bad) 'bar) ⇒ nil
This stores value as the value of the property property in the property list plist. It may modify plist destructively, or it may construct a new list structure without altering the old. The function returns the modified property list, so you can store that back in the place where you got plist. For example,
(setq my-plist '(bar t foo 4)) ⇒ (bar t foo 4) (setq my-plist (plist-put my-plist 'foo 69)) ⇒ (bar t foo 69) (setq my-plist (plist-put my-plist 'quux '(a))) ⇒ (bar t foo 69 quux (a))
Like
plist-get
except that it compares properties usingequal
instead ofeq
.