From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Agustin Martin Newsgroups: gmane.emacs.devel Subject: Re: [PATCHv2] textmodes/flyspell.el: Don't check pre-word if buffer was switched. Date: Sat, 20 Apr 2013 06:53:43 +0200 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=14dae94ee02fc4b9f304dac39e89 X-Trace: ger.gmane.org 1366433632 31353 80.91.229.3 (20 Apr 2013 04:53:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Apr 2013 04:53:52 +0000 (UTC) Cc: emacs-devel@gnu.org To: Michal Nazarewicz Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 20 06:53:53 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UTPo7-0003Lz-Ot for ged-emacs-devel@m.gmane.org; Sat, 20 Apr 2013 06:53:51 +0200 Original-Received: from localhost ([::1]:53787 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UTPo7-0003Aa-Fl for ged-emacs-devel@m.gmane.org; Sat, 20 Apr 2013 00:53:51 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UTPo3-0003AD-E8 for emacs-devel@gnu.org; Sat, 20 Apr 2013 00:53:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UTPo2-0002Fr-55 for emacs-devel@gnu.org; Sat, 20 Apr 2013 00:53:47 -0400 Original-Received: from mail-lb0-f177.google.com ([209.85.217.177]:61166) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UTPo1-0002Fj-P9 for emacs-devel@gnu.org; Sat, 20 Apr 2013 00:53:46 -0400 Original-Received: by mail-lb0-f177.google.com with SMTP id r10so4238619lbi.22 for ; Fri, 19 Apr 2013 21:53:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=LEiOtdrgPZM5NYqDNGBD9oUKmmZA9ojYxGGha98iDFg=; b=RngBrq99XabTaKagr7ShW/ZaENVxUNNK0p2XQvmFhwggDo9X4g07wOS35RQcEwhD6g t/OsJWkUoIiCKe6p1FwO7NIcxzIDXj4R0lUCyQDv5Lwvme+N+7kh5xbju6YJUuE1NIuI Nf6KFyGvKx2SFmjT1Ri2JPidcWFDwbmkbhS2X8AyIufnNjLSTQAdfYAjp+nnIMdHSQBY s7A3wN5x/xS3eaz/+heM61lvsc+4Ti+IWjKL7xteeSkhC07J+U4dhoBW+AwcOHJkpfxd GCI9QMcD/sezSSgItJdt2PQk1cSkRGVj8s95IrwQnb877HUmCctrzb3SQXGDgmDs57x6 +hpQ== X-Received: by 10.112.5.234 with SMTP id v10mr9407782lbv.18.1366433624011; Fri, 19 Apr 2013 21:53:44 -0700 (PDT) Original-Received: by 10.112.73.172 with HTTP; Fri, 19 Apr 2013 21:53:43 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: hW6jeIWhYItDL-6kXywb2mU5lD4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.217.177 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:159027 Archived-At: --14dae94ee02fc4b9f304dac39e89 Content-Type: text/plain; charset=ISO-8859-1 2013/3/27 Michal Nazarewicz > 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 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 --14dae94ee02fc4b9f304dac39e89 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
2013= /3/27 Michal Nazarewicz <mina86@mina86.com>
If command changed the buffer, the decision may be made based on the
current buffer even though it should based on the previous one. =A0This
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. =A0Interestingly, line making `flyspell-pre-point'
a buffer-local variable has a very revealing "Why?? --Stef" comme= nt.

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).
---
=A0On Wed, Mar 27 2013, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
=A0> Can't we just say that if current-buffer is different from the = previous
=A0> one, then don't do anything?

=A0Sure. =A0I don't mind either way.

Hi, Michal

After doing some testing with flyspell-mode across buffer switches and you= r changes applied I finally committed your patch. Although I could not repr= oduce the original problem, patch did seem and behave harmless here.=A0
After that I tried harder to reproduce the problem with the original un= changed code without success, so I have my doubts about this change being r= eally needed or the best one, `(numberp flyspell-pre-point)' test shoul= d already care of nil `flyspell-pre-point'.

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

Thanks a lot for your feedback,

--
A= gustin
--14dae94ee02fc4b9f304dac39e89--