我只将Emacs用于\LaTeX和python编程。有没有办法在我处理.tex文件时自动打开flyspell-mode,并在我处理.py文件时打开flyspell-prog-mode?如何在.emacs文件中执行此操作?
发布于 2013-03-02 19:08:52
将这些函数添加到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)发布于 2013-03-02 18:35:17
像这样的东西应该行得通。
(setq auto-mode-alist (cons '("\\.tex\\'" . flyspell-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.py\\'" . flyspell-prog-mode) auto-mode-alist))https://stackoverflow.com/questions/15173004
复制相似问题