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

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

Re: placing cursor at *start* of match in incremental search


From: Ittay Dror
Subject: Re: placing cursor at *start* of match in incremental search
Date: 23 Jan 2003 07:58:46 +0200

On Wed, 2003-01-22 at 16:41, Maciej Kalisiak wrote:
> Played around a bit with both approaches, and it seems the "defadvice" method
> is the better of the two, at least as presented so far.  The probelm with the
> hook method, as shown above, is that it breaks the behaviour of an isearch
> abortion.  Usually, on a C-g the cursor goes back to where it was when C-s was
> pressed; with the hook form above it is placed at the first character of the
> match... seems the hook is called on *all* methods of ending an isearch.  
> OTOH,
> the defadvice form works properly.
> 
> Can the hook form be somehow coaxed to do abortion properly?

here are my 2c:
(defadvice isearch-search (after put-cursor-at-beginning last act)
  (if isearch-success (goto-char (match-beginning 0))))

(defadvice isearch-repeat (before put-cursor-at-end first act)
  (goto-char  (match-end 0)))

this will put the cursor at the start of the search *while* searching.
seems less confusing to me.

-- 
===================================
Ittay Dror (ittay@qlusters.com)
User Space Team, R&D
Qlusters Inc.
+972-3-6081976 Fax: +972-3-6081841





reply via email to

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