From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Ittay Dror Newsgroups: gmane.emacs.help Subject: Re: placing cursor at *start* of match in incremental search Date: 23 Jan 2003 07:58:46 +0200 Organization: Qlusters Inc. Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <1043301279.8748.31.camel@rum> References: <3E2D7F8E.1050205@ihs.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1043301638 9089 80.91.224.249 (23 Jan 2003 06:00:38 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 23 Jan 2003 06:00:38 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18baPh-0002MS-00 for ; Thu, 23 Jan 2003 07:00:33 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18baPx-0005Cj-09 for gnu-help-gnu-emacs@m.gmane.org; Thu, 23 Jan 2003 01:00:49 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18baPR-0004qm-00 for help-gnu-emacs@gnu.org; Thu, 23 Jan 2003 01:00:17 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18baP8-0004Zj-00 for help-gnu-emacs@gnu.org; Thu, 23 Jan 2003 00:59:59 -0500 Original-Received: from adsl-161-92.barak.net.il ([62.90.161.92] helo=hirame.qlusters.com) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18baP6-0004QU-00 for help-gnu-emacs@gnu.org; Thu, 23 Jan 2003 00:59:57 -0500 Original-Received: from [10.100.0.13] ([10.100.0.13]) by hirame.qlusters (8.10.2/8.10.2) with ESMTP id h0N5pQe01811; Thu, 23 Jan 2003 07:51:27 +0200 Original-To: mac@dgp.toronto.edu, help-gnu-emacs@gnu.org In-Reply-To: X-Mailer: Ximian Evolution 1.2.0 (1.2.0-3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:5891 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:5891 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