help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: killing the result of isearch


From: Charles A. Roelli
Subject: Re: killing the result of isearch
Date: Sat, 11 Nov 2017 16:36:39 +0100

> From: Emanuel Berg <moasen@zoho.com>
> Date: Wed, 08 Nov 2017 14:47:16 +0100
> 
> It is called searching but many times what
> happens is it is a form of navigation - a goto
> in the text buffer, if you will.
> 
> Because I do this all the time, like one of the
> most common ways to position point, I get
> totally stressed out by the default
> "incremental" search.
> 
> Here is some code if anyone else is like me and
> hasn't got his own file already
> 
>     http://user.it.uu.se/~embe8573/emacs-init/wrap-search.el

I was also looking for a less nervous way to search through a buffer
recently, and I found that the "/" command in view-mode fits the bill
exactly.  You hit "/ foo RET", and you are brought to the next match
for "foo", starting from the bottom of the window.  You can hit "n"
and "p" to go forward and backward between matches.  What's useful is
the omission of some information when you navigate between matches --
only one match per screenful is highlighted, and when you hit "n" or
"p" the next time, the search starts from the end or start of the
window, respectively.  It's useful for getting a rough idea of the
matches for a regexp, without actually cycling through all the matches
with C-s.  And if you need a more fine-grained search, "s" and "r" are
bound to isearch-forward and isearch-backward.

"/" also comes with some other goodies, see:

  / runs the command View-search-regexp-forward (found in
  view-mode-map), which is an interactive compiled Lisp function in
  ‘view.el’.

  It is bound to /.

  (View-search-regexp-forward N REGEXP)

  Search forward for first (or prefix Nth) occurrence of REGEXP in View mode.

  Displays line found at center of window.  Sets mark at starting position and
  pushes mark ring.

  Characters @ and ! are special at the beginning of REGEXP.  They modify
  the search rather than become part of the pattern searched for.
  @ means search all the buffer i.e. start search at the beginning of buffer.
  ! means search for a line that contains no match for the pattern.
  If REGEXP is empty or only consist of these control characters, then
  an earlier remembered REGEXP is used, otherwise REGEXP is remembered
  for use by later search commands.



reply via email to

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