Re: Flyspell-mode breaks CUA mode
I think this is too drastic. I don't see why. Does it cause any real problem? We should first and foremost avoid running "ispell -V" every time the post-command-hook is run. That would be an efficiency gain. Want to do it? ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: Flyspell-mode breaks CUA mode
> Why is it setting deactivate-mark? I thought that was only set by the > sort of interactive command that shouldn't be used in hooks etc., > which makes this problem sound more like a simple bug rather than a > design problem > Any change to the buffer sets deactivate-mark. So flyspell's > post-command-hook should bind deactivate-mark to prevent that. I think this is too drastic. We should first and foremost avoid running "ispell -V" every time the post-command-hook is run. And maybe we should let bind deactivate-mark around ispell-check-version. But maybe not around the whole flyspell-post-command-hook. Stefan > Does this fix it? > *** flyspell.el 01 Nov 2005 20:34:12 -0500 1.83 > --- flyspell.el 03 Nov 2005 11:46:05 -0500 > *** > *** 895,901 > (defun flyspell-post-command-hook () > "The `post-command-hook' used by flyspell to check a word in-the-fly." > (interactive) > ! (let ((command this-command)) > (if (flyspell-check-pre-word-p) > (save-excursion > '(flyspell-debug-signal-pre-word-checked) > --- 895,903 > (defun flyspell-post-command-hook () > "The `post-command-hook' used by flyspell to check a word in-the-fly." > (interactive) > ! (let ((command this-command) > ! ;; Prevent anything we do from affecting the mark. > ! deactivate-mark) > (if (flyspell-check-pre-word-p) > (save-excursion > '(flyspell-debug-signal-pre-word-checked) ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: Flyspell-mode breaks CUA mode
Why is it setting deactivate-mark? I thought that was only set by the sort of interactive command that shouldn't be used in hooks etc., which makes this problem sound more like a simple bug rather than a design problem Any change to the buffer sets deactivate-mark. So flyspell's post-command-hook should bind deactivate-mark to prevent that. Does this fix it? *** flyspell.el 01 Nov 2005 20:34:12 -0500 1.83 --- flyspell.el 03 Nov 2005 11:46:05 -0500 *** *** 895,901 (defun flyspell-post-command-hook () "The `post-command-hook' used by flyspell to check a word in-the-fly." (interactive) ! (let ((command this-command)) (if (flyspell-check-pre-word-p) (save-excursion '(flyspell-debug-signal-pre-word-checked) --- 895,903 (defun flyspell-post-command-hook () "The `post-command-hook' used by flyspell to check a word in-the-fly." (interactive) ! (let ((command this-command) ! ;; Prevent anything we do from affecting the mark. ! deactivate-mark) (if (flyspell-check-pre-word-p) (save-excursion '(flyspell-debug-signal-pre-word-checked) ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: Flyspell-mode breaks CUA mode
>> 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. > >> (because >> flyspell's post-command-hook ends up setting deactivate-mark to t). > Why is it setting deactivate-mark? Because: 1 - any buffer modification sets deactivate-mark 2 - ispell-check-version puts the output of `ispell -V' in a buffer 3 - as mentioned flyspell's post-command-hook ended up calling ispell-check-version Stefan ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: Flyspell-mode breaks CUA mode
2005/9/30, Stefan Monnier <[EMAIL PROTECTED]>: > 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. > (because > flyspell's post-command-hook ends up setting deactivate-mark to t). Why is it setting deactivate-mark? I thought that was only set by the sort of interactive command that shouldn't be used in hooks etc., which makes this problem sound more like a simple bug rather than a design problem -miles -- Do not taunt Happy Fun Ball. ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: Flyspell-mode breaks CUA mode
Magnus Henoch <[EMAIL PROTECTED]> writes: > 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. Has this problem been fixed? -- Kim F. Storm <[EMAIL PROTECTED]> http://www.cua.dk ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: Flyspell-mode breaks CUA mode
"Richard M. Stallman" <[EMAIL PROTECTED]> 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 ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: Flyspell-mode breaks CUA mode
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. ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: Flyspell-mode breaks CUA mode
>> 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 <[EMAIL PROTECTED]> * 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 ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: Flyspell-mode breaks CUA mode
"LaserDoodads Info" <[EMAIL PROTECTED]> writes: > 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. -- Kim F. Storm <[EMAIL PROTECTED]> http://www.cua.dk ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Flyspell-mode breaks CUA mode
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. In GNU Emacs 22.0.50.1 (i386-msvc-nt5.1.2600) of 2005-09-26 on LD1 X server distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-msvc (12.00)' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: ENU locale-coding-system: cp1252 default-enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: cua-mode: t flyspell-mode: t tool-bar-mode: t encoded-kbd-mode: t mouse-wheel-mode: t tooltip-mode: t auto-compression-mode: t menu-bar-mode: t blink-cursor-mode: t unify-8859-on-encoding-mode: t utf-translate-cjk-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-x f l y s p e l l SPC m o d e C-v C-v C-v f ug> Recent messages: Loading encoded-kb...done Loading tool-bar...done Loading image...done For information about the GNU Project and its goals, type C-h C-p. Loading flyspell...done Starting new Ispell process... call-interactively: End of buffer [2 times] Loading cua-base...done Mark set Loading emacsbug...done ___ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug