Function: consult-narrow

consult-narrow is an interactive and natively compiled function defined in consult.el.

Signature

(consult-narrow KEY)

Documentation

Narrow current completion with KEY.

This command is used internally by the narrowing system of consult--read.

Key Bindings

This command is not in any keymaps.

Source Code

;; Defined in /nix/store/6higv2v1wk916v4ynnybyrdkfy2gq44d-emacs-packages-deps/share/emacs/site-lisp/elpa/consult-20261004.957/consult.el
(defun consult-narrow (key)
  "Narrow current completion with KEY.

This command is used internally by the narrowing system of `consult--read'."
  (declare (completion ignore))
  (interactive
   (list (unless (equal (this-single-command-keys) (consult--widen-key))
           last-command-event)))
  (consult--require-minibuffer)
  (setq consult--narrow key)
  (when-let* ((pred (plist-get consult--narrow-config :predicate)))
    (setq minibuffer-completion-predicate (and consult--narrow pred)))
  (when consult--narrow-overlay
    (delete-overlay consult--narrow-overlay))
  (when consult--narrow
    (setq consult--narrow-overlay
          (consult--make-overlay
           (1- (minibuffer-prompt-end)) (minibuffer-prompt-end)
           'before-string
           (format #(" [%s]" 0 5 (face consult-narrow-indicator))
                   (alist-get consult--narrow
                              (plist-get consult--narrow-config :keys))))))
  (run-hooks 'consult--completion-refresh-hook))