help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ispell.el and multilanguage lines.


From: Eli Zaretskii
Subject: Re: ispell.el and multilanguage lines.
Date: Wed, 16 Dec 2015 05:37:20 +0200

> From: Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>
> Date: Wed, 16 Dec 2015 02:14:58 +0300
> 
> Here's the problem I've found with ispell.el. As a bilingual person and 
> an avid org-mode user I often have lines in multiple languages. The fact 
> that Russian language has a different alphabet is great for the purpose 
> of spell checking, since I can check English first, then switch 
> dictionary and check Russian. And spell checker is supposed to ignore 
> words not in the dictionary alphabet. ispell-dictionary-alist has all 
> the facilities needed for this and it should work in theory.
> Here's where it fails in practice - ispell.el uses a function called 
> ispell-region and what it does is that it sends buffer line by line and 
> whether the line gets sent is decided by ispell-get-line where the 
> criteria is (re-search-forward ispell-casechars end t) - that is if 
> there's a match with the language for the current dictionary the whole 
> line gets sent. And of course words in that line that are in a different 
> language get considered misspelled by the spell checker.

Emacs doesn't yet have a concept of the language of the text,
certainly not when several languages are mixed in a buffer.

> There's a possible workaround if you're using hunspell, by using 
> multiple dictionaries at the same time, like this:
> ("ru_RU,en_US" "[[:alpha:]]" "[^[:alpha:]]" "['0-9]" t ("-d" 
> "ru_RU,en_US") nil koi8-r)

Yes, and the latest code base (of what will become Emacs 25.1)
supports this feature of Hunspell.

> But this creates a mess in user dictionaries.

I believe that "mess" is fixed in the current code.  So I suggest you
try the latest emacs-25 branch.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]