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: Framework extending window functions for Follow Mode (etc.). Date: Mon, 7 Dec 2015 19:15:40 +0000 Message-ID: <20151207191540.GD1904@acm.fritz.box> References: <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> <87egf0ebs2.fsf@mail.linkov.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1449515667 15260 80.91.229.3 (7 Dec 2015 19:14:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Dec 2015 19:14:27 +0000 (UTC) Cc: 17453@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 07 20:14: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 1a61Ej-0000FR-R6 for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Dec 2015 20:14:14 +0100 Original-Received: from localhost ([::1]:56102 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a61Ej-0002Iv-CO for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Dec 2015 14:14:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a61Ec-0002Ds-Sh for bug-gnu-emacs@gnu.org; Mon, 07 Dec 2015 14:14:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a61EZ-0001Ch-KM for bug-gnu-emacs@gnu.org; Mon, 07 Dec 2015 14:14:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52310) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a61EZ-0001CG-3n for bug-gnu-emacs@gnu.org; Mon, 07 Dec 2015 14:14:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a61EY-0002ER-Hr for bug-gnu-emacs@gnu.org; Mon, 07 Dec 2015 14:14: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, 07 Dec 2015 19:14: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.14495156348558 (code B ref 17453); Mon, 07 Dec 2015 19:14:02 +0000 Original-Received: (at 17453) by debbugs.gnu.org; 7 Dec 2015 19:13:54 +0000 Original-Received: from localhost ([127.0.0.1]:42018 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a61EP-0002Dy-TD for submit@debbugs.gnu.org; Mon, 07 Dec 2015 14:13:54 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:61823) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a61E5-0002DV-GG for 17453@debbugs.gnu.org; Mon, 07 Dec 2015 14:13:52 -0500 Original-Received: (qmail 41411 invoked by uid 3782); 7 Dec 2015 19:13:32 -0000 Original-Received: from acm.muc.de (p5B1463E7.dip0.t-ipconnect.de [91.20.99.231]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 07 Dec 2015 20:13:31 +0100 Original-Received: (qmail 10899 invoked by uid 1000); 7 Dec 2015 19:15:40 -0000 Content-Disposition: inline In-Reply-To: <87egf0ebs2.fsf@mail.linkov.net> 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:109726 Archived-At: Hello, Juri. On Sun, Dec 06, 2015 at 01:06:05AM +0200, Juri Linkov wrote: > >> 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. Yes, I think we're in violent agreement here. [ .... ] > > 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) First comment: this sort of thing will wreck Follow Mode, scrolling text in the current window rather than point moving forward to the next window. > How would you do the same without these hooks, using only post-command-hook? By putting #'recenter into `post-command-hook'? This should work for Isearch, and would work for Replace and Ispell if these two used the Emacs command loop. > > ######################################################################### > > 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 have indeed put *Choices* at the top of the RH window, to preserve sanity. I committed those changes, including changes to Ispell this afternoon. I think they're close to working fully. > 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). I've put the window group stuff into ispell.el - there wasn't a lot to change. This afternoon, lack of lazy highlighting in Ispell (bug #22097) made itself noticeable again. I'll see what I can do, here. -- Alan Mackenzie (Nuremberg, Germany).