Github GitHub - joewreschnig/auto-minor-mode: Enable Emacs minor modes by buffer...
source link: https://github.com/joewreschnig/auto-minor-mode
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
auto-minor-mode
This package lets you enable minor modes based on file name and
contents. To find the right modes, it checks filenames against
patterns in auto-minor-mode-alist
and file contents against
auto-minor-mode-magic-alist
. These work like the built-in Emacs
variables auto-mode-alist
and magic-mode-alist
.
Unlike major modes, all matching minor modes are enabled, not only the first match.
A reason you might want to use it:
(add-to-list 'auto-minor-mode-alist '("-theme\\.el\\'" . rainbow-mode))
There's intentionally no equivalent of interpreter-mode-alist
.
Interpreters should determine the major mode. Relevant minor modes can
then be enabled by major mode hooks.
Minor modes are set whenever set-auto-mode
, the built-in function
responsible for handling automatic major modes, is called.
use-package Integration
If you also use use-package, two new keywords are added, :minor
and :magic-minor
, which register entries in these alists. You must
load (and not defer) auto-minor-mode
before using these keywords.
License
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK