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: Wed, 19 Feb 2014 00:56:45 +0400 Message-ID: <85zjlo5ecy.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1392757152 22432 80.91.229.3 (18 Feb 2014 20:59:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 18 Feb 2014 20:59:12 +0000 (UTC) To: 16800@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 18 21:59:20 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 1WFrl7-0002oz-5a for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Feb 2014 21:59:17 +0100 Original-Received: from localhost ([::1]:54009 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFrl6-0001tp-SA for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Feb 2014 15:59:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFrky-0001th-Ou for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2014 15:59:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFrks-0000NP-Nm for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2014 15:59:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57797) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFrks-0000NL-Jt for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2014 15:59:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WFrks-0007nL-DH for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2014 15:59: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: Tue, 18 Feb 2014 20:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 16800 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.139275711429916 (code B ref -1); Tue, 18 Feb 2014 20:59:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Feb 2014 20:58:34 +0000 Original-Received: from localhost ([127.0.0.1]:58979 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WFrkP-0007mP-BK for submit@debbugs.gnu.org; Tue, 18 Feb 2014 15:58:34 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:45516) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WFrjU-0007kO-ID for submit@debbugs.gnu.org; Tue, 18 Feb 2014 15:57:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFrjJ-0008ST-CI for submit@debbugs.gnu.org; Tue, 18 Feb 2014 15:57:31 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:52014) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFrjJ-0008SP-9W for submit@debbugs.gnu.org; Tue, 18 Feb 2014 15:57:25 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47205) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFrjD-0000TE-8q for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2014 15:57:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFrj7-0008QJ-Ct for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2014 15:57:19 -0500 Original-Received: from mail-lb0-x22f.google.com ([2a00:1450:4010:c04::22f]:55379) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFrj7-0008Q1-5A for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2014 15:57:13 -0500 Original-Received: by mail-lb0-f175.google.com with SMTP id p9so12512074lbv.6 for ; Tue, 18 Feb 2014 12:57:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=8zuBCm6c4EwDny8RU7eDAh1FMMINcJHudOVjrroOOTU=; b=BWEH9qsdEP/v8TkyBuRBKbxERRC6btm40cxYhy98Kh/srOPNgch1jtgxQGAMYpad+t VHfWdVjyBE4uOC75Xx6+jK/EWjbWfecbz8nSr8iX/yog9JEe2EoR3Wc8oouFMo/7YFQ6 hlZgYcX9p1QAlKFb+03ybDUGrN99OmYeTIMHSgXJC1aLvHk3br3mTd0XcnyXIFhwNaok 4Va6a2uD+XK/tZj1Eb9I6vEqYdWaA9b2sfH3ID0FD1srHlCd62ywTKibg20MEimGGHli yWFT8lrXTck1qFzPA5JuUZHhiNMjf8oFwqGq9NFN/N118ZVgp4pkBvkmyWjbkXOeDRzJ ZjrA== X-Received: by 10.152.234.3 with SMTP id ua3mr142928lac.63.1392757031511; Tue, 18 Feb 2014 12:57:11 -0800 (PST) Original-Received: from debian ([188.123.230.115]) by mx.google.com with ESMTPSA id y2sm33703583lal.10.2014.02.18.12.57.10 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 18 Feb 2014 12:57:10 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Mailman-Approved-At: Tue, 18 Feb 2014 15:58:32 -0500 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:85862 Archived-At: Package: emacs Version: 24.3 Severity: normal Dear Maintainers, It is a copy of bug #739412 in Debian. Debian uses bug tracker similar to this one. The bug on web: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=739412 Address to continue thread there: 739412@bugs.debian.org * What led up to the situation? 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. * What exactly did you do (or not do) that was effective (or ineffective)? So exact sequence is $ emacs --version GNU Emacs 24.3.1 $ emacs23 --version GNU Emacs 23.4.1 $ perl -e 'print(((join " ", ("met and") x 10) . "\n") x 30000)' > t.txt $ LANG=C emacs -Q t.txt Then in emacs: M-x flyspell-mode RET M-> nd SPC 'emacs23 -Q t.txt' works the same way. LANG=C affects regular words because default dictionary is Russian on my system so without LANG=C all words ("met" and "and") are considered misspelled. But it does not affect huge pause at the end. * What was the outcome of this action? Huge pause when emacs does not react on keys except C-g. Word "nd" is colored as misspelled after the pause. C-g stops emacs internal thinking and I could work without waiting but word "nd" is not colored as misspelled word. * What outcome did you expect instead? I expect it to work as fast as with other words like "md" or "mw" that does not produce a pause and are colored immediately. 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. 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. Thanks! -- Regards, Aleksey Cherepanov In GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.8.6) of 2013-12-23 on brahms, modified by Debian Windowing system distributor `The X.Org Foundation', version 11.0.11405000 System Description: Debian GNU/Linux testing (jessie) Configured using: `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3/site-lisp:/usr/share/emacs/site-lisp' '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=yes' '--with-x-toolkit=gtk3' '--with-toolkit-scroll-bars' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall' 'LDFLAGS=-Wl,-z,relro' 'CPPFLAGS=-D_FORTIFY_SOURCE=2'' Important settings: value of $LANG: ru_RU.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix default enable-multibyte-characters: t