Function: marginalia-classify-by-prompt

marginalia-classify-by-prompt is a natively compiled function defined in marginalia.el.

Signature

(marginalia-classify-by-prompt)

Documentation

Determine category by matching regexps against the minibuffer prompt.

This runs through the marginalia-prompt-categories alist looking for a regexp that matches the prompt.

Source Code

;; Defined in /nix/store/hym71by08nv7fpgl7asan3dvidx05yya-emacs-packages-deps/share/emacs/site-lisp/elpa/marginalia-20260926.1228/marginalia.el
(defun marginalia-classify-by-prompt ()
  "Determine category by matching regexps against the minibuffer prompt.
This runs through the `marginalia-prompt-categories' alist
looking for a regexp that matches the prompt."
  (when-let* ((prompt (minibuffer-prompt)))
    (setq prompt
          (replace-regexp-in-string "(.*?default.*?)\\|\\[.*?\\]" "" prompt))
    (cl-loop with case-fold-search = t
             for (regexp . category) in marginalia-prompt-categories
             when (string-match-p regexp prompt)
             return category)))