unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Ittay Dror <ittay@qlusters.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: placing cursor at *start* of match in incremental search
Date: 26 Jan 2003 12:24:06 +0200	[thread overview]
Message-ID: <1043576646.1094.142.camel@rum> (raw)
In-Reply-To: <1043574470.8748.138.camel@rum>

On Sun, 2003-01-26 at 11:47, Ittay Dror wrote:
> On Sun, 2003-01-26 at 08:28, Ittay Dror wrote:
> > On Thu, 2003-01-23 at 15:58, Maciej Kalisiak wrote:
> > > On Thu, Jan 23, 2003 at 07:58:46AM +0200, Ittay Dror wrote:
> > > > 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.
> > > 
well i found a bug there. the problem is that the match changes between
the calls to the two functions (probably the lazy highlight loop). so
here is the (very simple) fix:
(defvar isearch-match-end "Match end of current isearch" 0)

(defadvice isearch-search (after put-cursor-at-beginning last act)
  (if isearch-success
	  (progn
		(setq isearch-match-end (point))
		(goto-char (match-beginning 0))
		)))

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

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

      reply	other threads:[~2003-01-26 10:24 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-16 15:24 placing cursor at *start* of match in incremental search Maciej Kalisiak
2003-01-16 16:09 ` Stefan Monnier <foo@acm.com>
2003-01-16 17:18 ` Kevin Rodgers
2003-01-16 17:53 ` Adrian Kubala
2003-01-16 20:30 ` Greg Hill
2003-01-16 20:45 ` David Robinow
2003-01-17 18:27   ` Maciej Kalisiak
2003-01-20 21:51     ` * Tong *
     [not found] ` <mailman.415.1042749231.21513.help-gnu-emacs@gnu.org>
2003-01-17 18:35   ` Maciej Kalisiak
2003-01-17 19:34     ` Greg Hill
2003-01-21 17:12     ` Kevin Rodgers
2003-01-22 14:41       ` Maciej Kalisiak
2003-01-22 17:22         ` Kevin Rodgers
2003-01-22 19:53           ` Greg Hill
     [not found]           ` <mailman.807.1043265863.21513.help-gnu-emacs@gnu.org>
2003-01-22 20:49             ` Stefan Monnier <foo@acm.com>
2003-01-22 21:57             ` Kevin Rodgers
2003-01-23  5:58         ` Ittay Dror
2003-01-23 13:58           ` Maciej Kalisiak
2003-01-26  6:28             ` Ittay Dror
2003-01-26  9:47               ` Ittay Dror
2003-01-26 10:24                 ` Ittay Dror [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1043576646.1094.142.camel@rum \
    --to=ittay@qlusters.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).