Add crm indicator and hide commands in M-x
This commit is contained in:
parent
80dc64a09d
commit
e99cccf552
|
@ -12,7 +12,23 @@
|
|||
'(read-only t cursor-intangible t face minibuffer-prompt))
|
||||
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
|
||||
(setq enable-recursive-minibuffers t)
|
||||
(minibuffer-depth-indicate-mode t))
|
||||
(minibuffer-depth-indicate-mode t)
|
||||
|
||||
;; Add prompt indicator to `completing-read-multiple'.
|
||||
;; We display [CRM<separator>], e.g., [CRM,] if the separator is a comma.
|
||||
(defun crm-indicator (args)
|
||||
(cons (format "[CRM%s] %s"
|
||||
(replace-regexp-in-string
|
||||
"\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
|
||||
crm-separator)
|
||||
(car args))
|
||||
(cdr args)))
|
||||
(advice-add #'completing-read-multiple :filter-args #'crm-indicator)
|
||||
|
||||
;; Emacs 28: Hide commands in M-x which do not work in the current mode.
|
||||
;; Vertico commands are hidden in normal buffers.
|
||||
(setq read-extended-command-predicate
|
||||
#'command-completion-default-include-p))
|
||||
|
||||
(use-package vertico
|
||||
:init
|
||||
|
|
Loading…
Reference in New Issue