Function: cl-find

cl-find is an autoloaded and byte-compiled function defined in cl-seq.el.gz.

Signature

(cl-find ITEM SEQ [KEYWORD VALUE]...)

Documentation

Find the first occurrence of ITEM in SEQ.

Return the matching ITEM, or nil if not found.

Keywords supported: :test :test-not :key :start :end :from-end

View in manual

Aliases

find (obsolete since 27.1)

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/cl-seq.el.gz
;;;###autoload
(defun cl-find (item seq &rest cl-keys)
  "Find the first occurrence of ITEM in SEQ.
Return the matching ITEM, or nil if not found.
\nKeywords supported:  :test :test-not :key :start :end :from-end
\n(fn ITEM SEQ [KEYWORD VALUE]...)"
  (declare (important-return-value t))
  (let ((pos (apply #'cl-position item seq cl-keys)))
    (and pos (elt seq pos))))