emacs-devel
[Top][All Lists]
Advanced

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

Re: flyspell bug


From: Slawomir Nowaczyk
Subject: Re: flyspell bug
Date: Mon, 07 Nov 2005 16:51:22 +0100

OK, I finally had some time (not enough, though) to debug the problem,
and here is what I have found.

First of all, there is problem with flyspell-buffer not taking into
account the LocalWords: definition (the list of words assumed to be
correct in particular buffer). Words from this list are reported in
flyspell-external-ispell-buffer by ispell, but are not considered to
be misspelled by flyspell-word. This causes the logic in
flyspell-external-point-words to get out of sync with the buffer
contents.

I do not know how to fix this, though. There is
ispell-buffer-local-words in ispell.el, but I do not know enough about
ispell to understand what it is doing, or even if this is a right
place to start.

As an ugly kludge, the following patch does seem to fix things for me:

*** M:\EmacsCVS\EmacsCVS\lisp\textmodes\flyspell.el     Mon Nov  7 15:00:13 2005
--- c:\Emacs\lisp\textmodes\flyspell.el Mon Nov  7 16:39:45 2005
***************
*** 1365,1371 ****
                          (if (< (length (car (flyspell-get-word nil)))
                                 (length word))
                              nil
!                           (flyspell-word))))
                (error "Bug: misspelled word `%s' (output pos %d) not found in 
buffer"
                       word wordpos)))))))
      ;; we are done
--- 1365,1374 ----
                          (if (< (length (car (flyspell-get-word nil)))
                                 (length word))
                              nil
!                             (if (= (length (car (flyspell-get-word nil)))
!                                    (length word))
!                                 (and (flyspell-word) nil)  ;; flyspell-word 
but exit the loop unconditionally
!                               (flyspell-word)))))
                (error "Bug: misspelled word `%s' (output pos %d) not found in 
buffer"
                       word wordpos)))))))
      ;; we are done
***************

But I would prefer to have LocalWords taken care of by ispell -- if
only due to the fact that it should make flyspell-buffer significantly
faster.

Besides that, I believe the logic in flyspell-external-point-words
should be simplified significantly -- we should get rid of the "while
keep" loop, just find the first place where
                          (if (= (length (flyspell-get-word nil))
                                 (length word))
and flyspell-word that. And consider cases where ispell and flyspell
have different ideas about word boundaries to be bugs and fix those.

-- 
 Best wishes,
   Slawomir Nowaczyk
     ( address@hidden )

A computer DOES save time at work. I can play solitaire without
having to spend all that time shuffling real cards.





reply via email to

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