emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCHv2] textmodes/flyspell.el: Don't check pre-word if buffer was


From: Agustin Martin
Subject: Re: [PATCHv2] textmodes/flyspell.el: Don't check pre-word if buffer was switched.
Date: Sat, 20 Apr 2013 06:53:43 +0200

2013/3/27 Michal Nazarewicz <address@hidden>
If command changed the buffer, the decision may be made based on the
current buffer even though it should based on the previous one.  This
may lead to false positives and more importantly to errors since
`flyspell-pre-point' is buffer local so it may have unsanitised value
(such as nil) in previous buffer.

To be honest, I'm not sure how this can happen since
`flyspell-pre-point' is set in previous buffer, but nonetheless, I've
been encountering the error for quite some time and finally decided to
fix it.  Interestingly, line making `flyspell-pre-point'
a buffer-local variable has a very revealing "Why?? --Stef" comment.

To avoid the problem, change flyspell-check-pre-word-p so that it does
not allow checking of pre-word if command changed buffer
(ie. `flyspell-pre-buffer' is not current buffer).
---
 On Wed, Mar 27 2013, Stefan Monnier <address@hidden> wrote:
 > Can't we just say that if current-buffer is different from the previous
 > one, then don't do anything?

 Sure.  I don't mind either way.

Hi, Michal

After doing some testing with flyspell-mode across buffer switches and your changes applied I finally committed your patch. Although I could not reproduce the original problem, patch did seem and behave harmless here. 

After that I tried harder to reproduce the problem with the original unchanged code without success, so I have my doubts about this change being really needed or the best one, `(numberp flyspell-pre-point)' test should already care of nil `flyspell-pre-point'.

I'd appreciate a minimal step-by-step guide to reproduce the original problem with the original code, if it can be systematically reproduced. If it appeared randomly, please provide as much info as you can.

Thanks a lot for your feedback,

--
Agustin

reply via email to

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