From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Aleksey Cherepanov Newsgroups: gmane.emacs.bugs Subject: bug#16800: 24.3; flyspell works slow on very short words at the end of big file Date: Sat, 22 Feb 2014 20:02:17 +0400 Message-ID: <20140222160217.GA15616@openwall.com> References: <85zjlo5ecy.fsf@gmail.com> <83ob204vrv.fsf@gnu.org> <20140221143855.GA6018@agmartin.aq.upm.es> <83k3co4hzd.fsf@gnu.org> <20140222124413.GA4971@openwall.com> <83vbw72t05.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1393084990 25784 80.91.229.3 (22 Feb 2014 16:03:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 22 Feb 2014 16:03:10 +0000 (UTC) Cc: 16800@debbugs.gnu.org, agustin.martin@hispalinux.es To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 22 17:03:18 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 1WHF2r-0006y2-Iv for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Feb 2014 17:03:17 +0100 Original-Received: from localhost ([::1]:49987 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WHF2r-0001Yr-6n for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Feb 2014 11:03:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WHF2i-0001Ph-NO for bug-gnu-emacs@gnu.org; Sat, 22 Feb 2014 11:03:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WHF2d-0007yQ-DC for bug-gnu-emacs@gnu.org; Sat, 22 Feb 2014 11:03:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34652) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WHF2d-0007yH-9W for bug-gnu-emacs@gnu.org; Sat, 22 Feb 2014 11:03:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WHF2b-0000XI-SZ for bug-gnu-emacs@gnu.org; Sat, 22 Feb 2014 11:03:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Aleksey Cherepanov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Feb 2014 16:03:01 +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.13930849512010 (code B ref 16800); Sat, 22 Feb 2014 16:03:01 +0000 Original-Received: (at 16800) by debbugs.gnu.org; 22 Feb 2014 16:02:31 +0000 Original-Received: from localhost ([127.0.0.1]:35834 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WHF25-0000WK-KI for submit@debbugs.gnu.org; Sat, 22 Feb 2014 11:02:30 -0500 Original-Received: from mail-la0-f48.google.com ([209.85.215.48]:51136) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WHF22-0000W6-Bd for 16800@debbugs.gnu.org; Sat, 22 Feb 2014 11:02:27 -0500 Original-Received: by mail-la0-f48.google.com with SMTP id gf5so580408lab.21 for <16800@debbugs.gnu.org>; Sat, 22 Feb 2014 08:02:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=rOGfM68JouqkI5GV9FbYWhwl15vm8alb+j8G/gWvgvQ=; b=Dvhya7npSDaEGSv/B36l+TXQnkYjm+GDgYMxg59wIn6AKciNkLXRb6N9zIAweley8Y dpnKk4keZoJH1hOLNrfP4qjc5D+EbsbGVhLRRYYw4LHKoueFGNHuUxGFkJwC5IMtCawf 9aVCfIe4k3/TXk3PoYla9up4FFtRdwrS8ZIgwuEtJZqz0n5anDCV/3A8ybTwOlH+ZMC0 V195qdf1iezIMW5WtA3kd0BTEq+snekOrt6gZf4IwYFRlVA8DRwKc7kSRTpmo2lBPSZl /PGBnIlt+MUtH6rlX2G0o7x8xdYSzGysg1DH3bdIpKMsKNvwMS6SNZDkcHMKY5k7Ekw3 yNIA== X-Received: by 10.112.39.167 with SMTP id q7mr6806808lbk.82.1393084940089; Sat, 22 Feb 2014 08:02:20 -0800 (PST) Original-Received: from openwall.com ([188.123.230.115]) by mx.google.com with ESMTPSA id y2sm16253477lal.10.2014.02.22.08.02.18 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 22 Feb 2014 08:02:19 -0800 (PST) Content-Disposition: inline In-Reply-To: <83vbw72t05.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:86024 Archived-At: On Sat, Feb 22, 2014 at 03:10:02PM +0200, Eli Zaretskii wrote: > > Date: Sat, 22 Feb 2014 16:44:13 +0400 > > From: Aleksey Cherepanov > > Cc: Agustin Martin , 16800@debbugs.gnu.org > > > > Also GNU coding standards say to avoid arbitrary limits (parts 2.1 > > and 4.2). > > http://www.gnu.org/prep/standards/standards.html > > This limit is not arbitrary. Anyway it is a limit that could be avoided. > > > > > 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. > > > > > > And this doesn't change behavior? See below. > > > > No, it seems that my setup works the same. See below. > > Your setup _might_ work the same, especially if you don't mix > different languages in the same buffer. But in general, your change > does affect behavior. I mix languages. I am pretty sure that my setup works the same. BTW solution around reduction of jump points does not not affect faces: "nd" or "badnd" at the end of "good badnd good " does not call spell check on the first "badnd". > > The difference is in word bounds. We are in trouble if flyspell's word > > on its ends does not have ends of emacs' word. If flyspell's word has > > ends of emacs' word on its ends and even contain them inside then we > > are ok (try to search "a b" over "aa bb a b aa bb"). So could ends of > > flyspell's word do not match with ends of emacs' word? > > Yes, definitely. See what flyspell-get-word does to find where the > word begins and where it ends. Flyspell's "words" are > language-sensitive, whereas Emacs's words are not. I saw this function. Emacs words are language sensitive too. Emacs jumps through all ends of words from RU and EN languages even if the words are not separated. Example: Word of 3 parts: English "asdf", Russian "фыва" (execute-kbd-macro (kbd "C-q 02104 RET C-q 02113 RET C-q 02062 RET C-q 02060 RET")), English "asdf". asdfфываasdf ^ ^ ^ ^ b b b f f f M-b and C-M-r \< jumps through positions marked by b. M-f and C-M-r \> jumps through positions marked by f. It is one word for flyspell in my setup and in LANG=C emacs -Q. But I do not know if it is applicable to other languages and/or other setups. How could it be improved? Other solutions? I'd propose as a variant to use emacs' words for flyspell and vice versa but it would a bad idea. My emacs jumps over asdf'asdf in one hop and similar behaviour could be done for other languages with their respective 'otherchars' but it would be inconvenient for some users including me (python-mode has _ as a part of word by default, both questions how to enable it everywhere and how to disable it in python-mode exist). Thanks! -- Regards, Aleksey Cherepanov