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

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

Re: Isearch functionality


From: weber
Subject: Re: Isearch functionality
Date: Tue, 31 Jul 2007 14:18:31 -0000
User-agent: G2/1.0

On 31 jul, 10:59, "Drew Adams" <drew.ad...@oracle.com> wrote:
> > I'd like to implement a command inside isearch that deletes the
> > current match _from the buffer_ (not from the search string)
>
> > This would be very useful since many times the search string you are
> > looking for is exactly what you want to remove, and it may be
> > something inside a word, so you can't just end isearch and do a kill
> > word. Do you get me ?
>
> > Anyway, I'd really appreciate some tips on how to implement this.
> > Maybe one could search the buffer for the specific type of overlay for
> > current match??
>
> Any of these ways:
>
> 1. End Isearch when you find what you want to delete. Then `C-@ C-r C-r'.
>
> 2. Use isearch+.el. You can choose to end Isearch with the search target
> selected.
>
> 3. Use Icicles search, and replace search hits on the fly (with nothing, in
> this case).
>
> For #1 and #2, just hit C-w to delete the search hit, or, if you use
> `delete-selection-mode', just hit Backspace.
>
> #1 and #2 require you to exit Isearch; #3 lets you delete any number of
> selected search hits without exiting search.
>
> For #2: seehttp://www.emacswiki.org/cgi-bin/wiki/IsearchPlus.
>
> For #3: 
> seehttp://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Search_Commands%2c_Ov...,http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Search-And-Replace.

Many thanks for your answer, it was very complete.
Isearch+ is pretty much what I want :)

Also i had this snippet to force isearch to always put the cursor in
the beginning of the match:

(defun custom-goto-match-beginning ()
  "Use with isearch hook to end search at first char of match."
   (when isearch-forward (goto-char isearch-other-end)))

which i just changed to:

(defun custom-goto-match-beginning ()
  "Use with isearch hook to end search at first char of match."
  (when isearch-forward (exchange-point-and-mark)))

to work with isearch+.

Cheers,
weber





reply via email to

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