I have a Emacs extension that creates a buffer named *erl-output*
. This buffer gets created with only fundamental-mode
by default. Is there any way to automatically enable compilation-minor-mode
on that buffer?
相关问题
- Symbol's function definition is void: declare-
- How can I set the SVN password with Emacs 23.1 bui
- Emacs shell: save commit message
- emacs bind key to the insertion of another
- Emacs - set mark on edit location
相关文章
- ess-rdired: I get this error “no ESS process is as
- Emacs/xterm color annoyance on Linux
- Pipe less to Emacs
- Capturing the output of “diff” with org-babel
- emacs terminal mode: how to copy and paste efficie
- How to permanently enable the hs-minor-mode in ema
- Pipe emacs shell output to a new buffer
- Following a link into a git-repo without lengthy d
Since your extension is creating the buffer, why not just add:
(or
(compilation-minor-mode)
if you're really set on the minor mode idea) in the code that's creating the*erl-output*
buffer. You can edit the source for the mode, or use advice around the creation routine...To automatically change major modes you can add the following to your .emacs file:
This won't work for you; it's for major mode selection and you're after minor mode selection.
Instead you could try a Hook. The manual says:
So you should be able to write a function which sets the minor mode when required. Looking at the List of Standard Hooks I think you should be trying
temp-buffer-setup-hook
ortemp-buffer-show-hook
.You'll have to write a function which checks the buffer name and sets the mode if required, and add it to the hook using something like the following in your
.emacs
: