Function: plstore--match

plstore--match is a byte-compiled function defined in plstore.el.gz.

Signature

(plstore--match ENTRY KEYS SKIP-IF-SECRET-FOUND)

Documentation

Return whether plist KEYS matches ENTRY.

ENTRY should be a key of the merged alist of a PLSTORE. This function returns nil if KEYS do not match ENTRY, t if they match, and symbol secret if the secret alist needs to be consulted to perform a match.

Source Code

;; Defined in /usr/src/emacs/lisp/plstore.el.gz
(defun plstore--match (entry keys skip-if-secret-found)
  "Return whether plist KEYS matches ENTRY.
ENTRY should be a key of the merged alist of a PLSTORE.  This
function returns nil if KEYS do not match ENTRY, t if they match,
and symbol `secret' if the secret alist needs to be consulted to
perform a match."
  (let ((result t) key-name key-value prop-value secret-name)
    (while keys
      (setq key-name (car keys)
	    key-value (car (cdr keys))
	    prop-value (plist-get (cdr entry) key-name))
	(unless (member prop-value key-value)
	  (if skip-if-secret-found
	      (progn
		(setq secret-name
		      (intern (concat ":secret-"
				      (substring (symbol-name key-name) 1))))
		(if (plist-member (cdr entry) secret-name)
		    (setq result 'secret)
		  (setq result nil
			keys nil)))
	    (setq result nil
		  keys nil)))
	(setq keys (nthcdr 2 keys)))
    result))