Function: consult-mode-command
consult-mode-command is an interactive and natively compiled function
defined in consult.el.
Signature
(consult-mode-command &rest MODES)
Documentation
Run a command from any of the given MODES.
If no MODES are specified, use currently active major and minor modes.
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
;;;###autoload
(defun consult-mode-command (&rest modes)
"Run a command from any of the given MODES.
If no MODES are specified, use currently active major and minor modes."
(interactive)
(unless modes
(setq modes (cons major-mode
(seq-filter (lambda (m)
(and (boundp m) (symbol-value m)))
minor-mode-list))))
(let ((narrow `((?m . ,(format "Major: %s" major-mode))
(?l . "Local Minor")
(?g . "Global Minor"))))
(command-execute
(consult--read
(consult--mode-command-candidates modes)
:prompt "Mode command: "
:predicate
(lambda (cand)
(let ((key (get-text-property 0 'consult--type cand)))
(if consult--narrow
(= key consult--narrow)
(/= key ?g))))
:lookup #'consult--lookup-candidate
:group (consult--type-group narrow)
:narrow narrow
:require-match t
:history 'extended-command-history
:category 'command))))