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: Thu, 21 Jan 2016 19:41:20 +0200 Message-ID: <83mvry96f3.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1453398147 32540 80.91.229.3 (21 Jan 2016 17:42:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Jan 2016 17:42:27 +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 Thu Jan 21 18:42:16 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 1aMJFM-0005MI-15 for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 Jan 2016 18:42:12 +0100 Original-Received: from localhost ([::1]:49163 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMJFL-0004V8-FT for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 Jan 2016 12:42:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMJFF-0004Qy-GJ for bug-gnu-emacs@gnu.org; Thu, 21 Jan 2016 12:42:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMJFC-0003gn-AC for bug-gnu-emacs@gnu.org; Thu, 21 Jan 2016 12:42:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40217) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMJFC-0003ga-74 for bug-gnu-emacs@gnu.org; Thu, 21 Jan 2016 12:42:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aMJFC-0002fC-2R for bug-gnu-emacs@gnu.org; Thu, 21 Jan 2016 12:42: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: Thu, 21 Jan 2016 17:42: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.145339807610177 (code B ref 22404); Thu, 21 Jan 2016 17:42:02 +0000 Original-Received: (at 22404) by debbugs.gnu.org; 21 Jan 2016 17:41:16 +0000 Original-Received: from localhost ([127.0.0.1]:56670 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMJES-0002e5-7t for submit@debbugs.gnu.org; Thu, 21 Jan 2016 12:41:16 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:38286) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMJEQ-0002ds-RT for 22404@debbugs.gnu.org; Thu, 21 Jan 2016 12:41:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMJEI-0003RT-Gn for 22404@debbugs.gnu.org; Thu, 21 Jan 2016 12:41:09 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49210) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMJEI-0003RP-Ds; Thu, 21 Jan 2016 12:41:06 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4445 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aMJEH-0004ql-QU; Thu, 21 Jan 2016 12:41:06 -0500 In-reply-to: (message from Keith David Bershatsky on Wed, 20 Jan 2016 18:32:40 -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:111831 Archived-At: > Date: Wed, 20 Jan 2016 18:32:40 -0800 > From: Keith David Bershatsky > Cc: 22404@debbugs.gnu.org > > `set-window-start` (without the third option) would indeed trigger the WSF because it contains a key ingredient: `w->force_start = true`. > > Because the second argument (i.e., POS) cannot be known from the PCH when point has moved beyond the visible window, `set-window-start` is not a viable substitute for this feature request. Then I'm afraid I must insist on understanding your needs better. I still don't, not even after re-reading your description several times. Maybe you could describe your use case from a different perspective: instead of telling how you tried to make sure window-scroll-functions are run exactly once, perhaps try to describe the problem for which you needed to invoke window-scroll-functions in the first place. After all, window-scroll-functions is just the means towards some specific goal. And I don't think I understand the goal. Once you described what you are trying to accomplish, it might be easier to understand how you arrived at window-scroll-functions and the need to run them when you do. > The attached patch is an example of an implementation of this feature request. I created a new function called `force-wsf`, whose sole purpose is to trigger the WSF to run during redisplay -- after the PCH has already finished. As noted in a previous e-mail, `run-window-scroll-functions` doesn't accomplish what `force-wsf` can achieve because the former runs the function attached to the WSF immediately -- instead of waiting until later on during redisplay when the correct values of `window-start` and `window-end` are ascertainable. I'd prefer to understand the need before we discuss the implementation. > I would, however, still like to come up with a test at the C-source code level that tells me whether the WSF will run more than one time I think this is fundamentally impossible. But I didn't yet take a good enough look at the involved code, so maybe I'm missing something. Thanks.