From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Keith David Bershatsky 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 11:24:01 -0700 Message-ID: References: <83d2ecwv6g.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1402683929 11475 80.91.229.3 (13 Jun 2014 18:25:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Jun 2014 18:25:29 +0000 (UTC) Cc: 17678@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 13 20:25: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 1WvWA9-0001kQ-8Y for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Jun 2014 20:25:17 +0200 Original-Received: from localhost ([::1]:60514 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvWA8-00066z-Qa for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Jun 2014 14:25:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50359) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvWA0-00062U-A1 for bug-gnu-emacs@gnu.org; Fri, 13 Jun 2014 14:25:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WvW9u-0001KZ-Ub for bug-gnu-emacs@gnu.org; Fri, 13 Jun 2014 14:25:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55770) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvW9u-0001KJ-SO for bug-gnu-emacs@gnu.org; Fri, 13 Jun 2014 14:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WvW9u-0002kJ-43 for bug-gnu-emacs@gnu.org; Fri, 13 Jun 2014 14:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Keith David Bershatsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Jun 2014 18:25: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.140268385410465 (code B ref 17678); Fri, 13 Jun 2014 18:25:02 +0000 Original-Received: (at 17678) by debbugs.gnu.org; 13 Jun 2014 18:24:14 +0000 Original-Received: from localhost ([127.0.0.1]:46920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WvW96-0002ih-Ee for submit@debbugs.gnu.org; Fri, 13 Jun 2014 14:24:13 -0400 Original-Received: from cobb.liquidweb.com ([50.28.13.150]:41306) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WvW93-0002iP-R7 for 17678@debbugs.gnu.org; Fri, 13 Jun 2014 14:24:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com; s=default; h=To:References:Message-Id:Content-Transfer-Encoding:Cc:Date:In-Reply-To:From:Content-Type:Mime-Version:Subject; bh=MZvW/iUlkuRTNGsW7TXLwyqPEAJgCif8jBPho9gZHck=; b=GDGtnmUtbxJqeuTi0TS+TFcMu2TtdPoqPiUM+9qDujdSZ0ALezpocog7vxQYGECjKTjpRZ2v0zlCNaOqG4zFU41nYbC+WBynOxnqUdlr2etL2IowyWfjYUBqBLMjWrDJ; Original-Received: from cpe-75-85-5-102.socal.res.rr.com ([75.85.5.102]:50424 helo=[192.168.0.4]) by cobb.liquidweb.com with esmtpa (Exim 4.82) (envelope-from ) id 1WvW8u-0008LU-CJ; Fri, 13 Jun 2014 14:24:00 -0400 In-Reply-To: <83d2ecwv6g.fsf@gnu.org> X-Mailer: Apple Mail (2.1084) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cobb.liquidweb.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-Get-Message-Sender-Via: cobb.liquidweb.com: authenticated_id: lawlist/from_h 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:90352 Archived-At: I believe splitting up the work between the two hooks may be possible -- = I will need to revise the conditions once I identify additional = situations. As far as I can tell, the `window-scroll-functions` hook is = NOT triggered when `point` STAYS between *old* `window-start` and *old* = `window-end`. So when `point` STAYS between *old* `window-start` and = *old* `window-end`, I will need to use the `post-command-hook`. When = point moves BEYOND *old* `window-start` or `*old* `window-end`, then the = `window-scroll-functions` hook can take over -- with a forced new = `(window-end nil t)`. `window-scroll-functions`: (or (< (point) (window-start)) ;; good for things like = `beginning-of-buffer` (> (point) (window-end)) ;; good for things like `end-of-buffer` (> (point) (window-end nil t))) ;; good for things like `yank` `post-comand-hook` (and (not (< (point) (window-start))) (not (> (point) (window-end))) (not (> (point) (window-end nil t)))) I haven't tried it yet, but it appears to make sense based on what I saw = this morning with some `messages` that I set up using each hook. Keith --------------------------------------- On Jun 13, 2014, at 10:55 AM, Eli Zaretskii wrote: >> Date: Fri, 13 Jun 2014 09:22:07 -0700 >> From: Keith David Bershatsky >> Cc: 17678@debbugs.gnu.org >>=20 >> 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). >=20 > 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. >=20 > 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). >=20 > 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.