1

I have the following environment on my machine: Windows 7, emacs and aspell built with mingw. I am trying to use aspell for spell-checking in buffer.

After i change language to russian (i have russian language files, with names such as ru.multi, ru-ye.multi etc.), i get the following error when running ispell-buffer:

ispell-init-process: Error: The file ""c:/mingw_mine"/lib/aspell-0.60/"c:/mingw_mine"/lib/aspell-0.60/russian" can not be opened for reading

My only configuration for ispell is:

  • ispell command program name set to correct full path
  • ispell-extra-args set to have "--prefix=\"c:/mingw_mine\"" in it

Dictionaries are located under abovementioned prefix in "lib/aspell-0.60" subfolder. When invoked from command line with that prefix, aspell correctly finds and loads them (ex.: aspell --prefix="c:/mingw_mine" -d ru.multi check c:/text.txt).

How can i ensure aspell, invoked from emacs, can do that as well?

2 Answers 2

1

Adding following to my initialisation file solved my problem:

;; aspell setup
(setq
 ispell-russian-dictionary "russian"
 ispell-english-dictionary "english")

(custom-set-variables
  ;; i like aspell, and you?
 '(ispell-program-name "aspell")

; my dictionary-alist, using for redefinition russian dictionary
 '(ispell-dictionary-alist
   '(("russian"  ;; Russian
      "\\cy"
      "\\Cy" 
      "[-]"
      nil
      ("-C" "-d" "ru-yeyo.multi"
       nil utf-8))
     ("english"                       ; English
      "[a-zA-Z]"
      "[^a-zA-Z]"
      "[']"
      nil
      ("-d" "en_GB.multi" "--add-extra-dicts=en_GB-variant_1.multi"
       nil iso-8859-1))
     (nil ;; Default
      "[A-Za-z]"
      "[^A-Za-z]"
      "[']"
      nil
      ("-C"
       nil iso-8859-1))))
 '(flyspell-default-dictionary ispell-russian-dictionary)
 '(ispell-dictionary ispell-english-dictionary)
 '(ispell-local-dictionary ispell-russian-dictionary)
 '(ispell-extra-args '("--sug-mode=ultra" "--prefix=c:/mingw_mine")))

This is based on contents of this thread: http://www.linux.org.ru/forum/development/4457441.

0

change environment variable LC_ALL to ru_RU.UTF-8

If you use use Emacs inside msys shell, in your~/.bash_profiler, insert below line,

export LC_ALL=ru_RU.UTF-8

If you use windows native Emacs, insert below code into your ~/.emacs,

(setenv "LC_ALL" "ru_RU.UTF-8")

Either way, remove your --prefix settings in ispell-extra-args settings.

You could run aspell config to know where aspell to look up dictionaries and copy your dictionaries there.

2
  • After applying your solution, this is what i get in my Messages buffer: > Local Ispell dictionary set to russian > Starting new Ispell process c:\mingw_mine\bin\aspell.exe with russian dictionary... > ispell-init-process: Error: The file "/c/mingw_mine/lib/aspell-0.60/russian" can not be opened for reading. > WARNING: Unable to enter Nroff mode: Unknown mode: "nroff". No use at all
    – Srv19
    Sep 19, 2016 at 7:00
  • Make sure your dictionaries exist in that folder.
    – chen bin
    Sep 19, 2016 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.