Subject: bug#7668: ispell and dictionary encodings

From: Agustin Martin <[email-masked]>
Date: Tue, 21 Dec 2010 12:30:08 +0100

On Mon, Dec 20, 2010 at 03:40:18PM +0000, Reuben Thomas wrote:
> On 20 December 2010 11:31, Agustin Martin <[email-masked]> wrote:
> 
> [a very helpful reply; thanks]
> 
> > On Fri, Dec 17, 2010 at 06:30:14PM +0000, Reuben Thomas wrote:
> > If you are not going to use XEmacs, but only FSF Emacs, just use [:alpha:]
> > for the case-character and non-case-character strings along with utf-8. That
> > is already done automatically for aspell dictionaries, where is easy to get
> > a list of installed dictionaries and additional info.
> 
> So, the built-in entries of ispell-dictionary-base-alist are
> specifically for ispell? 

Or generally for versions of the spellcheckers that do not properly support
different encodings, old aspells and hunspells, there are still some of them
flying around.

> In that case, it seems a bit odd that they
> are used for hunspell, but perhaps the problem is that you can't get
> hunspell to give you that information about its dictionaries? 

That is indeed part of the problem. Otherwise something like
(ispell-aspell-find-dictionaries) and friends could be used. 'hunspell -D'
does not provide all the info, and does not return control until ^C. 

> But is
> there in any case a reason not to default to using [:alpha:] for
> case-chars and ^[:alpha:] for non-case-chars with hunspell?

Besides old aspells and hunspells, I am trying to improve XEmacs
compatibility for ispell.el and flyspell.el. I keep patched versions for
Debian, so all Emacs flavours use the same ispell.el and flyspell.el. In its
current incarnation, even Emacs >=21.3 is supported by Debian patched files. 
I am currently removing all that compatibility leaving only Emacs23 and 
XEmacs, and would like to keep FSF Emacs ispell.el and flyspell.el 
reasonably close to those I use, so I need less changes. And XEmacs do not 
support [:alpha:]. 

An intermediate possibility could be to use a hunspell specific default 
dictionary list built on the fly from base-alist with encoding set to utf8
and case/not-case changed to [:alpha:] for FSF Emacs and recent enough
hunspell. Since this would only be done first time ispell.el invokes
hunspell spellchecking, seems be reasonable. But I have to think about this.

> In case I'm getting too confused, I'll just restate the basic
> objective I have: I want to be able to spell-check (in my case,
> British, but I don't think it matters for this purpose) English with
> a) accents and b) fancy quotes. In these days of utf-8 being widely
> used for English, it seems it should be possible to do at least b) out
> of the box, which currently it isn't, as far as I can see.

Putting those fancy quotes in 'otherchars' section in dictionary definition 
for ispell.el should make ispell.el consider them part of the word, but 
IIRC will not affect hunspell unless they are defined in TRY section of 
.aff file.

-- 
Agustin