From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artur Malabarba Newsgroups: gmane.emacs.bugs Subject: bug#22090: Isearch is sluggish and eventually refuses further service with "[Too many words]". Date: Fri, 4 Dec 2015 15:16:23 +0000 Message-ID: References: <20151204042052.GA1965@acm.fritz.box> <834mfyin34.fsf@gnu.org> Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1449242241 20327 80.91.229.3 (4 Dec 2015 15:17:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Dec 2015 15:17:21 +0000 (UTC) Cc: 22090@debbugs.gnu.org, Alan Mackenzie To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 04 16:17:12 2015 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 1a4s6h-0003YE-F7 for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 Dec 2015 16:17:11 +0100 Original-Received: from localhost ([::1]:41508 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4s6g-0004CU-U0 for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 Dec 2015 10:17:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4s6c-000455-Qn for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2015 10:17:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a4s6Z-0005rM-Jd for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2015 10:17:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49420) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4s6Z-0005rH-GY for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2015 10:17:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a4s6Z-0007gQ-7H for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2015 10:17:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Artur Malabarba Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 Dec 2015 15:17:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22090 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22090-submit@debbugs.gnu.org id=B22090.144924218729482 (code B ref 22090); Fri, 04 Dec 2015 15:17:03 +0000 Original-Received: (at 22090) by debbugs.gnu.org; 4 Dec 2015 15:16:27 +0000 Original-Received: from localhost ([127.0.0.1]:39127 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a4s5z-0007fR-97 for submit@debbugs.gnu.org; Fri, 04 Dec 2015 10:16:27 -0500 Original-Received: from mail-lf0-f44.google.com ([209.85.215.44]:36385) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a4s5w-0007fH-8I for 22090@debbugs.gnu.org; Fri, 04 Dec 2015 10:16:25 -0500 Original-Received: by lfs39 with SMTP id 39so110662990lfs.3 for <22090@debbugs.gnu.org>; Fri, 04 Dec 2015 07:16:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; bh=PqD45NIkj3PUlfDglK1B9YjW+uQ9FrjfVH4/br0JpKU=; b=P7T6JSPYU914SPH0Jlag/7jNj/TZl6qCulNZiwwDyq1hlNiBG4Gtg3FJ53cyLM1D2l m8pY/znvebMqzDSPOxRcGGRuAjBnVALDtAmo+WckjeWwILpdF8Ut4ZtwBPwhTvFXgZq3 CVZLrwrw6cmhhGW0EOU7KHbJqAaIlR1agN8k4Z70KvQfaSIOxZG1ElehjOSKPuDRYRcQ noWjbWvo05deanuD3c+Z+K5TbcUOL1QG/K1VnD/9ScMaKKm5kFvLLQHie6vC2RN9Rz7a XlrITfet4U7ID/KASNJT4sDRJLRRTiidXBORWRCDdg1mo+ZNXBs16R7wP1304kzFXkfF jHQw== X-Received: by 10.25.137.7 with SMTP id l7mr7014396lfd.63.1449242183327; Fri, 04 Dec 2015 07:16:23 -0800 (PST) Original-Received: by 10.112.202.99 with HTTP; Fri, 4 Dec 2015 07:16:23 -0800 (PST) In-Reply-To: <834mfyin34.fsf@gnu.org> X-Google-Sender-Auth: ErEapYeb3hiuKurSmEGa0iw3I68 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: 208.118.235.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:109587 Archived-At: 2015-12-04 9:23 GMT+00:00 Eli Zaretskii : >> Date: Fri, 4 Dec 2015 04:20:52 +0000 >> From: Alan Mackenzie >> >> With a recent emacs-25 (last update >> eaa1fd6dbff8346eb38485de5ebf0fbfacf374d9 from Thursday 2015-12-03): >> >> emacs -Q >> C-c C-f src/xdisp.c >> Move point to L30 (paragraph beginning "Updating the display is triggere= d >> by the Lisp interpreter ...") >> >> C-s >> C-w repeatedly, to yank words onto the search string. >> >> After ~29 words have been yanked, the response becomes sluggish, pausing >> for between 0.5s and 1s before highlighting the "for" at the end of L31. Thanks for the report. The source for this (and for a similar bug mentioned on a thread in emacs-devel) was the code I had added for special case-folding support. For now, I've just removed the code. I can think of a way of solving this, but it adds some complexity to isearch, which I don't wanna do (and I don't think this feature was that important anyway). Here's a full copy of the commit message explaining why the bug happens. 30f3432 * lisp/character-fold.el: Remove special case-folding support (character-fold-to-regexp): Remove special code for case-folding. Char-fold search still respects the `case-fold-search' variable (i.e., f matches F). This only removes the code that was added to ensure that f also matched all chars that F matched. For instance, after this commit, f no longer matches =F0=9D=94=BD. This was necessary because the logic created a regexp with 2^(length of the string) redundant paths. So, when a very long string "almost" matched, Emacs took a very long time to figure out that it didn't. This became particularly relevant because isearch's lazy-highlight does a search bounded by (1- match-end) (which, in most circumstances, is a search that almost matches). A recipe for this can be found in bug#22090.