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#22404: 25.1.50; Forcing `window-scroll-functions` to run. Date: Tue, 19 Jan 2016 11:26:59 -0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by - "") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1453231702 15886 80.91.229.3 (19 Jan 2016 19:28:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 19 Jan 2016 19:28:22 +0000 (UTC) Cc: 22404@debbugs.gnu.org To: "John Wiegley" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 19 20:28:11 2016 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 1aLbwo-0002o0-6O for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Jan 2016 20:28:10 +0100 Original-Received: from localhost ([::1]:38955 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLbwn-0001az-Ee for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Jan 2016 14:28:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLbwj-0001TL-Jq for bug-gnu-emacs@gnu.org; Tue, 19 Jan 2016 14:28:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLbwg-0004hE-Ao for bug-gnu-emacs@gnu.org; Tue, 19 Jan 2016 14:28:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37601) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLbwg-0004hA-7a for bug-gnu-emacs@gnu.org; Tue, 19 Jan 2016 14:28:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aLbwg-0003uZ-39 for bug-gnu-emacs@gnu.org; Tue, 19 Jan 2016 14:28:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Keith David Bershatsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Jan 2016 19:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22404 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22404-submit@debbugs.gnu.org id=B22404.145323162814964 (code B ref 22404); Tue, 19 Jan 2016 19:28:02 +0000 Original-Received: (at 22404) by debbugs.gnu.org; 19 Jan 2016 19:27:08 +0000 Original-Received: from localhost ([127.0.0.1]:54054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aLbvo-0003tH-K7 for submit@debbugs.gnu.org; Tue, 19 Jan 2016 14:27:08 -0500 Original-Received: from cobb.liquidweb.com ([50.28.13.150]:59745) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aLbvn-0003sw-CZ for 22404@debbugs.gnu.org; Tue, 19 Jan 2016 14:27:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date; bh=UUK713tnyeiLbGWRF25Z9FeS3MsFhZathDRh+7Q80wU=; b=bpcJD/RmzJFCySPwXajGS1snzw1mUHQZqwjhdrUgssB1OKjDeZfh5a3H+y9YtI8B1/KuD41zi2t1k/D0vMFDZVHtuGaQ8aE4zB+Ok/befxO2rC7iSDhHXG0ZONHOL/j5; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:50396 helo=server.local.localhost) by cobb.liquidweb.com with esmtp (Exim 4.82) (envelope-from ) id 1aLbvd-0005Rf-Ty; Tue, 19 Jan 2016 14:26:58 -0500 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: acl_c_relayhosts_text_entry: lawlist|lawlist.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:111766 Archived-At: I too, John, got really excited when I saw `run-window-scroll-functions`. Unfortunately, it doesn't return the correct window-start and window-end because it runs too soon. It's not really a trigger that forces the WSF to run at its normal stages during redisplay. If you run the following test in a lengthy buffer in a vertical split window pane with a *Messages* buffer in the other pane, then use the down arrow key to force window scrolling as the cursor moves, you'll see the numbers from the PCH are wrong and the numbers from WSF are correct. The other problem with `run-window-scroll-functions` for this usage is that the WSF still runs when it is supposed to run, but there is an extra call to just the function attached to the WSF hook -- in other words, there might be as many as three (3) times the WSF function runs -- once with the wrong results off of the PCH, and once with the initial results from the WSF, and one final time when the WSF does its last call. That last call on the WSF is the one I'm seeking. Sometimes WSF only runs once when scrolling if point is fully visible. (setq scroll-conservatively 101) (defvar pch-test-var nil) (defun pch-fn () (let ((pch-test-var t)) (run-window-scroll-functions (selected-window)))) (add-hook 'post-command-hook 'pch-fn nil 'local) (defun wsf-fn (win start) (message "hook: %s | win: %s | start: %s | end: %s" (if pch-test-var "PCH" "WSF") win start (window-end win t))) (add-hook 'window-scroll-functions 'wsf-fn nil 'local) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; At Tue, 19 Jan 2016 10:53:32 -0800, John Wiegley wrote: > > >>>>> Keith David Bershatsky writes: > > > `run-window-scroll-functions` runs immediately and is not a viable > > substitute for this feature request. > > Keith, why is the fact that it runs immediately a problem? The very name of > this function answers your feature request, but you don't explain why it is > insufficient, other than this comment. > > How would run-window-scroll-functions need to be changed, since that is the > advertised way to... run the window-scroll-functions? > > -- > John Wiegley