Function: consult-register--alist

consult-register--alist is a byte-compiled function defined in consult-register.el.

Signature

(consult-register--alist &optional NOERROR PRED)

Documentation

Return register list, sorted and filtered with PRED.

Raise an error if the list is empty and NOERROR is nil.

Source Code

;; Defined in ~/.emacs.d/elpa/consult-20260805.1130/consult-register.el
(defun consult-register--alist (&optional noerror pred)
  "Return register list, sorted and filtered with PRED.
Raise an error if the list is empty and NOERROR is nil."
  (or (sort (cl-loop for reg in register-alist
                     ;; Sometimes, registers are made without a `cdr' or with
                     ;; invalid markers.  Such registers don't do anything, and
                     ;; can be ignored.
                     if (when-let* ((val (cdr reg)))
                          (and (or (not (markerp val)) (marker-buffer val))
                               (or (not pred) (funcall pred val))))
                     collect reg)
            #'car-less-than-car)
      (and (not noerror) (user-error "All registers are empty"))))