I have noticed a weird behaviour with use-package
for multiple-cursors
when trying to customize insertion of numbers.
I am able to insert numbers on multiple cursors using C-c n
using this code
;; Multiple Cursors
(use-package multiple-cursors
:ensure t
:bind(("C-S-c C-S-c" . mc/edit-lines)
("C-»" . mc/mark-next-like-this)
("C-«" . mc/mark-previous-like-this)
("C-c C-«" . mc/mark-all-like-this))
)
(setq mc/insert-numbers-default 1)
(global-set-key (kbd "C-c n") 'mc/insert-numbers)
but this alternative declaration of multiple-cursors does not produce the same effect, i.e., when pressing C-c n
there is no keybinding associated and no numbers are inserted on the cursors.
;; Multiple Cursors
(use-package multiple-cursors
:ensure t
:bind(("C-S-c C-S-c" . mc/edit-lines)
("C-»" . mc/mark-next-like-this)
("C-«" . mc/mark-previous-like-this)
("C-c C-«" . mc/mark-all-like-this))
:config
(setq mc/insert-numbers-default 1)
(global-set-key (kbd "C-c n") 'mc/insert-numbers)
)
This is strange since the whole point of :config
is to run code after the package is loaded, which is the intended purpose here. It works fine for other packages as far as I can tell. Any thoughts?
C-h v
to inspect the value of themc/insert-numbers-default
variable, for example? Note that packages are lazily loaded, so “after the package is loaded” could easily be after you first call a function defined in the package.