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: Fri, 13 Jun 2014 20:55:51 +0300 Message-ID: <83d2ecwv6g.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1402682245 23574 80.91.229.3 (13 Jun 2014 17:57:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Jun 2014 17:57:25 +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 Fri Jun 13 19:57:17 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 1WvVj2-0002Z4-72 for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Jun 2014 19:57:16 +0200 Original-Received: from localhost ([::1]:60327 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvVj1-0008SC-O3 for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Jun 2014 13:57:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45121) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvVit-0008RB-Ro for bug-gnu-emacs@gnu.org; Fri, 13 Jun 2014 13:57:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WvVio-0007WT-HM for bug-gnu-emacs@gnu.org; Fri, 13 Jun 2014 13:57:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55744) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvVio-0007WN-DF for bug-gnu-emacs@gnu.org; Fri, 13 Jun 2014 13:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WvVio-0001oj-1G for bug-gnu-emacs@gnu.org; Fri, 13 Jun 2014 13:57: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: Fri, 13 Jun 2014 17:57: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.14026821736888 (code B ref 17678); Fri, 13 Jun 2014 17:57:01 +0000 Original-Received: (at 17678) by debbugs.gnu.org; 13 Jun 2014 17:56:13 +0000 Original-Received: from localhost ([127.0.0.1]:46894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WvVi0-0001n1-Kk for submit@debbugs.gnu.org; Fri, 13 Jun 2014 13:56:13 -0400 Original-Received: from mtaout27.012.net.il ([80.179.55.183]:53581) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WvVhw-0001mg-RU for 17678@debbugs.gnu.org; Fri, 13 Jun 2014 13:56:10 -0400 Original-Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0N7400D00BACRA00@mtaout27.012.net.il> for 17678@debbugs.gnu.org; Fri, 13 Jun 2014 20:53:01 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N7400C8GCCCXE50@mtaout27.012.net.il>; Fri, 13 Jun 2014 20:53:01 +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:90350 Archived-At: > Date: Fri, 13 Jun 2014 09:22:07 -0700 > From: Keith David Bershatsky > Cc: 17678@debbugs.gnu.org > > The `window-scroll-functions` hook would be more useful if the value of `window-start` could be obtained *before* running the `post-command-hook`. At the present time, it would appear that the `post-command-hook` runs *before* the `window-scroll-functions` hook. Therefore, the `post-command-hook` cannot presently use the `window-start` value produced from the `window-scroll-functions` hook (which occurs *after* the `post-command-hook` has already finished). Yes, post-command-hook runs before window-scroll-functions. That's because post-command-hook runs immediately after a command execution is finished and Emacs is about to return to the command loop, while window-scroll-functions run as part of redisplay, which is entered whenever Emacs is idle, i.e., after the return to the command loop. Unfortunately, what you are asking for is not possible with the current design of Emacs, because window-start is computed as part of redisplay (it is one of the most important functions of redisplay to compute that). OTOH, I don't understand why do you need what you ask for. For example, why can't you do whatever you need from window-scroll-functions, instead of doing some of it in post-command-hook? Perhaps you should describe the problem you are trying to solve in more detail.