Function: plist-member

plist-member is a function defined in fns.c.

Signature

(plist-member PLIST PROP &optional PREDICATE)

Documentation

Return non-nil if PLIST has the property PROP.

PLIST is a property list, which is a list of the form
(PROP1 VALUE1 PROP2 VALUE2 ...).

The comparison with PROP is done using PREDICATE, which defaults to eq.

Unlike plist-get, this allows you to distinguish between a missing property and a property with the value nil. The value is actually the tail of PLIST whose car is PROP.

Other relevant functions are documented in the list group.

View in manual

Probably introduced at or before Emacs version 21.1.

Shortdoc

;; list
(plist-member '(a 1 b 2 c 3) 'b)
    => (b 2 c 3)

Aliases

map--plist-member widget-plist-member (obsolete since 26.1)

Source Code

// Defined in /usr/src/emacs/src/fns.c
{
  if (NILP (predicate))
    return plist_member (plist, prop);
  Lisp_Object tail = plist;
  FOR_EACH_TAIL (tail)
    {
      if (!NILP (calln (predicate, XCAR (tail), prop)))
	return tail;
      tail = XCDR (tail);
      if (! CONSP (tail))
	break;
    }
  CHECK_TYPE (NILP (tail), Qplistp, plist);
  return Qnil;
}