diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-11-02 22:05:29 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-11-02 22:05:29 +0100 |
commit | 5889bd827e5d45e7026ebf0d00b0751ca5f4e049 (patch) | |
tree | ede9d67ebed99c12d0b5abe57266c05d5fc93975 /.config/emacs/modules | |
parent | 241d53e5b47ef70902538c9a645e743f38a5626f (diff) |
emacs: Make loading multiple-cursors silent
Diffstat (limited to '.config/emacs/modules')
-rw-r--r-- | .config/emacs/modules/mm-editing.el | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/.config/emacs/modules/mm-editing.el b/.config/emacs/modules/mm-editing.el index 46eaa0f..6fbb44f 100644 --- a/.config/emacs/modules/mm-editing.el +++ b/.config/emacs/modules/mm-editing.el @@ -170,6 +170,20 @@ region are marked, otherwise all matches in the buffer are marked." (mm--define-mc-marking-command mm-mark-all-in-region-regexp re-search-forward "regexp") +(defun mm-silent-mc-load (args) + "Advice to `load' to force it to be silent. The `multiple-cursors' +package loads an `.mc-lists.el' file without passing `:nomessage' which +causes messages to be sent in the minibuffer and *Messages* buffer. This +forces that to not happen." + (when (and (boundp 'mc/list-file) + (string= (car args) mc/list-file)) + (pcase (length args) + (1 (setq args (list (car args) nil :nomessage))) + (2 (add-to-list 'args :nomessage :append)) + (_ (setf (caddr args) :nomessage))) + (advice-remove #'load #'mm-silent-mc-load)) + args) + (use-package multiple-cursors :ensure t :defer 2 @@ -180,6 +194,7 @@ region are marked, otherwise all matches in the buffer are marked." ("C-$" . #'mm-mark-all-in-region) ("M-$" . #'mm-mark-all-in-region-regexp)) :init + (advice-add #'load :filter-args #'mm-silent-mc-load) (with-eval-after-load 'multiple-cursors-core (dolist (command #'(backward-delete-char capitalize-dwim |