michael.cadilhac@lrde.org (Michaėl Cadilhac) writes: > Hi ! > > I use the latest CVS version. > > With the following : > > $ emacs -Q > > C-u M-x ispell-change-dictionary RET francais RET > C-x b test1 RET > M-x ispell-change-dictionary RET english RET > M-x ispell-buffer > C-x b test2 RET > M-x ispell-change-dictionary RET english RET > > The « english » dictionary will be loaded twice: on the > « ispell-buffer » and on the latest « ispell-change-dictionary ». > > The rest of this message is IMHO :-) > > What happens is the following on the second ispell-change-dictionary: > > - ispell-buffer-local-dict is called, > - this one calls ispell-internal-change-dictionary, > - ispell-local-dictionary being nil, and current dictionary > (« english ») not being equal to default one (« francais »), the > ispell process is killed. > > So it has to be restarted. > > The call to ispell-buffer-local-dict is mandatory > (ispell-change-dictionary could be called with "" just to load > default buffer's one), but it should not call > ispell-internal-change-dictionary at this time. > > The proposed patch : > - Delays this call, > - Makes ispell-internal-change-dictionary checks for pdict, > - Fixes the bug. Well, this bug is still triggered in some cases, but before I investigate, I was wondering why ispell-kill-process took so much time to execute. This function does the following: - Send EOF to ispell, - Read its output if there is, timeout to 1 sec, - Kill the process if it's still not, - Wait for it to be really killed (sleeping for 0.25 sec between checks). I don't want to be ... rude, I'm really a pacifist actually, but why not just delete-process it ? I often have some flyspellized buffers in English and some others in French, the time I have to wait on every C-x o is kind of disturbing... I propose the following change: