Function: erc-member-if

erc-member-if is a byte-compiled function defined in erc-compat.el.gz.

This function is obsolete since 28.1; use cl-member-if instead.

Signature

(erc-member-if PREDICATE LIST)

Documentation

Find the first item satisfying PREDICATE in LIST.

Return the sublist of LIST whose car matches.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc-compat.el.gz
;; Provide a simpler replacement for `cl-member-if'
(defun erc-member-if (predicate list)
  "Find the first item satisfying PREDICATE in LIST.
Return the sublist of LIST whose car matches."
  (declare (obsolete cl-member-if "28.1"))
  (let ((ptr list))
    (catch 'found
      (while ptr
	(when (funcall predicate (car ptr))
	  (throw 'found ptr))
	(setq ptr (cdr ptr))))))