繁体   English   中英

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

[英]Emacs, how to auto turn on flyspell for LaTeX file

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

将这些函数添加到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)

这样的事情应该有效。

(setq auto-mode-alist (cons '("\\.tex\\'" . flyspell-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.py\\'" . flyspell-prog-mode) auto-mode-alist))

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM