Emacs,如何为LaTeX文件自动打开flyspell

LWZ*_*LWZ 3 emacs aspell flyspell emacs24

我只将Emacs用于\ LaTeX和python编程.有没有办法flyspell-mode在我处理.tex文件时自动打开,并flyspell-prog-mode在我处理.py文件时打开?我怎么能在我的.emacs文件中这样做?

syo*_*hex 11

将这些函数添加到python-mode和latex-mode的钩子中

(require 'python)

;; If you use tex-mode
(require 'tex-mode)`
(add-hook 'latex-mode-hook 'flyspell-mode)

;; If you use AUCTeX
(load "auctex.el" nil t t)`
(add-hook 'LaTeX-mode-hook 'flyspell-mode)


(add-hook 'python-mode-hook 'flyspell-prog-mode)
Run Code Online (Sandbox Code Playgroud)