Function: orderless--predicate-normalized-and

orderless--predicate-normalized-and is a natively compiled function defined in orderless.el.

Signature

(orderless--predicate-normalized-and P Q)

Documentation

Combine two predicate functions P and Q with and.

The first function P is a completion predicate which can receive up to two arguments. The second function Q always receives a normalized string as argument.

Source Code

;; Defined in /nix/store/x8591dlnsvch2j4brlxddqs0axxy3w60-emacs-packages-deps/share/emacs/site-lisp/elpa/orderless-20260927.2344/orderless.el
;;; Completion style implementation

(defun orderless--predicate-normalized-and (p q)
  "Combine two predicate functions P and Q with `and'.
The first function P is a completion predicate which can receive
up to two arguments.  The second function Q always receives a
normalized string as argument."
  (cond
   ((and p q)
    (lambda (k &rest v) ;; v for hash table
      (when (if v (funcall p k (car v)) (funcall p k))
        (setq k (if (consp k) (car k) k)) ;; alist
        (funcall q (if (symbolp k) (symbol-name k) k)))))
   (q
    (lambda (k &optional _) ;; _ for hash table
      (setq k (if (consp k) (car k) k)) ;; alist
      (funcall q (if (symbolp k) (symbol-name k) k))))
   (p)))