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: Mon, 02 Nov 2015 02:14:47 +0200 Organization: LINKOV.NET Message-ID: <87bnbddzpk.fsf@mail.linkov.net> References: <20140509224458.GA4205@acm.acm> <20151029232302.GB3812@acm.fritz.box> <87h9l6627a.fsf@mail.linkov.net> <20151031235651.GE1853@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1446423369 15353 80.91.229.3 (2 Nov 2015 00:16:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Nov 2015 00:16:09 +0000 (UTC) Cc: 17453@debbugs.gnu.org, Stefan Monnier , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 02 01:16:04 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 1Zt2n5-0002Dd-PI for ged-emacs-devel@m.gmane.org; Mon, 02 Nov 2015 01:16:03 +0100 Original-Received: from localhost ([::1]:39410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zt2n5-0008LJ-82 for ged-emacs-devel@m.gmane.org; Sun, 01 Nov 2015 19:16:03 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zt2mt-0008L3-9k for emacs-devel@gnu.org; Sun, 01 Nov 2015 19:15:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zt2mp-0002UB-9f for emacs-devel@gnu.org; Sun, 01 Nov 2015 19:15:51 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:38618 helo=homiemail-a100.g.dreamhost.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zt2mp-0002U0-3T for emacs-devel@gnu.org; Sun, 01 Nov 2015 19:15:47 -0500 Original-Received: from homiemail-a100.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a100.g.dreamhost.com (Postfix) with ESMTP id 4596231A073; Sun, 1 Nov 2015 16:15:44 -0800 (PST) Original-Received: from localhost.linkov.net (82.131.11.41.cable.starman.ee [82.131.11.41]) (Authenticated sender: jurta@jurta.org) by homiemail-a100.g.dreamhost.com (Postfix) with ESMTPA id 0160131A070; Sun, 1 Nov 2015 16:15:42 -0800 (PST) In-Reply-To: <20151031235651.GE1853@acm.fritz.box> (Alan Mackenzie's message of "Sat, 31 Oct 2015 23:56:51 +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:193088 Archived-At: >> >>From another perspective, settings lazy-highlight-buffer to t >> (implemented in bug#21092) and removing the current restriction of >> (overlay-put ov 'window (selected-window)) will lazy-highlight matches >> in all follow windows with no effort. > > I wasn't actually aware of that fix. > > There were three main problems my patch fixed: > 1) Searching commands were restricted to a single follow window. This > was caused by the lazy highlighting mechanism, as you say. > 2) Lazy highlighting was only being done in a single window. > 3) In scrolling commands, point was restricted to the singled window, > rather than being able to move freely throughout all the windows. IIUC, lazy highlighting is not a problem anymore, so the remaining problem is how to switch windows when the next search position happens to be in an adjacent window. Since there is no other core library that require so much changes to adapt to follow-mode, and there are already some mode-specific hooks in follow.el like compilation-filter-hook, indicates that it's the responsibility of follow.el to support isearch in follow-mode. So I believe the right way to do this is like Artur presented in a short patch, and maybe it's possible to simplify it even more by using isearch-update-post-hook with a follow-align-compilation-windows like hook. I mean something like (add-hook 'isearch-update-post-hook follow-align-isearch-windows t t)