From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Agustin Martin Newsgroups: gmane.emacs.bugs Subject: bug#16800: 24.3; flyspell works slow on very short words at the end of big file Date: Fri, 21 Feb 2014 15:38:55 +0100 Message-ID: <20140221143855.GA6018@agmartin.aq.upm.es> References: <85zjlo5ecy.fsf@gmail.com> <83ob204vrv.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1392993641 21618 80.91.229.3 (21 Feb 2014 14:40:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Feb 2014 14:40:41 +0000 (UTC) Cc: 16800@debbugs.gnu.org To: Aleksey Cherepanov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 21 15:40:46 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1WGrHP-0002QB-GK for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Feb 2014 15:40:43 +0100 Original-Received: from localhost ([::1]:45000 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGrHO-0007tk-U1 for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Feb 2014 09:40:42 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGrGs-00073W-Uo for bug-gnu-emacs@gnu.org; Fri, 21 Feb 2014 09:40:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGrGl-00049z-Ki for bug-gnu-emacs@gnu.org; Fri, 21 Feb 2014 09:40:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33278) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGrGl-00049g-I8 for bug-gnu-emacs@gnu.org; Fri, 21 Feb 2014 09:40:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WGrGk-0005Ut-OW for bug-gnu-emacs@gnu.org; Fri, 21 Feb 2014 09:40:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Agustin Martin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Feb 2014 14:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16800 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16800-submit@debbugs.gnu.org id=B16800.139299355021044 (code B ref 16800); Fri, 21 Feb 2014 14:40:02 +0000 Original-Received: (at 16800) by debbugs.gnu.org; 21 Feb 2014 14:39:10 +0000 Original-Received: from localhost ([127.0.0.1]:34459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WGrFt-0005TK-CI for submit@debbugs.gnu.org; Fri, 21 Feb 2014 09:39:10 -0500 Original-Received: from edison.ccupm.upm.es ([138.100.198.71]:54198) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WGrFm-0005St-Lv for 16800@debbugs.gnu.org; Fri, 21 Feb 2014 09:39:03 -0500 Original-Received: from agmartin.aq.upm.es (Agmartin.aq.upm.es [138.100.41.131]) by smtp.upm.es (8.14.3/8.14.3/edison-001) with ESMTP id s1LEcu68012033; Fri, 21 Feb 2014 15:38:56 +0100 Original-Received: by agmartin.aq.upm.es (Postfix, from userid 1000) id ECB3D3FFCB; Fri, 21 Feb 2014 15:38:55 +0100 (CET) Content-Disposition: inline In-Reply-To: <83ob204vrv.fsf@gnu.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:85978 Archived-At: On Fri, Feb 21, 2014 at 12:15:00PM +0200, Eli Zaretskii wrote: > > From: Aleksey Cherepanov > > Date: Wed, 19 Feb 2014 00:56:45 +0400 > > > > I faced a problem editing my big .org file (2mb+) with flyspell-mode > > enabled. I edit it every day, regularly mistype and get words of one > > or two letters that are wrong in Russian and cause flyspell work slow. > > > > This one-liner produces "good" file to reproduce the bug. > > perl -e 'print(((join " ", ("met and") x 10) . "\n") x 30000)' > t.txt > > > > Typing "nd" at the end of file gives a huge pause even on a fast > > computer. But "mw" or "md" does not give pauses because they are not > > substrings in this file. It is repeatable with emacs -Q. > > This seems to be due to the Flyspell's feature of recognizing > duplicates of mis-spelled words, and, if found, highlighting such > duplicates in a different face. If you customize the variable > flyspell-duplicate-distance to some small value (or even zero), the > delay goes away. Evidently, with the default value of -1, Flyspell > searches all the way to the beginning of the giant buffer, looking for > a duplicate of "nd". > > Interestingly, I don't see this when the speller is Ispell, but I do > see it with Hunspell. Not sure how using Ispell avoids this problem. Hi, On the other hand, I can reproduce this also with ispell, as well as with aspell and hunspell. On Wed, Feb 19, 2014 at 12:56:45AM +0400, Aleksey Cherepanov wrote: > flyspell-duplicate-distance variable on its own could mitigate the > problem but it changes the behaviour so I do not want to use this > variable. For the records, I was playing with a customized value of 50000 for that distance and even if there is still a minor delay it is reasonable. I am in a fast box, do not know in other boxes. > I tried to patch flyspell-word-search-backward and > flyspell-word-search-forward functions from flyspell.el replacing > search-backward with word-search-backward and search-forward with > word-search-forward (perl -pe 's/\(search-/(word-search-/' ). It > solved the problem but I do not know what it broke. > > I expect problems with this solution because I do not know if > flyspell's meaning of word is the same as emacs' one. I think it is > described in flyspell-get-word function that is called after search-* > in the patched functions. I have never played with Emacs syntax tables, but I'd expect differences only if there is a mismatch between chars in OTHERCHARS and non alphabetic chars that Emacs considers as possible parts of a word. Regards, -- Agustin