From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#17453: Framework extending window functions for Follow Mode (etc.). Date: Sun, 06 Dec 2015 01:06:05 +0200 Organization: LINKOV.NET Message-ID: <87egf0ebs2.fsf@mail.linkov.net> References: <56444C48.5000609@gmx.at> <8737wbx9ep.fsf@mail.linkov.net> <20151117225558.GC5054@acm.fritz.box> <878u5w3zf2.fsf@mail.linkov.net> <20151118175814.GA1690@acm.fritz.box> <87egfmkea0.fsf@mail.linkov.net> <20151125193301.GI2007@acm.fritz.box> <8737vs8isw.fsf@mail.linkov.net> <20151130203723.GA24162@acm.fritz.box> <874mg33ubg.fsf@mail.linkov.net> <20151205164032.GD2698@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1449357446 16836 80.91.229.3 (5 Dec 2015 23:17:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Dec 2015 23:17:26 +0000 (UTC) Cc: 17453@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 06 00:17:15 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 1a5M4m-0007d6-FJ for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Dec 2015 00:17:12 +0100 Original-Received: from localhost ([::1]:48043 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5M4l-0001dW-8c for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Dec 2015 18:17:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5M4i-0001bT-6H for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2015 18:17:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a5M4d-0002LK-36 for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2015 18:17:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50450) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5M4d-0002LG-0I for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2015 18:17:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a5M4c-0000aG-HB for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2015 18:17:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Dec 2015 23:17: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.14493573932199 (code B ref 17453); Sat, 05 Dec 2015 23:17:02 +0000 Original-Received: (at 17453) by debbugs.gnu.org; 5 Dec 2015 23:16:33 +0000 Original-Received: from localhost ([127.0.0.1]:40158 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a5M49-0000ZO-6e for submit@debbugs.gnu.org; Sat, 05 Dec 2015 18:16:33 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:47294 helo=homiemail-a100.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a5M3p-0000Yg-5e for 17453@debbugs.gnu.org; Sat, 05 Dec 2015 18:16:32 -0500 Original-Received: from homiemail-a100.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a100.g.dreamhost.com (Postfix) with ESMTP id BFBFB31A073; Sat, 5 Dec 2015 15:16:12 -0800 (PST) Original-Received: from localhost.linkov.net (m91-129-116-187.cust.tele2.ee [91.129.116.187]) (Authenticated sender: jurta@jurta.org) by homiemail-a100.g.dreamhost.com (Postfix) with ESMTPA id 8115731A070; Sat, 5 Dec 2015 15:16:11 -0800 (PST) In-Reply-To: <20151205164032.GD2698@acm.fritz.box> (Alan Mackenzie's message of "Sat, 5 Dec 2015 16:40:32 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (x86_64-pc-linux-gnu) 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:109677 Archived-At: >> I see no problem for follow-mode to add follow-post-command-hook >> to both hooks. > > Because this ties Follow Mode to implementation details of isearch.el, > replace.el, and ispell.el. It is plain ugly for Follow Mode to have to > add-hook an obscure hook for every package that attempts lazy > highlighting. A hook is needed not only for lazy highlighting (in its current state), but also for every package that doesn't use the standard command loop. >> Adding a new hook is just a one-liner, but we have to find the right place >> in perform-replace to call it. I think replace-update-pre-hook should be >> called before (read-event), and replace-update-post-hook after (read-event). >> I'm not yet sure which one is needed for follow-mode to sync windows? > > At the moment there is only replace-update-post-hook. It is called after > point has been moved, but before i-l-highlight-new-loop is called. I had > to move it slightly from where your patch had put it. Yes, you've moved it to a better place. > Sorry, I made a typo there. I really meant replace-update-post-hook. > Can we somehow keep this "internal use only", so that we are not bound > somehow to keep supporting it should the `query-replace' command loop be > reformulated (as believe it should, ASAP)? The same applies to > ispell-update-post-hook, which I've been forced to introduce into > ispell.el for the same reason. isearch-update-post-hook, replace-update-post-hook, ispell-update-post-hook are not just a hack, they will stay as useful hooks even after we'll rewrite query-replace/ispell to use the standard command loop. These hooks are for convenience, for the users to be able to set in ~/.emacs, e.g.: (add-hook 'isearch-update-post-hook 'recenter) (add-hook 'replace-update-post-hook 'recenter) How would you do the same without these hooks, using only post-command-hook? > ######################################################################### > > Anyhow, here's a status update with where I am on making isearch.el and > follow.el work together: > > (i) Yesterday I rebased the scratch/follow branch on the emacs-25 branch. > (ii) I haven't yet replaced the GROUP parameter in the windows primitives > with (e.g.) `window-group-start'. > (iii) isearch.el now appears to work properly. For this, I had to swap > the order of invocation of isearch-update-post-hook and i-l-h-new-loop, > like you said. I restored i-l-h-new-loop pretty much to the way it was > prior to my experimentations. > (iv) replace.el now appears to work properly. > (v) ispell.el is more troublesome. See bug #22097. I have a problem > with ispell putting its *Choices* window at the top of the left hand > Follow Mode window. Because of FM's sorting algorithm, this causes the > two windows to be logically swapped, leading to confusing results. I > think the neatest solution would be to put *Choices* at the top of the > rightmost window, preventing this. I believe bug#22097 is easy to fix for lazy highlighting, but what you described above is more troublesome, and might require adding support for window groups to ispell.el (like you're adding it to isearch.el).