From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#61307: 30.0.50; pixel-scroll-precision-mode: window-scroll-functions? Date: Tue, 14 Feb 2023 15:06:36 +0200 Message-ID: <83edqse6qr.fsf@gnu.org> References: <87y1pbsgu5.fsf@web.de> <83h6vzq9at.fsf@gnu.org> <878rhascr8.fsf@web.de> <83wn4ngjvp.fsf@gnu.org> <875yc6cnmk.fsf@web.de> <83mt5ifdhn.fsf@gnu.org> <87o7pyb556.fsf@web.de> <83k00lg1ve.fsf@gnu.org> <873579jaot.fsf@web.de> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1753"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61307@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 14 14:08:18 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pRv2f-0000Hq-VL for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 14 Feb 2023 14:08:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRv2S-0004YJ-TO; Tue, 14 Feb 2023 08:08:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRv2R-0004Y9-6h for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 08:08:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRv2Q-0000Lt-U6 for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 08:08:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pRv2Q-000076-Hv for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 08:08: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, 14 Feb 2023 13:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61307 X-GNU-PR-Package: emacs Original-Received: via spool by 61307-submit@debbugs.gnu.org id=B61307.1676380035346 (code B ref 61307); Tue, 14 Feb 2023 13:08:02 +0000 Original-Received: (at 61307) by debbugs.gnu.org; 14 Feb 2023 13:07:15 +0000 Original-Received: from localhost ([127.0.0.1]:52851 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRv1b-00005S-E5 for submit@debbugs.gnu.org; Tue, 14 Feb 2023 08:07:15 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53078) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRv1U-0008WQ-PT for 61307@debbugs.gnu.org; Tue, 14 Feb 2023 08:07:09 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRv1P-0000AX-Hv; Tue, 14 Feb 2023 08:06:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=lOtAF/HG5IJrQUA0zYgNUtoS7aq0L6Zx/on0CS366EA=; b=jiA86QEnmx8v S5qiLEDgEZ4cU18VdrQtdIu7saWXy7cjhwrh7cpLP59rb79Ff/GmP8ESbfiD+MXrIJmsvQ84YVqSD 2yLwQIFWEIcO1oQI8z3isLR2m4Dz4oRiC/z6L5GnsqmXER/wWpAxXjjPWROk/6y708DZPzPx/lAQn 4ofo98sAoY29j/CHZxZ4qqmk2y1SCj7t6tsD/GyTC2FbrDwBcNMrfFzh5GXMyZr09UwO65OiU2ryK 89fQC2TElLTA8zkfLymz+bvzov2n9LeFEx50cWXR1+mVGheRxxJrE8vJBOiKIzpU5BAgDVwXEpauP xxNpkhlhLvlgLlZAYTaFpA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRv1O-00019W-CE; Tue, 14 Feb 2023 08:06:59 -0500 In-Reply-To: <873579jaot.fsf@web.de> (message from Michael Heerdegen on Tue, 14 Feb 2023 02:30:10 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:255573 Archived-At: > From: Michael Heerdegen > Cc: 61307@debbugs.gnu.org > Date: Tue, 14 Feb 2023 02:30:10 +0100 > > > Because you might make scrolling much slower if you call the scroll > > functions every pixel. > > Sorry that I repeat myself, but I don't understand why that would > happen. This is what I tried: > > *** /tmp/ediffnuE8b2 2023-02-14 02:24:24.300444006 +0100 > --- /home/micha/software/emacs/lisp/pixel-scroll.el 2023-02-14 02:20:40.472154353 +0100 > *************** > *** 725,731 **** > (beginning-of-buffer > (message (error-message-string '(beginning-of-buffer)))) > (end-of-buffer > ! (message (error-message-string '(end-of-buffer)))))))))) > (mwheel-scroll event nil)))) > > (defun pixel-scroll-kinetic-state (&optional window) > --- 725,733 ---- > (beginning-of-buffer > (message (error-message-string '(beginning-of-buffer)))) > (end-of-buffer > ! (message (error-message-string '(end-of-buffer)))))) > ! (run-hook-with-args 'window-scroll-functions > ! (selected-window) (window-start)))))) > (mwheel-scroll event nil)))) > > (defun pixel-scroll-kinetic-state (&optional window) > > I don't see the hook called for each pixel. What do you mean? Each time you do the smallest possible scroll, by how many pixels, or by what fraction of the screen-line's height does Emacs scroll the window? IOW, by how many pixels is the display scrolled for each call to window-scroll-functions? Precision pixel-scrolling supports many different devices (mice and touch-pads), which can scroll at very different resolutions. The possibility that window-scroll-functions be called too frequently depends on what exactly do your device and your Emacs build support in this scenario, and I don't yet have a clear idea about that, since you didn't tell. > A second thing I wonder about: the docstring of > `window-scroll-functions' says: > > | These functions are called whenever the `window-start' marker is modified, > | either to point into another buffer (e.g. via `set-window-buffer') or another > | place in the same buffer. > > Is this correct and complete? More or less. (I don't like how it explains this stuff by using internal implementation detail, but I cannot think of a better explanation that is still accurate enough.) > Is the window-start marker modified in our scenario? Not in the way that the "usual" scrolling commands do. This mode uses non-nil 3rd argument to set-window-start. So the display engine doesn't know that the window is scrolled.