Function: cl-subsetp

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

Signature

(cl-subsetp LIST1 LIST2 [KEYWORD VALUE]...)

Documentation

Return true if LIST1 is a subset of LIST2.

I.e., if every element of LIST1 also appears in LIST2.

Keywords supported: :test :test-not :key

View in manual

Aliases

subsetp (obsolete since 27.1)

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/cl-seq.el.gz
;;;###autoload
(defun cl-subsetp (list1 list2 &rest cl-keys)
  "Return true if LIST1 is a subset of LIST2.
I.e., if every element of LIST1 also appears in LIST2.
\nKeywords supported:  :test :test-not :key
\n(fn LIST1 LIST2 [KEYWORD VALUE]...)"
  (declare (important-return-value t))
  (cond ((null list1) t) ((null list2) nil)
        ((equal list1 list2) t)
	(t (cl--parsing-keywords (:key) (:test :test-not)
             (while (and list1
                         (apply #'cl-member (cl--check-key (car list1))
                                list2 cl-keys))
               (pop list1))
             (null list1)))))