[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: tags-loop-continue backwards?

From: Drew Adams
Subject: RE: tags-loop-continue backwards?
Date: Sat, 16 Feb 2008 09:55:07 -0800

> Suppose, I started searching through files by hitting "A" (dired-do-
> search) in dired mode. I then can continue searching by hitting
> "M-," (tags-loop-continue). However, how do I search backwards?
> Searching backwards may for example be necessary, when I suddenly
> realize that, five files ago, I have missed something. In fact it is a
> very important feature for me.

AFAIK, there is no way to go backward. And you must access all of the search
hits, in sequence - no skipping.

If you use Icicles, however, you can use `M-s' in Dired to search the marked
files (and possibly replace selected search hits). You first type a regexp
to search for. All matches appear as candidates in buffer *Completions* -
each match is accompanied by the name of its file. You can then access any
candidates, in any order, sequentially or not.

When searching, you can also type another pattern (e.g. regexp) in the
minibuffer, to filter the search hits to those that match it. Your current
minibuffer input can filter against the search hit text or the file name or

You can change your input on the fly to filter differently. At any time, you
can access the matching hits in any order. Access some hits matching one
pattern, change the pattern and access hits matching the new pattern,...,
any number of times.

You can match any number of regexps cumulatively, narrowing the search space
incrementally. This means you can use a collection of simple patterns,
rather than trying to come up with a single complex regexp that DTRT. You
can easily match patterns A and B and C and D, regardless of the order of
their matches in a given search hit.

You can also complement the set of matches at any time (relative to the
superset it filtered), so you can easily chip away large search-hit chunks
that don't interest you and quickly focus in on what you want to visit. For
example, use that to ignore a certain file on the fly, during some of your

As mentioned, you can also replace matching search text on the fly. You are
not queried about replacement, so you don't need to reply yes or no to each
search hit - just hit a key when you want to replace the current hit you've
navigated to.

The same Icicles search behavior is available for other Emacs contexts:
imenu, grep, shell/comint, and tags searches. So you can, for example, visit
tags other than by using `M-,' (which runs through them all, sequentially,
without backing up).


1. Screenshot of search-hit candidates: matches against some Icicles source
files that I marked in Dired. The initial search regexp was ".*dired.*". The
current input at the time of the screenshot was "search". The current input
match is highlighted in red. The longest common match is in pink, and the
file names have a light green background. (You can customize the
highlighting, of course.)

2. Screenshot of visited source file for the fourth search-hit candidate.
Pink background means it is the current hit (matches ".dired.*"). Green
background indicates the text that matches your current input ("search").
Cyan background shows other matches for .*dired.*.

Wrt replacement: you can optionally replace the entire current search
context (pink and green) or just the match for your current input (green).
You can toggle that replacement focus at any time while searching.

The green highlighting shows that your current-input ("search") match is
expanded to the longest match ("icicle-search-dired-marked") that is common
to all hits. That expansion is optional; you can toggle it on/off at any
time while searching. If I toggled it off, then only "search" would be

Attachment: icicles-search-hit-visit.png
Description: PNG image

Attachment: icicles-search-candidates.png
Description: PNG image

reply via email to

[Prev in Thread] Current Thread [Next in Thread]