Emacs。拼写检查“;“飞行中”;适用于两种语言

Emacs。拼写检查“;“飞行中”;适用于两种语言,emacs,Emacs,Windows 7、Emacs 25.1 我需要对我的自定义文本进行拼写检查(例如,强调不正确的单词)。但是我用两种语言写文章:英语和俄语。我想在两种语言的拼写检查之间轻松切换 这方面最好的emacs包是什么?谢谢。您想要这个: 或者,如果您只想在它们之间循环: (defvar mu-languages-ring nil "Languages ring for Ispell") (let ((languages '("en_GB" "it_IT"))) (validate-setq mu-

Windows 7、Emacs 25.1

我需要对我的自定义文本进行拼写检查(例如,强调不正确的单词)。但是我用两种语言写文章:英语和俄语。我想在两种语言的拼写检查之间轻松切换

这方面最好的emacs包是什么?谢谢。

您想要这个:

或者,如果您只想在它们之间循环:

(defvar mu-languages-ring nil "Languages ring for Ispell")

(let ((languages '("en_GB" "it_IT")))
  (validate-setq mu-languages-ring (make-ring (length languages)))
  (dolist (elem languages) (ring-insert mu-languages-ring elem)))

(defun mu-cycle-ispell-languages ()
  (interactive)
  (let ((language (ring-ref mu-languages-ring -1)))
    (ring-insert mu-languages-ring language)
    (ispell-change-dictionary language)))

这些应该可以与

一起使用。我有一个类似的问题,我发现的解决方案可以同时管理两种或更多语言,而不使用guess_语言包。此解决方案基于拼写检查

系统: Windows 7 SP1,GNU Emacs 26.1

首先,在Hunspell安装后执行Ispell/Hunspell配置。在.emacs文件中插入下一个代码,该文件通常位于C:/Users/Account中

;; START BLOCK1 <-- Ispell/Hunspell setting
;;                          e.g., "C:/Hunspell/bin/hunspell.exe"
(setq-default ispell-program-name "hunspell.exe FULL PATH")
(setq-default ispell-extra-args  '("--sug-mode=ultra"))
;; Set "DICTDIR" variable, e.g., "C:/Hunspell/share/hunspell"
(setenv "DICTDIR" "hunspell DICTIONARY PATH")
;; Uncomment next line to set English or another dictionary
;; (setq ispell-dictionary "en_US")

;; Automatically enable flyspell-mode in text-mode
(setq text-mode-hook '(lambda() (flyspell-mode t) ))

(require 'ispell)
;; END BLOCK1 <-- Ispell/Hunspell setting
在拼写错误的单词上单击鼠标中键时,将显示上下文菜单,其中一个选项是“保存单词”条目。这些单词将使用变量ispell personal dictionary保存在名为.hunspell_personal的新文件中,该文件位于常规路径上


两个代码块的加入给出了预期的结果。仅包括第二块代码就抛出了错误“错误类型参数stringp nil”。

另请参见。
guess language
config示例已证明非常有用,谢谢:-)Fedora的
aspell it
包用户(可能还有其他用户)注意:起初我遇到了一个错误,为了使其正常工作,我必须使用
“it”
而不是
猜测语言语言语言代码中“it\u it”
;; START BLOCK1 <-- Ispell/Hunspell setting
;;                          e.g., "C:/Hunspell/bin/hunspell.exe"
(setq-default ispell-program-name "hunspell.exe FULL PATH")
(setq-default ispell-extra-args  '("--sug-mode=ultra"))
;; Set "DICTDIR" variable, e.g., "C:/Hunspell/share/hunspell"
(setenv "DICTDIR" "hunspell DICTIONARY PATH")
;; Uncomment next line to set English or another dictionary
;; (setq ispell-dictionary "en_US")

;; Automatically enable flyspell-mode in text-mode
(setq text-mode-hook '(lambda() (flyspell-mode t) ))

(require 'ispell)
;; END BLOCK1 <-- Ispell/Hunspell setting
;;START BLOCK2<-- Multiple dictionaries. Only works with BLOCK1
(with-eval-after-load "ispell"
  ;; Configure `LANG`, otherwise ispell.el cannot find a 'default
  ;; dictionary' even though multiple dictionaries will be configured
  ;; in next line.
  (setenv "LANG" "es_ES")
  ;; English/spanish configuration.
  (setq ispell-dictionary "en_US,es_ES")
  ;; ispell-set-spellchecker-params has to be called
  ;; before ispell-hunspell-add-multi-dic will work
  (ispell-set-spellchecker-params)
  (ispell-hunspell-add-multi-dic "en_US,es_ES")
  ;; For saving words to the personal dictionary, don't infer it from
  ;; the locale, otherwise it would save to ~/.hunspell_de_DE.
  (setq ispell-personal-dictionary "~/.hunspell_personal"))
;; The personal dictionary file has to exist, otherwise hunspell will
;; silently not use it.
(unless (file-exists-p ispell-personal-dictionary)
  (write-region "" nil ispell-personal-dictionary nil 0))
;;END BLOCK2<-- Multiple dictionaries. Only works with BLOCK1
# -\*- ispell-dictionary: "castellano8" -\*-.