Function: consult--narrow-setup

consult--narrow-setup is a natively compiled function defined in consult.el.

Signature

(consult--narrow-setup CONFIG MAP)

Documentation

Setup narrowing with CONFIG and keymap MAP.

Source Code

;; Defined in /nix/store/6higv2v1wk916v4ynnybyrdkfy2gq44d-emacs-packages-deps/share/emacs/site-lisp/elpa/consult-20261004.957/consult.el
(defun consult--narrow-setup (config map)
  "Setup narrowing with CONFIG and keymap MAP."
  (setq consult--narrow-config (if (memq :keys config)
                                   config (list :keys config)))
  (when-let* ((key consult-narrow-key))
    (setq key (consult--key-parse key))
    (dolist (pair (plist-get consult--narrow-config :keys))
      (define-key map (vconcat key (vector (car pair)))
                  (cons (cdr pair) #'consult-narrow))))
  (when-let* ((widen (consult--widen-key)))
    (define-key map widen (cons "All" #'consult-narrow))))