Function: registry-search

registry-search is a byte-compiled function defined in registry.el.gz.

Signature

(registry-search ARG &rest ARGS)

Implementations

(registry-search (DB registry-db) &rest SPEC) in `registry.el'.

Search for SPEC across the registry-db DB. For example calling with `:member '(a 1 2)' will match entry ((a 3 1)). Calling with `:all t' (any non-nil value) will match all. Calling with `:regex '(a "h.llo")' will match entry (a "hullo" "bye"). The test order is to check :all first, then :member, then :regex.

Source Code

;; Defined in /usr/src/emacs/lisp/registry.el.gz
(cl-defmethod registry-search ((db registry-db) &rest spec)
  "Search for SPEC across the registry-db DB.
For example calling with `:member \\='(a 1 2)' will match entry \((a 3 1)).
Calling with `:all t' (any non-nil value) will match all.
Calling with `:regex \\='(a \"h.llo\")' will match entry \(a \"hullo\" \"bye\").
The test order is to check :all first, then :member, then :regex."
  (when db
    (let ((all (plist-get spec :all))
	  (member (plist-get spec :member))
	  (regex (plist-get spec :regex)))
      (cl-loop for k being the hash-keys of (oref db data)
               using (hash-values v)
               when (or
                     ;; :all non-nil returns all
                     all
                     ;; member matching
                     (and member (registry--match :member v member))
                     ;; regex matching
                     (and regex (registry--match :regex v regex)))
               collect k))))