From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: charles@aurox.ch (Charles A. Roelli) Newsgroups: gmane.emacs.devel Subject: Re: Smoother macOS touchpad scrolling Date: Mon, 18 Sep 2017 22:19:30 +0200 Message-ID: References: <20170908184634.GA20058@breton.holly.idiocy.org> <86y3pox258.fsf@misasa.okayama-u.ac.jp> <20170909081805.GA20275@breton.holly.idiocy.org> <86ingrl56v.fsf@misasa.okayama-u.ac.jp> <20170910083758.GA30315@breton.holly.idiocy.org> <20170916223317.GA58067@breton.holly.idiocy.org> <20170918190337.GA16455@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1505766038 20874 195.159.176.226 (18 Sep 2017 20:20:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 18 Sep 2017 20:20:38 +0000 (UTC) Cc: homeros.misasa@gmail.com, emacs-devel@gnu.org To: Alan Third Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 18 22:20:32 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1du2Wu-000592-E3 for ged-emacs-devel@m.gmane.org; Mon, 18 Sep 2017 22:20:32 +0200 Original-Received: from localhost ([::1]:38754 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1du2X1-0006ol-IO for ged-emacs-devel@m.gmane.org; Mon, 18 Sep 2017 16:20:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1du2WI-0006oV-GV for emacs-devel@gnu.org; Mon, 18 Sep 2017 16:19:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1du2WE-0002n5-H6 for emacs-devel@gnu.org; Mon, 18 Sep 2017 16:19:54 -0400 Original-Received: from [2a03:2040:2:1b::1] (port=49662 helo=sinyavsky.aurox.ch) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1du2WE-0002ln-5y for emacs-devel@gnu.org; Mon, 18 Sep 2017 16:19:50 -0400 Original-Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id BAE7422544 for ; Mon, 18 Sep 2017 20:13:32 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= content-transfer-encoding:content-type:content-type:mime-version :references:subject:subject:in-reply-to:to:from:from:message-id :date:date; s=dkim; t=1505765610; x=1506629611; bh=vXxozQOQjYeKc ETFnUvwvwL2LSmzKTl75MGSieHkay4=; b=QGqwXDyuKBpbWWSNPxO7SB8zZgteN 9N/ANd1yd5tK1nV9fp0dEKiMeRdxjAYt3BXJvDkA47GM5VsY8Kd9TQ1ltugHTDRf 0RFM/KYmEZdD7NyJaY7iSDN6j31ghKnUOTuxJhfN71yZ5qdIgHTCPkyO1xGEvixO wc7QVABXlo242U= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Original-Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id bXFK0f6crng0 for ; Mon, 18 Sep 2017 20:13:30 +0000 (UTC) Original-Received: from gray (125.85.192.178.dynamic.wline.res.cust.swisscom.ch [178.192.85.125]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id 26F3222531; Mon, 18 Sep 2017 20:13:29 +0000 (UTC) In-reply-to: <20170918190337.GA16455@breton.holly.idiocy.org> (message from Alan Third on Mon, 18 Sep 2017 20:03:37 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a03:2040:2:1b::1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:218490 Archived-At: > Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=3Dpass = (2048-bit key) header.d=3Dgooglemail.com > Date: Mon, 18 Sep 2017 20:03:37 +0100 > From: Alan Third > Cc: homeros.misasa@gmail.com, emacs-devel@gnu.org > Content-Type: text/plain; charset=3Dutf-8 > Content-Disposition: inline >=20 > On Mon, Sep 18, 2017 at 08:10:59PM +0200, Charles A. Roelli wrote: > > With macOS 10.6, I haven't found Emacs scrolling with the touchpad to > > be too unusual, maybe just a bit clunky. Wouldn't the following code > > also affect 10.6? >=20 > You=E2=80=99re right. >=20 > Can you confirm that this doesn=E2=80=99t return true on 10.6? >=20 > (let ((appkit-version (progn (string-match "^appkit-\\([^\s-]*\\)" > ns-version-string) > (match-string 1 ns-version-string)))) > (>=3D (string-to-number appkit-version) 1138)) Yes, it returns nil. I think this check (or maybe a function that returns the appkit version as an integer) could be added to ns-win.el. =20 > > > +(when (featurep 'cocoa) > > > + (setq mouse-wheel-scroll-amount '(1 ((shift) . 5) ((control)))) > > > + (setq mouse-wheel-progressive-speed nil)) > >=20 > > Also, won't these variable changes make Customize report that their > > values were "changed outside Customize"? >=20 > I have absolutely no idea... >=20 > Customize is something I=E2=80=99ve largely done my best to avoid, so I= don=E2=80=99t > know how I should go about setting them in a way that=E2=80=99s friendl= y to > it. >=20 > Something like this? >=20 > (let ((appkit-version (progn > (string-match "^appkit-\\([^\s-]*\\)" ns-versio= n-string) > (match-string 1 ns-version-string)))) > (when (and (featurep 'cocoa) (>=3D (string-to-number appkit-version) = 1138)) > (setq mouse-wheel-scroll-amount '(1 ((shift) . 5) ((control)))) > (put 'mouse-wheel-scroll-amount 'customized-value > (list (custom-quote (symbol-value 'mouse-wheel-scroll-amount))= )) > =20 > (setq mouse-wheel-progressive-speed nil) > (put 'mouse-wheel-progressive-speed 'customized-value > (list (custom-quote (symbol-value 'mouse-wheel-progressive-spe= ed)))))) >=20 > It looks pretty messy. We could also make the defcustoms in mwheel.el look something like this: (defcustom mouse-wheel-scroll-amount (cond ((and (featurep 'cocoa) (>=3D (ns-appkit-version) 1138)) '(1 ((shift) . 5) ((control) . nil))) (t '(5 ((shift) . 1) ((control) . nil)))) ... instead of: (defcustom mouse-wheel-scroll-amount '(5 ((shift) . 1) ((control) . nil))= ... Then in ns-win.el we could do: (custom-reevaluate-setting 'mouse-wheel-scroll-amount) See also, Info node "(elisp) Variable Definitions": -- Function: custom-reevaluate-setting symbol This function re-evaluates the standard value of SYMBOL, which should be a user option declared via =E2=80=98defcustom=E2=80=99. I= f the variable was customized, this function re-evaluates the saved value instead. Then it sets the user option to that value (using the option=E2=80=99= s =E2=80=98:set=E2=80=99 property if that is defined). This is useful for customizable options that are defined before their value could be computed correctly. For example, during startup Emacs calls this function for some user options that were defined in pre-loaded Emacs Lisp files, but whose initial values depend on information available only at run-time. I /think/ this is the right thing to do, but if any Customize experts can weigh in, that would be great.