From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#17678: 24.4.50; Feature Request -- calculate new `window-start` & `window-end` before visual redisplay Date: Wed, 11 Jun 2014 21:45:31 +0300 Message-ID: <831tuvz3n8.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1402512392 12473 80.91.229.3 (11 Jun 2014 18:46:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Jun 2014 18:46:32 +0000 (UTC) Cc: esq@lawlist.com, 17678@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 11 20:46:25 2014 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 1WunXR-0008Ct-7f for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Jun 2014 20:46:21 +0200 Original-Received: from localhost ([::1]:49043 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WunXO-00014H-R7 for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Jun 2014 14:46:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WunXG-000136-6z for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2014 14:46:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WunX9-0003wm-GY for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2014 14:46:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53416) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WunX9-0003wc-D2 for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2014 14:46:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WunX8-0007rf-II for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2014 14:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Jun 2014 18:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17678 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17678-submit@debbugs.gnu.org id=B17678.140251235230210 (code B ref 17678); Wed, 11 Jun 2014 18:46:02 +0000 Original-Received: (at 17678) by debbugs.gnu.org; 11 Jun 2014 18:45:52 +0000 Original-Received: from localhost ([127.0.0.1]:44566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WunWu-0007r4-Ek for submit@debbugs.gnu.org; Wed, 11 Jun 2014 14:45:52 -0400 Original-Received: from mtaout28.012.net.il ([80.179.55.184]:51359) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WunWp-0007qP-3Z for 17678@debbugs.gnu.org; Wed, 11 Jun 2014 14:45:46 -0400 Original-Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0N7000100P73UO00@mtaout28.012.net.il> for 17678@debbugs.gnu.org; Wed, 11 Jun 2014 21:43:55 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N7000K6NPD7GM70@mtaout28.012.net.il>; Wed, 11 Jun 2014 21:43:55 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il 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: 140.186.70.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:90267 Archived-At: > From: Stefan Monnier > Date: Wed, 11 Jun 2014 14:00:39 -0400 > Cc: 17678@debbugs.gnu.org > > > I believe that the solution may be to have a `sneak-preview-redisplay` > > whereby the *new* `window-start` and *new* `window-end` could be > > correctly calculated without the visual buffer actually > > being redisplayed. > > Of course, there's a circularity problem, here: if you need window-start > (you can already compute window-end without an actual redisplay) in > order to then install things like text-properties properties and > overlays that affect the display, then those added properties may end up > requiring changing window-start again (because they end up pushing point > outside of the window and require a scroll). Indeed. But if there's a hook that is forbidden from making such changes to buffer text, then this is doable. Otherwise, it's a waste of time having such a hook, since it will be unreliable. > IIUC your particular use case (drawing crosshairs to show where the > cursor is located) is one where what you really need is to know when > window-start changes (just like follow-mode). > > So, a good feature might be one that runs a hook when redisplay decides > that window-start needs to be reset (i.e. that point moved out of the > window and we need to scroll). The display engine changes window-start for several reasons, only one of them being that point moved off screen. I think follow-mode also needs to know when the window-end changes (which could happen with no changes in window-start). This is normally known only at the end of window redisplay, IIRC.