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: Fri, 29 Jan 2016 10:42:25 +0200 Message-ID: <83y4b8ydxq.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1454057014 12393 80.91.229.3 (29 Jan 2016 08:43:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Jan 2016 08:43:34 +0000 (UTC) Cc: johnw@gnu.org, 22404@debbugs.gnu.org To: Keith David Bershatsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 29 09:43:22 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 1aP4eD-0004SD-88 for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Jan 2016 09:43:17 +0100 Original-Received: from localhost ([::1]:60591 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aP4eC-0006V2-JH for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Jan 2016 03:43:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aP4e3-0006L6-64 for bug-gnu-emacs@gnu.org; Fri, 29 Jan 2016 03:43:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aP4dy-0005Pg-Du for bug-gnu-emacs@gnu.org; Fri, 29 Jan 2016 03:43:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52048) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aP4dy-0005Pc-9z for bug-gnu-emacs@gnu.org; Fri, 29 Jan 2016 03:43:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aP4dy-0006fA-5a for bug-gnu-emacs@gnu.org; Fri, 29 Jan 2016 03:43: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: Fri, 29 Jan 2016 08:43: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.145405696925583 (code B ref 22404); Fri, 29 Jan 2016 08:43:02 +0000 Original-Received: (at 22404) by debbugs.gnu.org; 29 Jan 2016 08:42:49 +0000 Original-Received: from localhost ([127.0.0.1]:40268 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aP4dk-0006eZ-Qn for submit@debbugs.gnu.org; Fri, 29 Jan 2016 03:42:49 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:33862) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aP4di-0006eD-KK for 22404@debbugs.gnu.org; Fri, 29 Jan 2016 03:42:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aP4dc-0005B1-LC for 22404@debbugs.gnu.org; Fri, 29 Jan 2016 03:42:41 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53031) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aP4dX-000577-BO; Fri, 29 Jan 2016 03:42:35 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3560 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aP4dT-0005ji-Vi; Fri, 29 Jan 2016 03:42:32 -0500 In-reply-to: (message from Keith David Bershatsky on Thu, 28 Jan 2016 19:08:22 -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:112075 Archived-At: > Date: Thu, 28 Jan 2016 19:08:22 -0800 > From: Keith David Bershatsky > Cc: 22404@debbugs.gnu.org,Eli Zaretskii > > Let's say for example that someone has a function named `foo` which uses `window-start` and `window-end`, and the user wants that function to run every command loop. Everyone will immediately think of the `post-command-hook` because the buffer or position may have been modified by `this-command` (whatever that may be). The way Emacs is presently designed, people are needlessly calling `foo` multiple times when scrolling occurs because the `post-command-hook` can't provide correct numbers. Personally, I think that having a function run by post-command-hook that crucially depends on window-start and window-end is poor design. Emacs never promised that these values be accurate before redisplay runs, since redisplay sometimes needs to change where the window starts and ends. Solving this with window-scroll-functions is not the proper solution, either, for the reasons already discussed at length in this thread. I still don't understand well enough why pre-command-hook is not a better solution here. Until I do, I don't see how this issue can be resolved better than it is today. I don't like exposing APIs that manipulate flags which are there for internal machinery. Lisp programs that set these flags arbitrarily can easily disrupt the redisplay operation, so such APIs is a time bomb.