mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
fix(editor): improve filtering performance of M-x when marginalia is active
The default 'marginalia-annotate-command annotation method for M-x candidates has a small but perceivable performance impact as you type. The 'marginalia-annotate-binding method does not have any perceivable performance impact. Also I only really care about seeing keybindings in the M-x list, I can definitely live without command descriptions.
This commit is contained in:
@@ -10,7 +10,22 @@
|
||||
:bind (:map minibuffer-local-map
|
||||
("M-A" . marginalia-cycle))
|
||||
:init
|
||||
(marginalia-mode +1))
|
||||
(marginalia-mode +1)
|
||||
|
||||
(defun siren-marginalia-setup ()
|
||||
(interactive)
|
||||
(mapc
|
||||
(lambda (x)
|
||||
(pcase (car x)
|
||||
;; Default command category to 'marginalia-annotate-binding instead of
|
||||
;; 'marginalia-annotate-command which has a slight performance impact
|
||||
;; when filtering M-x candidates.
|
||||
('command (setcdr x (cons 'marginalia-annotate-binding
|
||||
(remq 'marginalia-annotate-binding (cdr x)))))))
|
||||
marginalia-annotator-registry))
|
||||
|
||||
:config
|
||||
(siren-marginalia-setup))
|
||||
|
||||
(provide 'siren-marginalia)
|
||||
;;; siren-marginalia.el ends here
|
||||
|
||||
Reference in New Issue
Block a user