Subject: bug#39979: 28.0.50; `mouse-wheel-tilt-scroll' docstring is unclear/incomplete

From: Göktuğ Kayaalp <[email-masked]>
Date: Tue, 10 Mar 2020 19:39:43 +0300

On 2020-03-09 10:02 +01, martin rudalics <[email-masked]> wrote:
>  > A patch is attached which is proposed as a tentative improvement. If
>  > it’s good enough to apply, I do have my copyright assingment paperwork
>  > done so it can be committed right away.
>
> Thanks for looking into this.  But
>
> -  "Enable scroll using tilting mouse wheel."
> +  "Enable horizontal scrolling via mouse or touchpad. Also see
> +  ‘mouse-wheel-flip-direction’."
>
> violates the rule from D.6 of the Elisp manual:
>
>   The first line of the documentation string should consist of one or
>       two complete sentences that stand on their own as a summary.

New patch added, with some improvement to the ‘...-flip-direction’
variable too.

> Also, 'mouse-wheel-flip-direction' does not have a great doc-string
> either.  Maybe we should add a reference to section 21.1 of the Emacs
> manual?

There is this, assuming you meant "(emacs) Mouse Commands":

,----
|    Emacs can also support horizontal scrolling if your mouse’s wheel can
| be tilted.  This feature is off by default; the variable
| ‘mouse-wheel-tilt-scroll’ turns it on.  If you’d like to reverse the
| direction of horizontal scrolling, customize the variable
| ‘mouse-wheel-flip-direction’ to a non-‘nil’ value.
`----

I think a little mention of touchpads would suffice.  The added patch
addresses this too.

Cheers,

        -gk.

P.S. I never know if it’s better to send Debbugs patches inline or as
attachments.  Sorry if I’m doing the wrong thing.

>From 66906d5a680f61528ae1eaee1f101eecebd5a0aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=B0=2E=20G=C3=B6ktu=C4=9F=20Kayaalp?= <[email-masked]>
Date: Sun, 8 Mar 2020 00:15:01 +0300
Subject: [PATCH] Improve docs for horizontal scrolling with mouse and touchpad

* lisp/mwheel.el (mouse-wheel-tilt-scroll,
mouse-wheel-flip-direction): Improve docstrings.
* doc/emacs/frames.texi (Mouse Commands): Mention touchpads.
---
 doc/emacs/frames.texi | 9 +++++----
 lisp/mwheel.el        | 7 +++++--
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi
index 002297c259..16205e6e0c 100644
--- a/doc/emacs/frames.texi
+++ b/doc/emacs/frames.texi
@@ -217,10 +217,11 @@ Mouse Commands
 @vindex mouse-wheel-tilt-scroll
 @vindex mouse-wheel-flip-direction
 Emacs can also support horizontal scrolling if your mouse's wheel can
-be tilted.  This feature is off by default; the variable
-@code{mouse-wheel-tilt-scroll} turns it on.  If you'd like to reverse
-the direction of horizontal scrolling, customize the variable
-@code{mouse-wheel-flip-direction} to a non-@code{nil} value.
+be tilted, or your touchpad supports it.  This feature is off by
+default; the variable @code{mouse-wheel-tilt-scroll} turns it on.  If
+you'd like to reverse the direction of horizontal scrolling, customize
+the variable @code{mouse-wheel-flip-direction} to a non-@code{nil}
+value.
 
 When the mouse pointer is over an image, scrolling the mouse wheel
 with the @key{Ctrl} modifier scales the image under the mouse pointer.
diff --git a/lisp/mwheel.el b/lisp/mwheel.el
index 56150c803f..41ae3769c1 100644
--- a/lisp/mwheel.el
+++ b/lisp/mwheel.el
@@ -145,13 +145,16 @@ mouse-wheel-follow-mouse
 ;;; For tilt-scroll
 ;;;
 (defcustom mouse-wheel-tilt-scroll nil
-  "Enable scroll using tilting mouse wheel."
+  "Enable horizontal scrolling via mouse or touchpad.
+Also see ‘mouse-wheel-flip-direction’."
   :group 'mouse
   :type 'boolean
   :version "26.1")
 
 (defcustom mouse-wheel-flip-direction nil
-  "Swap direction of `wheel-right' and `wheel-left'."
+  "Swap direction of `wheel-right' and `wheel-left'.
+This inverts the direction of horizontal scrolling. Also see
+`mouse-wheel-tilt-scroll'."
   :group 'mouse
   :type 'boolean
   :version "26.1")
-- 
2.20.1