From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier 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 14:00:39 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT X-Trace: ger.gmane.org 1402509747 12380 80.91.229.3 (11 Jun 2014 18:02:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Jun 2014 18:02:27 +0000 (UTC) Cc: 17678@debbugs.gnu.org To: Keith David Bershatsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 11 20:02:19 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 1Wumpw-0007GL-Ba for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Jun 2014 20:01:24 +0200 Original-Received: from localhost ([::1]:48866 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wumpv-0008K6-R9 for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Jun 2014 14:01:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59205) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wumpk-0008Jy-8p for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2014 14:01:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wumpa-0007KI-QS for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2014 14:01:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53357) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wumpa-0007KC-Ms for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2014 14:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WumpZ-0006Oy-Vh for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2014 14:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Jun 2014 18:01:01 +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.140250965624589 (code B ref 17678); Wed, 11 Jun 2014 18:01:01 +0000 Original-Received: (at 17678) by debbugs.gnu.org; 11 Jun 2014 18:00:56 +0000 Original-Received: from localhost ([127.0.0.1]:44507 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WumpP-0006ON-Md for submit@debbugs.gnu.org; Wed, 11 Jun 2014 14:00:56 -0400 Original-Received: from relais.videotron.ca ([24.201.245.36]:58495) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WumpI-0006O3-TA for 17678@debbugs.gnu.org; Wed, 11 Jun 2014 14:00:49 -0400 Original-Received: from ceviche.home ([24.203.184.39]) by VL-VM-MR004.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0N7000FNTND37D42@VL-VM-MR004.ip.videotron.ca> for 17678@debbugs.gnu.org; Wed, 11 Jun 2014 14:00:39 -0400 (EDT) Original-Received: by ceviche.home (Postfix, from userid 20848) id 00AB666159; Wed, 11 Jun 2014 14:00:39 -0400 (EDT) In-reply-to: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) 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:90262 Archived-At: > In a stackoverflow thread regarding this issue, @Stefan suggested that > I take a look at the `jit-lock-register`. After combing through the > code in `jit-lock.el` and trying some experiments, I believe that > `jit-lock.el` is more suited to a situation when buffer *modification* > occurs -- it is also suited for situations where one may wish to > incrementially act upon an entire buffer in small chunks at a time to > increase efficiency of avaialble resources. Indeed, jit-lock is designed for features that depend on the buffer's *contents* but not on things like the value of `point'. > 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). This said, the request is reasonable, and seems related to the needs of follow-mode as well. 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). Stefan