When I first installed wrap-region, I used to install things via the classic M-x
and package-install
. Then, I inserted the following configuration:
;; Emacs minor mode to wrap region with tag or punctuations
(wrap-region-mode 1)
(wrap-region-add-wrapper "*" "*")
(wrap-region-add-wrapper "/" "/")
(wrap-region-add-wrapper "=" "=")
This used to work out. Now, I have moved to a new machine and I have not used classic installation yet (M-x
and package-install
).
I want to do everything via use-package.
I am especially unsure about how to make the mode globally enabled.
This is my first attempt:
(use-package wrap-region
:ensure t
:config
(wrap-region-mode 1)
(wrap-region-add-wrapper "*" "*")
(wrap-region-add-wrapper "/" "/")
(wrap-region-add-wrapper "=" "="))
The wrapper expressions (function call with wrap-region-add-wrapper
) are working as expected.
However, the mode is not being globally enabled when Emacs starts.
How would you convert the declaration previously mentioned to a complete use-package
declarative installation?
I am especially unsure about how to handle the expressions creating the "pattern-matching"
- what pattern matching are you talking about? Not clear to me (but I know close to nothing aboutuse-package
ORwrap-region
- so it's not clear to me whether it refers touse-package
orwrap-region
-or neither - or both).wrap-region-global-mode
is for?(wrap-region-global-mode 1)
should do the global enablement. DoC-h f wrap-region-mode
andC-h f wrap-region-global-mode
for more details. SeeDefining minor modes
for additional insight: doC-h i g(elisp) RET m defining minor modes
to get there.wrap-region
thing and they call it awrapper
, so why not call it that?