Property Lists Outside Symbols
The following functions can be used to manipulate property lists. They all default to comparing property names using eq.
- Function: plist-get plist property &optional predicate
-
This returns the value of the property property stored in the property list plist. Comparisons are done with predicate, which defaults to
eq. It accepts a malformed plist argument. If property is not found in the plist, it returnsnil. 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
- Function: plist-put plist property value &optional predicate
-
This stores value as the value of the property property in the property list plist. Comparisons are done with predicate, which defaults to
eq. 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 (list '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))
- Function: lax-plist-get plist property
This obsolete function is like
plist-getexcept that it compares properties usingequalinstead ofeq.
- Function: lax-plist-put plist property value
This obsolete function is like
plist-putexcept that it compares properties usingequalinstead ofeq.
- Function: plist-member plist property &optional predicate
This returns non-
nilif plist contains the given property. Comparisons are done with predicate, which defaults toeq. Unlikeplist-get, this allows you to distinguish between a missing property and a property with the valuenil. The value is actually the tail of plist whosecaris property.
Copyright © 1990-1996, 1998-2026 Free Software Foundation, Inc.
Licensed under the GNU GPL license.
https://www.gnu.org/software/emacs/manual/html_node/elisp/Plist-Access.html