开发者

Emacs - how do I automatically enter minor modes when I enter a major mode?

I'm kind of a newb when it comes to emacs. I know about the .emacs file but have very little idea as to do anything more advanced than elementary stuff.

开发者_运维技巧

Whenever I enter latex-mode, I'd also like to automatically turn on flyspell-mode, reftex-mode, auto-fill-mode, and also set fill-column to 120. How do I edit my .emacs file to do this?

Thanks!


(add-hook 'latex-mode-hook
    (function (lambda ()
       (flymake-mode)
       (reftex-mode)
       (auto-fill-mode)
       (setq fill-column 120))))

for example should work.


You can set a so-called hook to a major mode. Have a look at this page of the manual for some examples.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜