Function: compat--plist-get

compat--plist-get is a byte-compiled function defined in compat-29.el.

Signature

(compat--plist-get PLIST PROP &optional PREDICATE)

Documentation

[Compatibility function for plist-get, defined in Emacs 29.1. See (compat)
Emacs 29.1' for more details.]

Handle optional argument PREDICATE.

Source Code

;; Defined in ~/.emacs.d/elpa/compat-30.1.0.1/compat-29.el
(compat-defun plist-get (plist prop &optional predicate) ;; <compat-tests:plist-get>
  "Handle optional argument PREDICATE."
  :extended t
  (pcase predicate
    ((or `nil `eq) (plist-get plist prop))
    (`equal (lax-plist-get plist prop))
    (_ (catch 'found
         (while (consp plist)
           (when (funcall predicate prop (car plist))
             (throw 'found (cadr plist)))
           (setq plist (cddr plist)))))))