emacs-devel
[Top][All Lists]
Advanced

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

Small bug in flyspell.el


From: Peter Heslin
Subject: Small bug in flyspell.el
Date: Tue, 24 Apr 2007 12:46:27 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (gnu/linux)

I believe there is a small bug in the function
flyspell-auto-correct-previous-word.  This function allows you to cycle
through suggested spellings of a previous word that flyspell has marked
as misspelled.  It is important that this action is restricted to the
visible part of the buffer -- otherwise the user might accidentally
change a word off-screen without realizing it.

So the function begins like this:

  (let (top bot)
    (save-excursion
      (move-to-window-line 0)
      (setq top (point))
      (move-to-window-line -1)
      (setq bot (point)))
    (save-excursion
      (save-restriction
        (narrow-to-region top bot)

This code intends to narrow to the visible part of the screen, but there
should be a (end-of-line) after (move-to-window-line -1).  As it stands,
the code narrows to the beginning of the last line on screen, and
excludes the last line itself.  The effect of this bug is that, if you
are typing on the last line of the screen and notice that flyspell has
highlighted a previous word on that line and you hit the key bound to
flyspell-auto-correct-previous-word, the expected word is not corrected.
Instead, if there is a word highlighted higher up on the screen, that
other word is wrongly "corrected" (since the user did not bother to
correct that word earlier, it is probably not in fact misspelled, but is
just a word that the dictionary doesn't know).

Peter

-- 
Peter Heslin (http://www.dur.ac.uk/p.j.heslin)





reply via email to

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