Emacs,如何为LaTeX文件自动打开flyspell [英] Emacs, how to auto turn on flyspell for LaTeX file

查看:181
本文介绍了Emacs,如何为LaTeX文件自动打开flyspell的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Emacs仅用于\LaTeX和python编程。当我在.tex文件上工作时,有没有办法自动打开 flyspell-mode ,然后打开 flyspell-prog-mode 当我在.py文件上工作?如何在我的.emacs文件中执行此操作?

解决方案

将这些函数添加到python-mode和latex-mode / p>

 (require'python)

;;如果你使用tex-mode
(require'tex-mode)`
(add-hook'latex-mode-hook'flyspell-mode)

;;如果您使用AUCTeX
(加载auctex.elnil tt)`
(add-hook'LaTeX-mode-hook'flyspell-mode)


(add-hook'python-mode-hook'flyspell-prog-mode)


I use Emacs only for \LaTeX and python programming. Is there a way to automatically turn on flyspell-mode when I work on a .tex file, and turn on flyspell-prog-mode when I work on a .py file? How can I do this in my .emacs file?

解决方案

Add those functions to hooks of python-mode and 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)

这篇关于Emacs,如何为LaTeX文件自动打开flyspell的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆