all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Remembering a regexp across searches
@ 2005-02-02  9:17 Michael Preminger
  2005-02-02 10:25 ` David Kastrup
  2005-02-02 18:07 ` kgold
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Preminger @ 2005-02-02  9:17 UTC (permalink / raw)


Hello!

Maybe something I would expect to find in the FAQ, but to no avail:

I need to do repeating incremental searches of regular expression.

when I find what I was looking for - I need to do some changes 
(manually), and then search for the next occurrence corresponding to the 
same regexp.

Sometimes the regexps are complicated, and retyping them in the 
Iserach-buffer is tedious.

How do I avoid this re-typing? Is there a way to make emacs "remember" a 
regexp and re-use it in a handy way?

Thanks

michael

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Remembering a regexp across searches
  2005-02-02  9:17 Remembering a regexp across searches Michael Preminger
@ 2005-02-02 10:25 ` David Kastrup
  2005-02-02 11:00   ` Slawomir Nowaczyk
  2005-02-02 18:07 ` kgold
  1 sibling, 1 reply; 4+ messages in thread
From: David Kastrup @ 2005-02-02 10:25 UTC (permalink / raw)


Michael Preminger <michaelp@hio.no> writes:

> Maybe something I would expect to find in the FAQ, but to no avail:
>
> I need to do repeating incremental searches of regular expression.
>
> when I find what I was looking for - I need to do some changes
> (manually), and then search for the next occurrence corresponding to
> the same regexp.
>
> Sometimes the regexps are complicated, and retyping them in the
> Iserach-buffer is tedious.
>
> How do I avoid this re-typing? Is there a way to make emacs "remember"
> a regexp and re-use it in a handy way?

Just type another C-s and you are set.

So if you did your first search with 
C-u C-s something
then
C-u C-s C-s

will repeat the search.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Remembering a regexp across searches
  2005-02-02 10:25 ` David Kastrup
@ 2005-02-02 11:00   ` Slawomir Nowaczyk
  0 siblings, 0 replies; 4+ messages in thread
From: Slawomir Nowaczyk @ 2005-02-02 11:00 UTC (permalink / raw)


On Wed, 02 Feb 2005 11:25:23 +0100
David Kastrup <dak@gnu.org> wrote:

#> Michael Preminger <michaelp@hio.no> writes:

#> > Maybe something I would expect to find in the FAQ, but to no avail:
#> >
#> > I need to do repeating incremental searches of regular expression.
#> >
#> > when I find what I was looking for - I need to do some changes
#> > (manually), and then search for the next occurrence corresponding to
#> > the same regexp.
#> >
#> > Sometimes the regexps are complicated, and retyping them in the
#> > Iserach-buffer is tedious.
#> >
#> > How do I avoid this re-typing? Is there a way to make emacs "remember"
#> > a regexp and re-use it in a handy way?

#> Just type another C-s and you are set.

Or, if you need more history, meta-p and meta-n are your friends :-)
There are  a couple more nice things in isearch, and they are
explained in the "Emacs Manual".

-- 
 Best wishes,
   Slawomir Nowaczyk
     ( Slawomir.Nowaczyk@cs.lth.se )

As I said before, I never repeat myself.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Remembering a regexp across searches
  2005-02-02  9:17 Remembering a regexp across searches Michael Preminger
  2005-02-02 10:25 ` David Kastrup
@ 2005-02-02 18:07 ` kgold
  1 sibling, 0 replies; 4+ messages in thread
From: kgold @ 2005-02-02 18:07 UTC (permalink / raw)


Michael Preminger <michaelp@hio.no> writes:
> 
> I need to do repeating incremental searches of regular expression.
> 
> when I find what I was looking for - I need to do some changes 
> (manually), and then search for the next occurrence corresponding to the 
> same regexp.
> 
> Sometimes the regexps are complicated, and retyping them in the 
> Iserach-buffer is tedious.
> 
> How do I avoid this re-typing? Is there a way to make emacs "remember" a 
> regexp and re-use it in a handy way?

;; recalling from search ring
(define-key minibuffer-local-isearch-map [up]         'isearch-ring-retreat-edit)
(define-key minibuffer-local-isearch-map [down]       'isearch-ring-advance-edit)
(define-key isearch-mode-map [up]                     'isearch-ring-retreat)
(define-key isearch-mode-map [down]                   'isearch-ring-advance)

Then up/down arrow scrolls through the search history.

M-x ESC ESC recalls the last command, and also has up/down arrow history.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-02-02 18:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-02  9:17 Remembering a regexp across searches Michael Preminger
2005-02-02 10:25 ` David Kastrup
2005-02-02 11:00   ` Slawomir Nowaczyk
2005-02-02 18:07 ` kgold

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.