Function: plist-get
plist-get is a function defined in fns.c.
Signature
(plist-get PLIST PROP &optional PREDICATE)
Documentation
Extract a value from a property list.
PLIST is a property list, which is a list of the form
(PROP1 VALUE1 PROP2 VALUE2...).
This function returns the value corresponding to the given PROP, or
nil if PROP is not one of the properties on the list. The comparison
with PROP is done using PREDICATE, which defaults to eq.
This function doesn't signal an error if PLIST is invalid.
Other relevant functions are documented in the list group.
Probably introduced at or before Emacs version 19.29.
Shortdoc
;; list
(plist-get '(a 1 b 2 c 3) 'b)
=> 2
Aliases
Source Code
// Defined in /usr/src/emacs/src/fns.c
{
if (NILP (predicate))
return plist_get (plist, prop);
Lisp_Object tail = plist;
FOR_EACH_TAIL_SAFE (tail)
{
if (! CONSP (XCDR (tail)))
break;
if (!NILP (calln (predicate, XCAR (tail), prop)))
return XCAR (XCDR (tail));
tail = XCDR (tail);
}
return Qnil;
}