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.devel Subject: Re: Pixel scrolling support Date: Fri, 26 Nov 2021 10:35:02 +0200 Message-ID: <83y25b2u2x.fsf@gnu.org> 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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34086"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 26 09:36:22 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 1mqWiT-0008de-JI for ged-emacs-devel@m.gmane-mx.org; Fri, 26 Nov 2021 09:36:21 +0100 Original-Received: from localhost ([::1]:42460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mqWiS-0002ty-AY for ged-emacs-devel@m.gmane-mx.org; Fri, 26 Nov 2021 03:36:20 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46642) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqWhA-0001J5-VC for emacs-devel@gnu.org; Fri, 26 Nov 2021 03:35:00 -0500 Original-Received: from [2001:470:142:3::e] (port=49040 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqWhA-00064F-Ce; Fri, 26 Nov 2021 03:35:00 -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=SBmvuNV9xj21ZaVkWWQF4qD/fsJSgHz+BKnloXbI4o0=; b=frK0FUWGVkJx QqbYdKIf315IZN4/ug8wlxQnnQ9tOvdvaOqo/zAb7iqjHbZMksbf9K2G2d2Vr+6hc4xCwBzucL2Bp L5Tiq5c43VWZCXwqj0uPoigmtkERck44fpfbWzPfbHQCJScMCD/MvJ9MhBY03c20yYyJEo5HSWqhJ dlKekA8I3oyKOWRpPdrsABkg1ZNPO7+QBD5ri2APGgrLXN67N/lC4YHA19BfmdiBTD7Yo1t81ZjuW kuwMuReuDGSSFcrkvoXqPW8pvYuqkFx2OFDjbPpcGb0ZD8+s7jsdBXjXJcLatcySQObN+s2ASh9FL +01/PD9Eu/wpeAOVFe4zfA==; Original-Received: from [87.69.77.57] (port=2562 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 1mqWh9-0005uM-CL; Fri, 26 Nov 2021 03:34:59 -0500 In-Reply-To: <87sfvjfli2.fsf@yahoo.com> (message from Po Lu on Fri, 26 Nov 2021 15:01:57 +0800) 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:280210 Archived-At: > From: Po Lu > Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org > Date: Fri, 26 Nov 2021 15:01:57 +0800 > > > Separate mode should be fine, but we need a good name for it ("better > > pixel scroll" is not a good name). > > Thanks, how about `pixel-scroll-precise-mode'? pixel-scroll-precision-mode sounds better to me. > -** New minor mode 'better-pixel-scroll-mode'. > +** New minor mode 'pixel-scroll-precise-mode'. > When enabled, using this mode with a capable scroll wheel will result > in the display being scrolled precisely according to the turning of > that wheel. This text doesn't really describe what the mode does. It basically says something like "pixel-scroll-precise-mode scrolls precisely". the main part that was left unexplained is "according to the turning of that wheel", and specifically the "according" part. > +(defun pixel-scroll-precise-scroll-down (delta) > + "Scroll the current window down by DELTA pixels. > +Note that this function doesn't work if DELTA is larger than > +the height of the current window." What is the problem with scrolling by more than the window's height? > + (when (eobp) > + (error "End of buffer"))) I think you should detect the EOB condition early on and simply not scroll at all in that case. > +(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. > +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. > +ARG is passed to `mwheel-scroll', should that be called." Likewise: the description of ARG should be similar to how we describe the effect of prefix arg in other similar commands. > +;;;###autoload > +(define-minor-mode pixel-scroll-precise-mode > + "Toggle pixel scrolling. > +When enabled, this minor mode allows to scroll the display > +precisely, according to the turning of the mouse wheel." Shouldn't this say something about "setting the variable doesn't have any effect"? And what about horizontal scrolling? Thanks.