all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: charles@aurox.ch (Charles A. Roelli)
To: Alan Third <alan@idiocy.org>
Cc: homeros.misasa@gmail.com, emacs-devel@gnu.org
Subject: Re: Smoother macOS touchpad scrolling
Date: Mon, 18 Sep 2017 22:19:30 +0200	[thread overview]
Message-ID: <m2fubjn4j1.fsf@aurox.ch> (raw)
In-Reply-To: <20170918190337.GA16455@breton.holly.idiocy.org> (message from Alan Third on Mon, 18 Sep 2017 20:03:37 +0100)

> Authentication-Results: sinyavsky.aurox.ch (amavisd-new); 	dkim=pass (2048-bit key) header.d=googlemail.com
> Date: Mon, 18 Sep 2017 20:03:37 +0100
> From: Alan Third <alan@idiocy.org>
> Cc: homeros.misasa@gmail.com, emacs-devel@gnu.org
> Content-Type: text/plain; charset=utf-8
> Content-Disposition: inline
> 
> 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?
> 
> You’re right.
> 
> Can you confirm that this doesn’t return true on 10.6?
> 
> (let ((appkit-version (progn (string-match "^appkit-\\([^\s-]*\\)"
>                               ns-version-string)
>                              (match-string 1 ns-version-string))))
>   (>= (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.
 
> > > +(when (featurep 'cocoa)
> > > +  (setq mouse-wheel-scroll-amount '(1 ((shift) . 5) ((control))))
> > > +  (setq mouse-wheel-progressive-speed nil))
> > 
> > Also, won't these variable changes make Customize report that their
> > values were "changed outside Customize"?
> 
> I have absolutely no idea...
> 
> Customize is something I’ve largely done my best to avoid, so I don’t
> know how I should go about setting them in a way that’s friendly to
> it.
> 
> Something like this?
> 
> (let ((appkit-version (progn
>                         (string-match "^appkit-\\([^\s-]*\\)" ns-version-string)
>                         (match-string 1 ns-version-string))))
>   (when (and (featurep 'cocoa) (>= (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))))
>     
>     (setq mouse-wheel-progressive-speed nil)
>     (put 'mouse-wheel-progressive-speed 'customized-value
>          (list (custom-quote (symbol-value 'mouse-wheel-progressive-speed))))))
> 
> 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) (>= (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 ‘defcustom’.  If the variable
     was customized, this function re-evaluates the saved value instead.
     Then it sets the user option to that value (using the option’s
     ‘:set’ 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.



  reply	other threads:[~2017-09-18 20:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-08 18:46 Smoother macOS touchpad scrolling Alan Third
2017-09-08 22:21 ` Tak Kunihiro
2017-09-09  8:18   ` Alan Third
2017-09-10  1:20     ` Tak Kunihiro
2017-09-10  8:37       ` Alan Third
2017-09-11 18:09         ` Alan Third
2017-09-12  1:54           ` James Nguyen
2017-09-12 17:03             ` Alan Third
2017-09-12 23:13           ` Tak Kunihiro
2017-09-13 16:26             ` Better macOS scrolling (was: Smoother macOS touchpad scrolling) Alan Third
2017-09-13 22:52               ` Better macOS scrolling Tak Kunihiro
2017-09-16 22:33         ` Smoother macOS touchpad scrolling Alan Third
2017-09-18 18:10           ` Charles A. Roelli
2017-09-18 18:57             ` Charles A. Roelli
2017-09-18 19:03             ` Alan Third
2017-09-18 20:19               ` Charles A. Roelli [this message]
2017-09-19 19:12                 ` Alan Third

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2fubjn4j1.fsf@aurox.ch \
    --to=charles@aurox.ch \
    --cc=alan@idiocy.org \
    --cc=emacs-devel@gnu.org \
    --cc=homeros.misasa@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.