Function: lax-plist-get

lax-plist-get is a function defined in fns.c.

Signature

(lax-plist-get PLIST PROP)

Documentation

Extract a value from a property list, comparing with equal.

This function is otherwise like plist-get, but may signal an error if PLIST isn't a valid plist.

Other relevant functions are documented in the list group.

Probably introduced at or before Emacs version 22.1.

Shortdoc

;; list
(lax-plist-get '("a" 1 "b" 2 "c" 3) "b")
    => 2

Source Code

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

  CHECK_TYPE (NILP (tail), Qplistp, plist);

  return Qnil;
}