From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artur Malabarba Newsgroups: gmane.emacs.bugs Subject: bug#17453: Isearch doesn't work properly with Follow Mode. Date: Wed, 4 Nov 2015 10:17:09 +0000 Message-ID: References: <20151102123512.GB11804@acm.fritz.box> <20151102154445.GD11804@acm.fritz.box> <87h9l46l7o.fsf@mail.linkov.net> <20151103123116.GD2258@acm.fritz.box> <83a8qvw0aq.fsf@gnu.org> <20151103221131.GG2258@acm.fritz.box> <87mvuur4kn.fsf@mail.linkov.net> <20151104090106.GA1736@acm.fritz.box> Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1446632311 30999 80.91.229.3 (4 Nov 2015 10:18:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 4 Nov 2015 10:18:31 +0000 (UTC) Cc: 17453@debbugs.gnu.org, Juri Linkov To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 04 11:18:23 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 1Ztv8y-0000Ez-30 for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Nov 2015 11:18:16 +0100 Original-Received: from localhost ([::1]:53748 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ztv8s-0004Pe-Ii for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Nov 2015 05:18:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34750) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ztv8o-0004PV-9Q for bug-gnu-emacs@gnu.org; Wed, 04 Nov 2015 05:18:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ztv8k-00074v-S2 for bug-gnu-emacs@gnu.org; Wed, 04 Nov 2015 05:18:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33360) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ztv8k-00074r-OT for bug-gnu-emacs@gnu.org; Wed, 04 Nov 2015 05:18:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Ztv8k-0002WR-3N for bug-gnu-emacs@gnu.org; Wed, 04 Nov 2015 05:18:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Artur Malabarba Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Nov 2015 10:18: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.14466322359634 (code B ref 17453); Wed, 04 Nov 2015 10:18:02 +0000 Original-Received: (at 17453) by debbugs.gnu.org; 4 Nov 2015 10:17:15 +0000 Original-Received: from localhost ([127.0.0.1]:52301 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Ztv7y-0002VI-7s for submit@debbugs.gnu.org; Wed, 04 Nov 2015 05:17:14 -0500 Original-Received: from mail-lb0-f173.google.com ([209.85.217.173]:32926) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Ztv7u-0002V8-Of for 17453@debbugs.gnu.org; Wed, 04 Nov 2015 05:17:12 -0500 Original-Received: by lbbkw15 with SMTP id kw15so6796021lbb.0 for <17453@debbugs.gnu.org>; Wed, 04 Nov 2015 02:17:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=k+K/O3YfWrN4QqKM2myA9/JXuMr6pZpTK9LxTiaFdgk=; b=v+KbraQ7WP/G86tVkLvwGvIsnWtFmRevS0nulx85xRHOYaP++2hxcWq2DFOR2t3ptu IlQ8cWyx4yjEKodaukuW1jVM4XKuC98jQqcrVJ+tMr1j/KdedLcFsYVHmXzAVKG3VS5o diI/wkbzMqWEF3ch5yl+GqsBp4JGCBim38dp3zLV5sfjTpcESv2txKalVNMk1UnZCTJe urFyV2xNH+UuCvT8sP9wO2FojL58Oon0RPQxw274eSyBqLOuNLEmUjA8bKTGB5DvSSzb ftnxCf7004i/MzVDoY9GPIYMveXii+ecVoUsuxVVZQtqnMhDTFRiJkj1Ny4eEzMza2ET /aUg== X-Received: by 10.112.235.65 with SMTP id uk1mr505511lbc.118.1446632229968; Wed, 04 Nov 2015 02:17:09 -0800 (PST) Original-Received: by 10.112.63.71 with HTTP; Wed, 4 Nov 2015 02:17:09 -0800 (PST) In-Reply-To: <20151104090106.GA1736@acm.fritz.box> X-Google-Sender-Auth: 9sgsRkpjU817Zz2OI4OGHFMk4ek 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:108427 Archived-At: 2015-11-04 9:01 GMT+00:00 Alan Mackenzie : >> It still might help to synchronise the windows from isearch-update-post-hook >> if we'll call it before calling isearch-lazy-highlight-new-loop with sit-for. > > I still say, wait until we really need it before we do anything so > drastic. As Eli noted, follow-post-command-hook is SLOW, SLOW, SLOW. > If we call it twice per command, it will be twice as slow. > > Also, why is the "(sit-for 0)" there at all? As its comment says, It > is there for one purpose, and one purpose only: it is so that > (window-start) is valid, and the check > > (not (= (window-start) > isearch-lazy-highlight-window-start)) > > will work. This check means exactly "has the window scrolled?" Have you tested redisplay-would-scroll-window-p in a fully folded org-mode buffer with 100 headlines where each headline has 100 lines of content? If you report that it works in this context and isn't slow then I'm ok with going with this solution. Like I said, as long as it doesn't cause regressions, this would be a fine refactoring to do in isearch.el. So we might as well apply it now and give any possible issues some time to surface (isearch is used by tons of people, so I'm sure they'll surface if any exist). While you're at it, if you could also refactor all those `(not (equal ...))' tests into a single `isearch--lazy-highlight-needs-update-p' function that would be very welcome (and if you do, do it as a separate commit before everything else so the other stuff is easy to revert separately). And if it looks like I'm saying "I'm fine with this" to everything here, that's because I am. It sounds like we're debating two fine options and bordering on bikeshedding. So I say: merge one and see how it goes. Cheers