Subject: bug#11680: flyspell should use mouse-3 instead of mouse-2

From: Stefan Kangas <[email-masked]>
Date: Fri, 01 Nov 2019 19:21:35 +0100

Le Wang <[email-masked]> writes:

> This makes sense because it's a context menu which is mouse-3 in
> modern UIs.
>
> See Stefan's answer here:
> http://stackoverflow.com/questions/10973000/emacs-23-4-mouse-2-behaviour-on-os-x-10-7

So Stefan writes at the link: "Rather flyspell needs to be fixed to
pop up its menu on mouse-3 since it's really more like a context
menu. I.e. I recommend a M-x report-emacs-bug about it."

I agree with this.  Any objections to the attached patch?

Best regards,
Stefan Kangas

>From f9b06855b129f4472908893d411d70b20fd0edfe Mon Sep 17 00:00:00 2001
From: Stefan Kangas <[email-masked]>
Date: Thu, 31 Oct 2019 02:15:56 +0100
Subject: [PATCH] Move flyspell-correct-word to mouse-3

* lisp/textmodes/flyspell.el (flyspell-mouse-map): Bind
'flyspell-correct-word' to 'mouse-3' instead of 'mouse-2'.
(Bug#11680)

* doc/emacs/fixit.texi (Spelling): Document it.
* etc/NEWS: Announce it.
---
 doc/emacs/fixit.texi       | 2 +-
 etc/NEWS                   | 9 +++++++++
 lisp/textmodes/flyspell.el | 2 +-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/doc/emacs/fixit.texi b/doc/emacs/fixit.texi
index fc610583c8..90110e5b41 100644
--- a/doc/emacs/fixit.texi
+++ b/doc/emacs/fixit.texi
@@ -441,7 +441,7 @@ Spelling
 @findex flyspell-auto-correct-word
 @findex flyspell-correct-word-before-point
   When Flyspell mode highlights a word as misspelled, you can click on
-it with @kbd{mouse-2} (@code{flyspell-correct-word}) to display a menu
+it with @kbd{mouse-3} (@code{flyspell-correct-word}) to display a menu
 of possible corrections and actions.  In addition, @kbd{C-.} or
 @kbd{@key{ESC}-@key{TAB}} (@code{flyspell-auto-correct-word}) will
 propose various successive corrections for the word at point, and
diff --git a/etc/NEWS b/etc/NEWS
index cd1e46bb87..21c118e6ae 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2197,6 +2197,15 @@ file-local variable, you may need to update the value.
 *** Declare 'define-overload' and 'define-child-mode' as obsolete
 *** Rename several internal functions to use a ''mode-local-' prefix
 
++++
+** Flyspell mode
+
+*** Corrections and actions menu is now bound to mouse-3.
+When Flyspell mode highlights a word as misspelled, you can click on
+it to display a menu of possible corrections and actions.  This was
+previously bound to mouse-2 (usually the middle mouse button), but has
+now been moved to mouse-3 (usually the right mouse button).
+
 
 * New Modes and Packages in Emacs 27.1
 
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index ce788207cf..36da29b6ac 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -460,7 +460,7 @@ flyspell-prog-mode
 ;;*---------------------------------------------------------------------*/
 (defvar flyspell-mouse-map
   (let ((map (make-sparse-keymap)))
-    (define-key map [mouse-2] 'flyspell-correct-word)
+    (define-key map [mouse-3] 'flyspell-correct-word)
     map)
   "Keymap for Flyspell to put on erroneous words.")
 
-- 
2.20.1