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#22404: 25.1.50; Forcing `window-scroll-functions` to run. Date: Tue, 02 Feb 2016 18:34:58 +0200 Message-ID: <838u33ysst.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1454430988 23480 80.91.229.3 (2 Feb 2016 16:36:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Feb 2016 16:36:28 +0000 (UTC) Cc: 22404@debbugs.gnu.org To: Keith David Bershatsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 02 17:36:19 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 1aQdw6-0004zi-Ss for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 Feb 2016 17:36:15 +0100 Original-Received: from localhost ([::1]:58036 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQdw1-0000N9-1m for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 Feb 2016 11:36:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQdvy-0000N3-1R for bug-gnu-emacs@gnu.org; Tue, 02 Feb 2016 11:36:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQdvu-00027c-Ha for bug-gnu-emacs@gnu.org; Tue, 02 Feb 2016 11:36:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48411) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQdvu-00027Y-Db for bug-gnu-emacs@gnu.org; Tue, 02 Feb 2016 11:36:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aQdvu-0003lc-4b for bug-gnu-emacs@gnu.org; Tue, 02 Feb 2016 11:36:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 Feb 2016 16:36: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.145443093014437 (code B ref 22404); Tue, 02 Feb 2016 16:36:02 +0000 Original-Received: (at 22404) by debbugs.gnu.org; 2 Feb 2016 16:35:30 +0000 Original-Received: from localhost ([127.0.0.1]:57000 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aQdvN-0003kn-Uo for submit@debbugs.gnu.org; Tue, 02 Feb 2016 11:35:30 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:39714) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aQdvM-0003kY-5P for 22404@debbugs.gnu.org; Tue, 02 Feb 2016 11:35:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQdvC-00020l-Rj for 22404@debbugs.gnu.org; Tue, 02 Feb 2016 11:35:22 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54808) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQdvC-00020h-Om; Tue, 02 Feb 2016 11:35:18 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2027 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aQdvC-0002NR-51; Tue, 02 Feb 2016 11:35:18 -0500 In-reply-to: (message from Keith David Bershatsky on Mon, 01 Feb 2016 05:18:02 -0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:112276 Archived-At: > Date: Mon, 01 Feb 2016 05:18:02 -0800 > From: Keith David Bershatsky > Cc: 22404@debbugs.gnu.org > > The four (4) values that I am most interested in are: > > 1. window-start > > 2. window-end > > 3. Point at the beginning of the line containing window-start. > > 4. Point at the end of the line containing window-end. These are available from Lisp, so there seems to be no need to pass them as arguments to the hook, right? > Although my proposed usage of the `post-redisplay-hook` will not be to alter buffer (i.e., I'm just adding overlays), other people who may use this new hook in the future may be modifying the buffer content -- e.g., adding/removing fonts, adding/removing text, moving the cursor, etc. If those users need this new hook, they can always invoke redisplay explicitly at the end of their code, right? > The `window-scroll-functions` hook is strategically placed at three locations of `xdisp.c`, and some of those areas are revisited when things have changed since the first pass -- e.g., continuation line at the beginning of the window, or cursor is partially visible at the bottom of the window. But the fact they run in the middle of the redisplay cycle is exactly the source of the problems we are trying to solve! > If the `post-redisplay-hook` runs too late in time to receive any checks regarding cursor position and so forth, some users may be surprised when their cursor ends up below the visible screen at the conclusion of redisplay -- e.g., because they added text or increased a font size that pushed the cursor further down below. Calling redisplay explicitly should resolve all those issues.