Function: cl-rassoc

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

Signature

(cl-rassoc ITEM LIST [KEYWORD VALUE]...)

Documentation

Find the first item whose cdr matches ITEM in LIST.

Keywords supported: :test :test-not :key

View in manual

Aliases

rassoc* (obsolete since 27.1)

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/cl-seq.el.gz
;;;###autoload
(defun cl-rassoc (item alist &rest cl-keys)
  "Find the first item whose cdr matches ITEM in LIST.
\nKeywords supported:  :test :test-not :key
\n(fn ITEM LIST [KEYWORD VALUE]...)"
  (declare (important-return-value t))
  (if (or cl-keys (numberp item))
      (cl--parsing-keywords (:test :test-not :key :if :if-not) ()
        (while (and alist
                    (or (not (consp (car alist)))
                        (not (cl--check-test item (cdr (car alist))))))
          (setq alist (cdr alist)))
        (and alist (car alist)))
    (rassq item alist)))