From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Lazy Isearch in dired Date: Thu, 13 Nov 2008 18:30:19 +0200 Organization: JURTA Message-ID: <87r65fh9lw.fsf@jurta.org> References: <87d4h5ew7x.fsf@jurta.org> <87fxlv4pa7.fsf@cyd.mit.edu> <878wrn4p6a.fsf@cyd.mit.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1226594669 7026 80.91.229.12 (13 Nov 2008 16:44:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Nov 2008 16:44:29 +0000 (UTC) Cc: emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 13 17:45:31 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L0fJO-000703-FG for ged-emacs-devel@m.gmane.org; Thu, 13 Nov 2008 17:44:54 +0100 Original-Received: from localhost ([127.0.0.1]:42102 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0fIG-0002Fs-IO for ged-emacs-devel@m.gmane.org; Thu, 13 Nov 2008 11:43:44 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L0f7I-0006o4-4b for emacs-devel@gnu.org; Thu, 13 Nov 2008 11:32:24 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L0f7G-0006nO-6v for emacs-devel@gnu.org; Thu, 13 Nov 2008 11:32:23 -0500 Original-Received: from [199.232.76.173] (port=49230 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0f7F-0006nG-UM for emacs-devel@gnu.org; Thu, 13 Nov 2008 11:32:21 -0500 Original-Received: from relay01.kiev.sovam.com ([62.64.120.200]:4885) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L0f7E-0006xL-W6 for emacs-devel@gnu.org; Thu, 13 Nov 2008 11:32:22 -0500 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay01.kiev.sovam.com with esmtp (Exim 4.67) (envelope-from ) id 1L0f72-000Dud-Ue; Thu, 13 Nov 2008 18:32:12 +0200 In-Reply-To: <878wrn4p6a.fsf@cyd.mit.edu> (Chong Yidong's message of "Thu, 13 Nov 2008 10:32:29 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu) X-Scanner-Signature: 4204c266f86c3e9b1e0231505dd73b85 X-DrWeb-checked: yes X-SpamTest-Envelope-From: juri@jurta.org X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Trusted X-SpamTest-Info: Profiles 5704 [Nov 13 2008] X-SpamTest-Info: {received from trusted relay: common white list} X-SpamTest-Info: {HEADERS: header Content-Type found without required header Content-Transfer-Encoding} X-SpamTest-Method: white ip list X-SpamTest-Rate: 10 X-SpamTest-Status: Trusted X-SpamTest-Status-Extended: trusted X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0278], KAS30/Release X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.8-5.1 (or MacOS X 10.2-10.3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:105651 Archived-At: >>> The following patch fixes this by using a loop like the loop in the >>> function `isearch-search'. The docstring of isearch-lazy-highlight-search >>> says: "Attempt to do the search exactly the way the pending isearch would.", >>> so no changes in the docstring are needed, because this patch makes it >>> more similar to the main search function. It also calls isearch-success-function >>> to skip the matches outside the current Isearch scope. By default this >>> function skips invisible matches that are useless for lazy highlighting. >>> This also requires setting search-invisible to nil to not match >>> invisible text. >> >> Hmm, your patch looks reasonable, but I'm not sure. Could it possibly >> lead to slowdowns in some buffers from the additional search loop? >> Maybe we should hold this till after the release. > > Ah, I see you already installed it. That's OK. In normal cases there is no slowdown because the new additional loop gets executed only once. And in cases with a restricted search (with invisible matches or matches outside of the search space) there is really a speedup instead of slowdown because unnecessary overlays for lazy highlights never get created - these places are skipped with a new loop. > Could you do some quick testing to make sure there isn't a slowdown? > (e.g., try searching in a buffer in a way that generates lots of lazy > highlights). The quickest way to test is to open the etc/NEWS file and 1. expand all outlines with `C-c C-a' and type `C-M-s .' the time required to highlight all matched is the same as before; 2. hide everything but the top levels with `C-1 C-c C-q' and type `C-M-s .' then highlighting now is much faster than before because it now doesn't create unnecessary overlays on matches in hidden regions. -- Juri Linkov http://www.jurta.org/emacs/