[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Flyspell-mode breaks CUA mode
From: |
Stefan Monnier |
Subject: |
Re: Flyspell-mode breaks CUA mode |
Date: |
Thu, 29 Sep 2005 16:22:37 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
>> After starting Emacs with -Q I start flyspell-mode in the
>> *scratch* buffer. I then paste some text into the buffer and
>> turn CUA mode on from the [options] menu. If I try to select
>> text using shifted arrow keys the selection is erratic. That is,
>> sometimes text will be selected and sometimes not. Often text
>> that is selected becomes suddenly unselected between keystrokes.
> Others have reported problems with flyspell and transient-mark-mode,
> and since CUA uses transient-mark-mode, I suppose this bug follows
> from those problems (unless somebody can prove me wrong :-).
> FTR, I'm _not_ looking into the flyspell pb.
I think the culprit is the following:
2005-09-24 Magnus Henoch <address@hidden>
* textmodes/ispell.el (ispell-maybe-find-aspell-dictionaries):
New function, code extracted from ispell-valid-dictionary-list.
(ispell-valid-dictionary-list, ispell-accept-buffer-local-defs):
Call it.
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.
At least, on my system once I uncomment in ispell-accept-buffer-local-defs
the call to ispell-maybe-find-aspell-dictionaries, things work fine again,
whereas otherwise my transient-mark-mode simply doesn't work (because
flyspell's post-command-hook ends up setting deactivate-mark to t).
Stefan