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: Fixing precision scrolling in terminal buffers Date: Mon, 27 Dec 2021 17:14:29 +0800 Message-ID: <87zgomz9xm.fsf@yahoo.com> References: <87mtkm1tzq.fsf.ref@yahoo.com> <87mtkm1tzq.fsf@yahoo.com> <068b41819a06bade1b13ea97560a6d82@webmail.orcon.net.nz> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5160"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) Cc: emacs-devel@gnu.org To: Phil Sainty Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 27 10:15:33 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 1n1m6O-00016Y-U5 for ged-emacs-devel@m.gmane-mx.org; Mon, 27 Dec 2021 10:15:32 +0100 Original-Received: from localhost ([::1]:53420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n1m6N-0007rW-Ff for ged-emacs-devel@m.gmane-mx.org; Mon, 27 Dec 2021 04:15:31 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1m5c-0007BI-Ph for emacs-devel@gnu.org; Mon, 27 Dec 2021 04:14:45 -0500 Original-Received: from sonic306-20.consmr.mail.ne1.yahoo.com ([66.163.189.82]:40322) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n1m5a-0003KR-VH for emacs-devel@gnu.org; Mon, 27 Dec 2021 04:14:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1640596480; bh=EaTQxkqWX3lXfPMkhcrb6DbngiHOKiOV3AtyZhvEnZU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=Rt6pUK9Bd2YM9hIjo6AcnQvA5ou0ak4Ag0LiEAKB60qgSdY9vEJ9F7i6PZS3KupGdXokBBCK7HdCCgPK0IHPdHGtPEGQVT7vpLKhdE+by5Rect6aHp9UZzFLv+88Ju6O+XuKvEOqt+WfX2nyRQbWnTG1CmFO61bazl3dqpup3XzykcXDtBIOGYiL5u8JPJbJ3HBNMlE62FhBINU8ufA7TB8R0UkRU7Tw+wvEPnL9TCU7au/fRSEV2wI7ofDWiiGLmLEPkKhUnhiq/DDXqfAM1R8DBBcTwy3On4L+O7JP5qkclVBlIg5ILqmscwp4pedYUDF4CgP7vKt43iHR2Alfdw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1640596480; bh=LkTF8I15NgC11khK7eqpYCBzac178OXiiv0E5vWSApE=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=cyRn6UwC75BF5RXuzSQGpqPIF3NlznNQqDdra3jOMj3EAH+86Q74BgDauVe3UL5weZpu7tLZ8Gkb7kQ6hB1qPRmJN6MsHWHX8fPwmHZSpTtg8yKkvUVg7YGywtoErRASDlSXMqBbj4TuxjScusEkVOct0N4W60tJyT5eRz5tyZtQ889Cwy+0pNBoyqaXWLrX6e2TQkBf0SMw1yzTCyvPhuY1WK3sfuJHcf1zHAXpsxDGEmmk0hgVWBSCvyPqaV8aDe9G4UUDDMzdjpNyHXRS6rhCuWwhv2hUOIuOuKJUJN3uvJMB1pc6TImkf1iiC+Uu4JHCM9OI3NPEnkSpzkfCqQ== X-YMail-OSG: m1TpIncVM1li16HsHr36piBCR2n8jYqPO_jWcORM9WFOdmW6Vv7RyUxUILU58gq oKEtcx3fC9oRwoGgZgMPMzh7CGEAF154sVq2xImq2gdb_gqGg4hMYXIcz0qhpvCrffTRrpbKcAIA FPXdMhA.QPbW9U6FXNyJf6iWeSruLREnmA43WUd3Y8zM2gzWlC2Pwaxc4kXPcjE9UPYEIOmgCfTE Lu2BzQfvnWFHqy.jjuSQ7XNeZ7cItPU8tT6w2izgc3mxhcmZi4IuVI.zQHp5xaMNphk4dTZndjog ETq4PbZkwpyc2OmKcZpEKo7nmi_jUSB3ZIU6oDHKihK1IQiQ8qxgqE3yyjwCrDjn_0TK9Z8DNUNS .Do4nvmHalYuMLlLD22TqY1nRDX11v8.biXZ3Pew5QZIKjk1ej483xMRh3TCKMMMYf8z7PTxomVA ZsAS4_5dIFDHGMDu4EnGkrPeQBqxrXWIsT_ZKz2YeiRvT0YZtfmemQWZZQBal6EUFlblF1DaYAEO L7XJGhc3BeAjMkeSEQW9RgMwZ3R64IohOFwSGUsKvyw0BLml1ga814mHCPNvfU3HtTfe0OeglEQL wCrWEFoIg9apfnKn9AF41U6hRpi4BLT8QeEK42uDYe1gjL8nxFdQt26iBQVE78W_Ul2QaCTKZQjX 5V.x3EQ4whJLr4WhYRH8KEwu4WnEenP47YFxQhzeBhJYTFh9RXVgso8xAvu8N0ubDV.jxwhT4_Ih 5upRMUtC.6fYwdypAutNyLnuMOgCqfCGR2fwejGSfjZQdGqWYXNuTXbYU1XQI3KfX5QqbfeWDVih rnlYLQKCUjYcEeJtAUGtSvbv0ASTRy0E7PjtzMD54R X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ne1.yahoo.com with HTTP; Mon, 27 Dec 2021 09:14:40 +0000 Original-Received: by kubenode515.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 346c0d8c5e7c5354b88183643506bc1e; Mon, 27 Dec 2021 09:14:35 +0000 (UTC) In-Reply-To: <068b41819a06bade1b13ea97560a6d82@webmail.orcon.net.nz> (Phil Sainty's message of "Mon, 27 Dec 2021 22:09:58 +1300") X-Mailer: WebService/1.1.19498 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.189.82; envelope-from=luangruo@yahoo.com; helo=sonic306-20.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:283404 Archived-At: Phil Sainty writes: > So some comments/questions: > > 1. It sounds like this change should actually use `mouse-wheel-up-event' > and `mouse-wheel-down-event'? The precision scrolling code doesn't work with mouse-4 and mouse-5 events, as they are only generated by ttys and the Core Input code, both of which don't provide pixel deltas. (The manual you want is the Lisp reference manual for Emacs 29: yours is too old to describe this.) > 2. Is the problem actually that `mouse-wheel-mode' isn't handling this > in terminals the way it does in GUIs? I'm not sure what's supposed > to happen -- I'm not sure I've ever used a mouse wheel when running > Emacs inside a terminal before now, but what I observe is that in a > *terminal* buffer the mouse wheel cycles the shell command history > in terminal frames, but scrolls the window in GUI frames. No, you have to turn on (for example) xterm-mouse-mode for the mouse wheel to work properly in supported terminals. My theory for why scrolling used to work is that the scroll functions force the window start, and post-command-hook is run before redisplay has a chance to, so it can't move the point outside the visible area without it being moved back in by redisplay. However, the precision scrolling code can't force start, as that resets vscroll. Thanks.