I'm using Aspell as a spelling checker for Emacs.
I know that, as a standalone, aspell can handle multpiple dictionaries (using extra-dicts
param), but how to configure it under Emacs?
I know very little of emacs lisp... Could I provide some "ispell extra-args" in .emacs file? Would that work? If so I'd really appreciate simple example - I know very little of lisp syntax and absolute/relative paths it handles and etc.
The reason why I need this is that I sometimes write some documentation in Polish with English words in it. That makes spell-check-region
much less attractive task than it is using single language in a file.
Thanks in advance!
I'm assuming that aspell is set as your ispell-program-name
(you can do this in customize).
( Add these to your .emacs
or .emacs.d/init.el
)
You can add multiple dictionaries to the ispell-dictionary-alist
(syntax is a bit complex, get more info in Emacs help with: C-h v ispell-dictionary-alist
)
Example.
'(ispell-dictionary-alist (quote (
("english" "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1)
("polish" "[A-Za-z¡£¦¬¯±³¶¼¿ÆÊÑÓæêñó]" "[^A-Za-z¡£¦¬¯±³¶¼¿ÆÊÑÓæêñó]" "" nil ("-d" "polish") nil iso-8859-2)
))
)
You could also bind dictionary swapping to the keyboard.
e.g.
(global-set-key (kbd "M-8")
(lambda ()
(interactive)
(ispell-change-dictionary "american" nil))) ; "british" and "english" are also valid.