[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pixel scrolling support

From: Stefan Monnier
Subject: Re: Pixel scrolling support
Date: Thu, 25 Nov 2021 21:26:41 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Po Lu [2021-11-26 08:35:12] wrote:
> I would like to install the following file:

Looks OK to me, tho I wonder why you'd want to use a separate file
rather than add this directly in `mwheel.el`.

Also, see a few more comments below.


> (defvar better-pixel-scroll-mode-map (make-sparse-keymap)
>   "The key map used by `better-pixel-scroll-mode'.")
> (define-key better-pixel-scroll-mode-map [wheel-down] #'better-pixel-scroll)
> (define-key better-pixel-scroll-mode-map [wheel-up] #'better-pixel-scroll)

Please combine this into

(defvar better-pixel-scroll-mode-map
  (let ((map (make-sparse-keymap)))
    (define-key map [wheel-down] #'better-pixel-scroll)
    (define-key map [wheel-up] #'better-pixel-scroll)
  "The key map used by `better-pixel-scroll-mode'.")

Or better yet use `defvar-keymap`.

> ;;;###autoload
> (define-minor-mode better-pixel-scroll-mode
>   "Toggle pixel scrolling.
> When enabled, this minor mode allows to scroll the display
> precisely, according to the turning of the mouse wheel."
>   :global t
>   :group 'mouse
>   :keymap better-pixel-scroll-mode-map
>   (setq x-coalesce-scroll-events
>         (not better-pixel-scroll-mode)))

The `:keymap` arg is redundant.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]