unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 11680@debbugs.gnu.org, l26wang@gmail.com
Subject: bug#11680: flyspell should use mouse-3 instead of mouse-2
Date: Thu, 16 Jan 2020 02:50:19 +0100	[thread overview]
Message-ID: <87d0bkyxt0.fsf@marxist.se> (raw)
In-Reply-To: <83k18ik971.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 02 Nov 2019 09:51:14 +0200")

[-- Attachment #1: Type: text/plain, Size: 1045 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> Eli Zaretskii <eliz@gnu.org> writes:
>> > This would be a backward-incompatible change, so we cannot just change
>> > it because someone asked for that.  I, for example, use that menu on
>> > mouse-2 all the time.
>> 
>> OK.  How about adding the mouse-3 key binding without removing the mouse-2 one?
>
> Fine with me, but that button is already bound to
> mouse-save-then-kill.  I never use it, but what will those who do say?

Since this key binding is only in flyspell-mouse-map, it will only be
rebound when the mouse pointer is over a misspelled word.  Note that
mouse-2 is normally bound to mouse-yank-primary.

I therefore don't think it will be a big problem in practice.  On the
contrary, I believe that having the context menu on the right mouse
button will feel more natural and be more discoverable to users.

I have attached an updated patch below.  If there are no objections to
it, would this change be safe for the release branch, or should it go
to master?

Best regards,
Stefan Kangas


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Bind-flyspell-correct-word-to-mouse-3-also.patch --]
[-- Type: text/x-diff, Size: 2974 bytes --]

From 74751c091cfb78e0565cec6bd7bf31acc0b421f4 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Thu, 31 Oct 2019 02:15:56 +0100
Subject: [PATCH] Bind flyspell-correct-word to mouse-3 also

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

* doc/emacs/fixit.texi (Spelling): Document the new key binding.
* etc/NEWS: Announce it.
---
 doc/emacs/fixit.texi       | 13 +++++++------
 etc/NEWS                   |  9 +++++++++
 lisp/textmodes/flyspell.el |  1 +
 3 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/doc/emacs/fixit.texi b/doc/emacs/fixit.texi
index 171a9bc06f..d246dedd70 100644
--- a/doc/emacs/fixit.texi
+++ b/doc/emacs/fixit.texi
@@ -441,12 +441,13 @@ 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
-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
-@kbd{C-c $} (@code{flyspell-correct-word-before-point}) will pop up a
-menu of possible corrections.  Of course, you can always correct the
+it with @kbd{mouse-2} or @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 @kbd{C-c $}
+(@code{flyspell-correct-word-before-point}) will pop up a menu of
+possible corrections.  Of course, you can always correct the
 misspelled word by editing it manually in any way you like.
 
 @findex flyspell-prog-mode
diff --git a/etc/NEWS b/etc/NEWS
index 0e43c321d8..4feebd3aa9 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -44,6 +44,15 @@ It was declared obsolete in Emacs 27.1.
 \f
 * Changes in Specialized Modes and Packages in Emacs 28.1
 
+** Flyspell mode
+
++++
+*** Corrections and actions menu is now also 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.  In addition
+to being bound to mouse-2 (usually the middle mouse button), it is now
+also bound to mouse-3 (usually the right mouse button).
+
 \f
 * New Modes and Packages in Emacs 28.1
 
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 39a1b488a7..b04c4d6f3b 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -461,6 +461,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


  reply	other threads:[~2020-01-16  1:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-12 12:23 bug#11680: flyspell should use mouse-3 instead of mouse-2 Le Wang
2019-11-01 18:21 ` Stefan Kangas
2019-11-01 19:07   ` Eli Zaretskii
2019-11-02  0:25     ` Stefan Kangas
2019-11-02  7:51       ` Eli Zaretskii
2020-01-16  1:50         ` Stefan Kangas [this message]
2020-01-16 14:46           ` Eli Zaretskii
2020-08-13  6:10             ` Stefan Kangas
2020-08-13 13:07               ` Eli Zaretskii
2020-08-15  1:08                 ` Stefan Kangas
2020-08-15 17:53                   ` Eli Zaretskii
2020-08-16 17:53                     ` Stefan Kangas
2020-08-17  0:38                   ` Juri Linkov
2020-08-17  2:38                     ` Drew Adams
2020-08-17 14:01                       ` Stefan Kangas
2020-08-17 15:12                         ` Drew Adams
2020-08-19  1:07                   ` Juri Linkov
2020-08-19 10:00                     ` Stefan Kangas
2020-08-27  5:14                       ` Stefan Kangas

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87d0bkyxt0.fsf@marxist.se \
    --to=stefan@marxist.se \
    --cc=11680@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=l26wang@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).