From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: bug#17453: Isearch doesn't work properly with Follow Mode. Date: Tue, 03 Nov 2015 01:28:40 +0200 Organization: LINKOV.NET Message-ID: <87d1vs56c7.fsf@mail.linkov.net> References: <20140509224458.GA4205@acm.acm> <20151029232302.GB3812@acm.fritz.box> <87h9l6627a.fsf@mail.linkov.net> <20151031235651.GE1853@acm.fritz.box> <87bnbddzpk.fsf@mail.linkov.net> <20151102092853.GA11804@acm.fritz.box> <20151102123512.GB11804@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1446506978 19755 80.91.229.3 (2 Nov 2015 23:29:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Nov 2015 23:29:38 +0000 (UTC) Cc: Alan Mackenzie , 17453@debbugs.gnu.org, Stefan Monnier , emacs-devel To: Artur Malabarba Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 03 00:29:29 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZtOXZ-00085Y-Bq for ged-emacs-devel@m.gmane.org; Tue, 03 Nov 2015 00:29:29 +0100 Original-Received: from localhost ([::1]:44738 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtOXY-0005kp-Kw for ged-emacs-devel@m.gmane.org; Mon, 02 Nov 2015 18:29:28 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtOXL-0005kN-RX for emacs-devel@gnu.org; Mon, 02 Nov 2015 18:29:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtOXH-0004R7-Q1 for emacs-devel@gnu.org; Mon, 02 Nov 2015 18:29:15 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:55502 helo=homiemail-a12.g.dreamhost.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtOXH-0004R3-KT for emacs-devel@gnu.org; Mon, 02 Nov 2015 18:29:11 -0500 Original-Received: from homiemail-a12.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a12.g.dreamhost.com (Postfix) with ESMTP id 9B04D103006C; Mon, 2 Nov 2015 15:29:10 -0800 (PST) Original-Received: from localhost.linkov.net (62.65.227.66.cable.starman.ee [62.65.227.66]) (Authenticated sender: jurta@jurta.org) by homiemail-a12.g.dreamhost.com (Postfix) with ESMTPA id 2CFF51030063; Mon, 2 Nov 2015 15:29:08 -0800 (PST) In-Reply-To: (Artur Malabarba's message of "Mon, 2 Nov 2015 14:18:59 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 69.163.253.7 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:193124 Archived-At: > +(defvar isearch-lazy-highlight-ongoing-search nil > + "Dynamically bound to t in `isearch-lazy-highlight-search'. > +This can be used by `isearch-search-fun-function' to detect > +whether its return value is being run for a proper user search or > +a lazy highlight search.") > + > (defun isearch-lazy-highlight-search () > "Search ahead for the next or previous match, for lazy highlighting. > Attempt to do the search exactly the way the pending Isearch would." > (condition-case nil > (let ((case-fold-search isearch-lazy-highlight-case-fold-search) > + (isearch-lazy-highlight-ongoing-search t) > (isearch-regexp isearch-lazy-highlight-regexp) > (isearch-regexp-function isearch-lazy-highlight-regexp-function) > (isearch-lax-whitespace Please note that this is unnecessary because all functions that override isearch-search-fun-function use its =E2=80=98bounds=E2=80=99 arg to detec= t whether it's called from isearch-search or isearch-lazy-highlight-search with the valu= e either nil or non-nil correspondingly. > @@ -279,8 +279,13 @@ isearch-lazy-highlight > "Controls the lazy-highlighting during incremental search. > When non-nil, all text in the buffer matching the current search > string is highlighted lazily (see `lazy-highlight-initial-delay' > -and `lazy-highlight-interval')." > - :type 'boolean > +and `lazy-highlight-interval'). > + > +When multiple windows display the current buffer, the > +highlighting is displayed only on the selected window, unless > +this variable is set to the symbol `all-windows'." > + :type '(choice boolean > + (const :tag "On, and applied to all windows" all-wind= ows)) > :group 'lazy-highlight > :group 'isearch) > =20 > @@ -3162,7 +3167,8 @@ isearch-lazy-highlight-update > ;; but lower than isearch main overlay's 1001 > (overlay-put ov 'priority 1000) > (overlay-put ov 'face lazy-highlight-face) > - (overlay-put ov 'window (selected-window)))) > + (unless (eq isearch-lazy-highlight 'all-wind= ows) > + (overlay-put ov 'window (selected-window))= ))) This is a good option that follow-mode could set (or users to customize).