emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: Flyspell-mode breaks CUA mode


From: Magnus Henoch
Subject: Re: Flyspell-mode breaks CUA mode
Date: Fri, 30 Sep 2005 23:22:31 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (berkeley-unix)

"Richard M. Stallman" <address@hidden> writes:

>     The problem is that flyspell's post-command-hook runs flyspell-word which
>     runs flyspell-accept-buffer-local-defs which runs
>     ispell-accept-buffer-local-defs and which now also runs
>     ispell-maybe-find-aspell-dictionaries which itself will run
>     ispell-check-version (a non-trivial function) unless you're lucky enough
>     that ispell-have-aspell-dictionaries is non-nil.
>
>     I think running ispell-check-version (which does various things including
>     running a subprocess) from a post-command-hook is the core of the problem.
>
> The natural thing is to do ispell-maybe-find-aspell-dictionaries when
> flyspell mode is enabled, and not in flyspell-word.
>
> What problem was Magnus' change intended to solve?  We should look
> for a different solution.

If ispell-find-aspell-dictionaries has not been called (before my
change, this was the case whenever ispell-change-dictionary had not
been called), and the selected dictionary used non-ASCII characters,
and the current locale does not use the coding system specified in
ispell-dictionary-alist, there would be an encoding mismatch between
ispell.el and aspell.

So it struck me that you can change dictionaries in other ways than
M-x ispell-change-dictionary (e.g. a file-local setting of
ispell-local-dictionary), so I tried to catch all possible cases, by
putting the check at the lowest level possible.  Apparently I was too
"clever"...

Moving the call to ispell-maybe-find-aspell-dictionaries is probably
the simplest fix.  Another way is to do some rewriting - for aspell
0.60 it's not necessary to think about encodings at all; those things
could be conditionalized away.  I'm not sure whether it's worth it to
do great changes to code that mostly works, though.

I won't have time to look closer at this and fix it until some time
next week... feel free to do something before then.

Magnus





reply via email to

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