From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: Pixel scrolling support Date: Fri, 26 Nov 2021 19:38:10 +0800 Message-ID: <87bl27f8pp.fsf@yahoo.com> References: <87a6hrzrcv.fsf.ref@yahoo.com> <87a6hrzrcv.fsf@yahoo.com> <87v90fhayx.fsf@yahoo.com> <835ysf4dyr.fsf@gnu.org> <871r33h0th.fsf@yahoo.com> <8335nj4d53.fsf@gnu.org> <87sfvjfli2.fsf@yahoo.com> <83y25b2u2x.fsf@gnu.org> <87k0gvfeoa.fsf@yahoo.com> <83sfvj2m51.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18417"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 26 12:39:42 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mqZZt-0004Wx-JG for ged-emacs-devel@m.gmane-mx.org; Fri, 26 Nov 2021 12:39:41 +0100 Original-Received: from localhost ([::1]:56384 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mqZZr-0004wD-FV for ged-emacs-devel@m.gmane-mx.org; Fri, 26 Nov 2021 06:39:39 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqZYc-0004Cx-Tr for emacs-devel@gnu.org; Fri, 26 Nov 2021 06:38:23 -0500 Original-Received: from sonic313-56.consmr.mail.ne1.yahoo.com ([66.163.185.31]:34683) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mqZYa-00050B-9n for emacs-devel@gnu.org; Fri, 26 Nov 2021 06:38:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1637926698; bh=YSg56zk/Xv5+bQokFWhRNnICQig86BAlKTrTE82wkgg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=X7ZNd2I4s09LMXJjHmvYvRbOu3TQEyigot/5ICQmalC1JsJ+eOJxPEaDyV7ERYhsN0/Ki+B/3Tm0HwL37YOfy/BNAjrlaE6uLrsp/75HamEZ2JIMNYqVI1S2D7hO0LPcRlH9iNM0F72PfS5nvkmqW6jJXbQZIa/cQAmbTqvDbD7zqVhvQt+UK3eLPdII4b/o4h+eGwoP4tuOZQ68c6BtPPxywptIt7ONgAW2o8pZYcoY8Jqe4F4Xv/25CfYTKTwuXBFdxI7DQfl3yrZ3dHGgvtGz1o39ajwUKKewzjWcb6MQ7nXSbKrvObzHkZWIvmu9WMjxfOJBYEvUBo5a4uCX5g== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1637926698; bh=OmJ5gN2VwZNhg5vIF7IRXXbkQzfkCy5UbmNXLDka3MX=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=GaQvkdLFRPUJLbS2QChQsRo2eeH5oy3LgBWkTMzAthZi/kaHypqk8AvYu+wrniwXWA70W3FlKt/zgkYcYuuAVG5YP9ec2rXxE0TYvq0YiCWRil4OkUXgYwNcVoQfU9UzGolRk5j/d4ykF4UoO0K0C4zDTulKdfIAhuCz3nLbCJkEo/x0B2n7cZ+CWhcINpxIL3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.mail.ne1.yahoo.com with HTTP; Fri, 26 Nov 2021 11:38:18 +0000 Original-Received: by kubenode510.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID db5e894400e51acdf8547adc5d80f4c2; Fri, 26 Nov 2021 11:38:15 +0000 (UTC) In-Reply-To: <83sfvj2m51.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 26 Nov 2021 13:26:34 +0200") X-Mailer: WebService/1.1.19306 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.185.31; envelope-from=luangruo@yahoo.com; helo=sonic313-56.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:280219 Archived-At: Eli Zaretskii writes: > That name tells me that the _mode_ is "precise", but that's not what you > want to convey. The scrolling is precise, not the mode. > > An alternative would be something like pixel-scroll-smoothly-mode. Hmm, reasonable, "precision" makes sense now. >> How about this: "When enabled, you can scroll the display up or down by >> individual pixels in a way that corresponds with the movement of your >> mouse wheel, if supported by the mouse wheel."? > "By individual pixels" is not really accurate, is it? Maybe "at pixel > resolution". And now the question becomes "how is this different from > pixel-scroll-mode"? Which is a good question regardless of NEWS, btw. pixel-scroll-mode still scrolls by lines, it just tries to animate each line movement. It's very unpleasant to use that with a precision scroll wheel. >> Basically, we use `posn-at-x-y' to find the window start and the vscroll >> that's wanted, which doesn't work when y is outside the window. > Did you try to use vertical-motion to help you? Or maybe I don't > understand the problem, since the vertical dimensions of a window are > known in pixels, so what exactly is the problem to determine the > window start when it is outside of the window? scroll-down-command > does that without any problems. I use `posn-at-x-y' to determine the position closest to the first line to be displayed on screen after the window is vscrolled by DELTA. Afterwards, I set the window start to that position, and set the vscroll to the object Y in the position list that is returned, which contains the number of pixels that are still left after window start has been adjusted. I don't see how `vertical-motion' could help. >> > I think you should detect the EOB condition early on and simply not >> > scroll at all in that case. >> >> I couldn't find a way to know if scrolling will result in EOB before it >> actually happens. > Did you try using pos-visible-in-window-p with POS argument passed as > t? But that doesn't take into account the delta by which the window is being scrolled, right? >> >> +(defun pixel-scroll-precise (event &optional arg) >> >> + "Scroll the display according to EVENT. >> >> > This sentence should include something to indicate the "precise" >> > feature. Otherwise it is too general, indistinguishable from any >> > other scroll command. >> >> Hmm, how about "Scroll the display by pixels according to EVENT"? > > Better. > >> >> +Take into account any pixel deltas in EVENT to scroll the display >> >> +according to the user's turning the mouse wheel. If EVENT does >> >> +not have precise scrolling deltas, call `mwheel-scroll' instead. >> >> > This describes what the code does, not what the user should expect in >> > terms of the effect on the screen. >> >> "Scroll the display vertically by pixels according to EVENT. >> Move the display up or down by the pixel deltas in EVENT to >> scroll the display according to the user's turning the mouse >> wheel." >> >> How's this instead? > Where did the "call `mwheel-scroll'" part disappear? If it was > important to say that, why there's no reflection of that in the new > text? As ARG is gone, I don't think it's important to mention that `mwheel-scroll' is called anymore. > I'm asking why don't we support pixel-resolution horizontal scrolling > in this mode, although the underlying infrastructure does report > pixel-resolution mouse-wheel rotation in the horizontal direction? AFAIU, redisplay doesn't support pixel-resolution hscroll, so while wheel rotation is reported in that direction, there is no way to scroll the display horizontally in a pixel-wise fashion. Thanks in advance.