all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: emacs-devel@gnu.org
Subject: Re: Lazy Isearch in dired
Date: Thu, 13 Nov 2008 18:30:19 +0200	[thread overview]
Message-ID: <87r65fh9lw.fsf@jurta.org> (raw)
In-Reply-To: <878wrn4p6a.fsf@cyd.mit.edu> (Chong Yidong's message of "Thu, 13 Nov 2008 10:32:29 -0500")

>>> 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/




  reply	other threads:[~2008-11-13 16:30 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-08  9:56 Isearch in dired Richard M. Stallman
2008-11-08 10:59 ` Juri Linkov
2008-11-08 11:33   ` Lennart Borgman
2008-11-08 12:23     ` Alan Mackenzie
2008-11-08 15:22       ` Lennart Borgman
2008-11-08 17:07       ` Juri Linkov
2008-11-09  0:26   ` Richard M. Stallman
2008-11-09 21:57     ` Juri Linkov
2008-11-08 12:19 ` Alan Mackenzie
2008-11-08 17:08   ` Juri Linkov
2008-11-08 14:10 ` Chong Yidong
2008-11-08 16:05   ` joakim
2008-11-08 17:27     ` Juri Linkov
2008-11-08 17:17   ` Juri Linkov
2008-11-09  0:26   ` Richard M. Stallman
2008-11-08 21:57 ` Lazy " Juri Linkov
2008-11-09 20:54   ` recursive-edit in Isearch Juri Linkov
2008-11-09 21:09   ` Occur in Word Isearch Juri Linkov
2008-11-13 15:29     ` Chong Yidong
2008-11-13 15:30   ` Lazy Isearch in dired Chong Yidong
2008-11-13 15:32     ` Chong Yidong
2008-11-13 16:30       ` Juri Linkov [this message]
2008-11-13 17:07         ` Chong Yidong
2008-11-09 14:22 ` Chong Yidong
2008-11-09 15:08   ` Stefan Monnier
2008-11-09 17:59   ` Juri Linkov
2008-11-11 22:55     ` Chong Yidong
2008-11-12  2:59       ` Stefan Monnier
2008-11-12 11:59         ` René Kyllingstad
2008-11-12 15:13           ` Drew Adams
2008-11-12 15:53         ` Richard M. Stallman
2008-11-12  7:55       ` Juri Linkov
2008-11-12 15:08         ` Chong Yidong
2008-11-13 16:57           ` Juri Linkov
2008-11-16 22:22             ` Juri Linkov
2008-11-10  3:11   ` Richard M. Stallman
2008-11-11 21:35     ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r65fh9lw.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.