How to define two ispell dictionaries in Emacs for LaTeX mode?

蓝咒 提交于 2019-12-05 18:09:14
Adobe

I have a way to toggle between two languages:

;; You should have aspell-ru and aspell-en packages installed
(let ((langs '("english" "russian")))
  (setq lang-ring (make-ring (length langs)))
  (dolist (elem langs) (ring-insert lang-ring elem)))
(defun cycle-ispell-languages ()
  (interactive)
  (let ((lang (ring-ref lang-ring -1)))
    (ring-insert lang-ring lang)
    (ispell-change-dictionary lang)))

(global-set-key (kbd "C-1") 'cycle-ispell-languages)

Marcos, I found this:

http://www.emacswiki.org/emacs/AutoLangMode

http://www.emacswiki.org/emacs/GuessLang

I guess that first one do what you need.

Tobias

Please, try swL-mode from http://www.emacswiki.org/emacs/TN/#toc13 . It works with flyspell. The dictionary for the text at the current point position is chosen. You should adapt swL-alist to your needs. The language identifier strings (such as \selectlanguage{...}) must start at the beginning of line.

Meanwhile I also discovered flyspell-babel.el on the following page:

https://tex.stackexchange.com/questions/40988/how-can-i-make-auctex-spell-check-in-the-language-specified-by-babel-and-csquote

I think it is more user-friendly (packaged). It does not use just-in-time formatting (jit-lock-mode) and text properties therefore there might be some performance problems. But maybe, it is no problem and I was just too precautious.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!