From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#17453: Isearch doesn't work properly with Follow Mode. Date: Mon, 2 Nov 2015 12:35:12 +0000 Message-ID: <20151102123512.GB11804__48610.0733200603$1446467668$gmane$org@acm.fritz.box> 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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1446467668 14735 80.91.229.3 (2 Nov 2015 12:34:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Nov 2015 12:34:28 +0000 (UTC) Cc: 17453@debbugs.gnu.org, emacs-devel , Stefan Monnier , Juri Linkov To: Artur Malabarba Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 02 13:34:16 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1ZtEJO-0002MS-NL for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Nov 2015 13:34:10 +0100 Original-Received: from localhost ([::1]:41683 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtEJO-0003u8-1z for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Nov 2015 07:34:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtEJJ-0003u2-W8 for bug-gnu-emacs@gnu.org; Mon, 02 Nov 2015 07:34:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtEJG-0008PM-Lj for bug-gnu-emacs@gnu.org; Mon, 02 Nov 2015 07:34:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57866) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtEJG-0008PH-IW for bug-gnu-emacs@gnu.org; Mon, 02 Nov 2015 07:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZtEJG-0001eg-99 for bug-gnu-emacs@gnu.org; Mon, 02 Nov 2015 07:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Nov 2015 12:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17453 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17453-submit@debbugs.gnu.org id=B17453.14464676136320 (code B ref 17453); Mon, 02 Nov 2015 12:34:02 +0000 Original-Received: (at 17453) by debbugs.gnu.org; 2 Nov 2015 12:33:33 +0000 Original-Received: from localhost ([127.0.0.1]:48574 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZtEIn-0001ds-7P for submit@debbugs.gnu.org; Mon, 02 Nov 2015 07:33:33 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:55832) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZtEIl-0001dj-0s for 17453@debbugs.gnu.org; Mon, 02 Nov 2015 07:33:31 -0500 Original-Received: (qmail 61886 invoked by uid 3782); 2 Nov 2015 12:33:29 -0000 Original-Received: from acm.muc.de (p5B147B71.dip0.t-ipconnect.de [91.20.123.113]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 02 Nov 2015 13:33:28 +0100 Original-Received: (qmail 13512 invoked by uid 1000); 2 Nov 2015 12:35:12 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:108297 Archived-At: Hello, Artur. On Mon, Nov 02, 2015 at 11:53:10AM +0000, Artur Malabarba wrote: > > I don't actually understand that patch, I'll need to study the wierd/new > > constructs used in it, like `when-let'. > Here's a more thoroughly explained version of this function, that > doesn't use when-let. > seq-find is equivalent to cl-find-if, it returns the first element > that matches the provided predicate. OK. [ .... ] > I also changed it to use (follow-all-followers). That's unwanted. ;-) Isearch should not be using internal Follow Mode functions. Some more abstraction would be needed. > > However, I'm certain that that patch will not fix all the problems > > discussed in this post. > The patch as provided doesn't fix the “highlighting matches on all > windows” issue. But that's trivial to solve by removing that > `(overlay-put ov 'window (selected-window))' line. (which I have half > a mind to do right now because I just think it's a generally useful > improvement.) Lazy highlighting searches for matches on the current window. It must be extended to search for matches on the Follow Mode group of windows. For that, it needs the details of the "window*-start" and "window*-end". > > One way or another, isearch MUST work with the > > window boundaries of the entire Follow Mode group. > Maybe I missed part of the issue. I thought you wanted Isearch to > switch to another window if that window contains the next match > (instead of scrolling the current window). For that, you only need > pos-visible-in-window-p, you don't need to mess with boundaries. What is causing the unwanted scrolling rather than moving to the next window, is the form "(sit-for 0)" near the start of isearch-lazy-highlight-new-loop. When point is outside the window, this form causes redisplay, which scrolls point back into the window - without Follow Mode getting a look in. In my patch, I replaced this with "(sit*-for 0)", where Follow Mode can do its thing before the redisplay happens. -- Alan Mackenzie (Nuremberg, Germany).