From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Request for enhancement: Scrolling (etc.) in incremental search. Date: Mon, 10 Nov 2003 08:49:56 +0200 Organization: JURTA Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87vfpszpij.fsf@mail.jurta.org> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1068447625 14307 80.91.224.253 (10 Nov 2003 07:00:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 10 Nov 2003 07:00:25 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon Nov 10 08:00:23 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AJ62A-0000HX-00 for ; Mon, 10 Nov 2003 08:00:22 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AJ62A-0001rB-00 for ; Mon, 10 Nov 2003 08:00:22 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AJ6v6-0004YV-JA for emacs-devel@quimby.gnus.org; Mon, 10 Nov 2003 02:57:08 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AJ6v1-0004Xr-0N for emacs-devel@gnu.org; Mon, 10 Nov 2003 02:57:03 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AJ6uU-0004Vc-Nw for emacs-devel@gnu.org; Mon, 10 Nov 2003 02:57:01 -0500 Original-Received: from [64.246.52.22] (helo=ns5.tangramltd.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1AJ6uU-0004VV-Br for emacs-devel@gnu.org; Mon, 10 Nov 2003 02:56:30 -0500 Original-Received: from 80-235-32-131-dsl.mus.estpak.ee ([80.235.32.131] helo=mail.jurta.org) by ns5.tangramltd.com with esmtp (Exim 4.20) id 1AJ5x1-0006KE-9p; Mon, 10 Nov 2003 08:55:03 +0200 Original-To: Alan Mackenzie In-Reply-To: (Alan Mackenzie's message of "Thu, 23 Oct 2003 21:48:35 +0000 (GMT)") User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ns5.tangramltd.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jurta.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:17746 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:17746 Alan Mackenzie writes: > [A quick reminder of what this is for: it lets you scroll the window > during incremental search, so that you can see more of what's around > point without leaving the search. I've been using it for months, and > wouldn't want to be without it now. :-] Until you presented this patch, I used a simple C-l keybinding to isearch-mode-map to recenter. But your patch is a big improvement over it. Thank you! However, I found one glitch with new code: due to a bug in the display engine, sometimes point moves to a wrong position after scrolling, and isearch completely stumbles over. The following patch fixes this by setting the point back to its original position. This patch is also helpful for scrolling with scroll-preserve-screen-position set to t. Index: emacs/lisp/isearch.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/isearch.el,v retrieving revision 1.223 diff -c -r1.223 isearch.el *** emacs/lisp/isearch.el 1 Nov 2003 17:00:02 -0000 1.223 --- emacs/lisp/isearch.el 10 Nov 2003 05:03:27 -0000 *************** *** 1461,1467 **** (command-execute scroll-command) (let ((ab-bel (isearch-string-out-of-window isearch-point))) (if ab-bel ! (isearch-back-into-window (eq ab-bel 'above) isearch-point))) (isearch-update)) (search-exit-option (let (window) --- 1461,1469 ---- (command-execute scroll-command) (let ((ab-bel (isearch-string-out-of-window isearch-point))) (if ab-bel ! (isearch-back-into-window (eq ab-bel 'above) isearch-point) ! (or (eq (point) isearch-point) ! (goto-char isearch-point)))) (isearch-update)) (search-exit-option (let (window) -- http://www.jurta.org/emacs/