unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#11680: flyspell should use mouse-3 instead of mouse-2
@ 2012-06-12 12:23 Le Wang
  2019-11-01 18:21 ` Stefan Kangas
  0 siblings, 1 reply; 19+ messages in thread
From: Le Wang @ 2012-06-12 12:23 UTC (permalink / raw)
  To: 11680

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

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

-- 
Le

[-- Attachment #2: Type: text/html, Size: 340 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#11680: flyspell should use mouse-3 instead of mouse-2
  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
  0 siblings, 1 reply; 19+ messages in thread
From: Stefan Kangas @ 2019-11-01 18:21 UTC (permalink / raw)
  To: Le Wang; +Cc: 11680

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

Le Wang <l26wang@gmail.com> 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


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

From f9b06855b129f4472908893d411d70b20fd0edfe Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
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).
+
 \f
 * 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


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* bug#11680: flyspell should use mouse-3 instead of mouse-2
  2019-11-01 18:21 ` Stefan Kangas
@ 2019-11-01 19:07   ` Eli Zaretskii
  2019-11-02  0:25     ` Stefan Kangas
  0 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2019-11-01 19:07 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: l26wang, 11680

> From: Stefan Kangas <stefan@marxist.se>
> Date: Fri, 01 Nov 2019 19:21:35 +0100
> Cc: 11680@debbugs.gnu.org
> 
> > 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?

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.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#11680: flyspell should use mouse-3 instead of mouse-2
  2019-11-01 19:07   ` Eli Zaretskii
@ 2019-11-02  0:25     ` Stefan Kangas
  2019-11-02  7:51       ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: Stefan Kangas @ 2019-11-02  0:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: l26wang, 11680

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?

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#11680: flyspell should use mouse-3 instead of mouse-2
  2019-11-02  0:25     ` Stefan Kangas
@ 2019-11-02  7:51       ` Eli Zaretskii
  2020-01-16  1:50         ` Stefan Kangas
  0 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2019-11-02  7:51 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: l26wang, 11680

> From: Stefan Kangas <stefan@marxist.se>
> Date: Sat, 2 Nov 2019 01:25:01 +0100
> Cc: l26wang@gmail.com, 11680@debbugs.gnu.org
> 
> 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?





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#11680: flyspell should use mouse-3 instead of mouse-2
  2019-11-02  7:51       ` Eli Zaretskii
@ 2020-01-16  1:50         ` Stefan Kangas
  2020-01-16 14:46           ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: Stefan Kangas @ 2020-01-16  1:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 11680, l26wang

[-- 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


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* bug#11680: flyspell should use mouse-3 instead of mouse-2
  2020-01-16  1:50         ` Stefan Kangas
@ 2020-01-16 14:46           ` Eli Zaretskii
  2020-08-13  6:10             ` Stefan Kangas
  0 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2020-01-16 14:46 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 11680, l26wang

> From: Stefan Kangas <stefan@marxist.se>
> Cc: 11680@debbugs.gnu.org,  l26wang@gmail.com
> Date: Thu, 16 Jan 2020 02:50:19 +0100
> 
> > 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 don't see how this resolves the backward-compatibility issue, sorry.

> 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.

Once again, we are not talking about adding a new feature from
scratch, we are talking about changing a very old behavior.  So
whether it's more natural or not is of secondary importance for this
decision.

I'm okay with making this conditional on some user option, but I
object to an unconditional change.

> 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?

In any case, we don't add new features on the release branch, we only
fix bugs there.

Thanks.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#11680: flyspell should use mouse-3 instead of mouse-2
  2020-01-16 14:46           ` Eli Zaretskii
@ 2020-08-13  6:10             ` Stefan Kangas
  2020-08-13 13:07               ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: Stefan Kangas @ 2020-08-13  6:10 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: l26wang, 11680

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Stefan Kangas <stefan@marxist.se>
>> Cc: 11680@debbugs.gnu.org,  l26wang@gmail.com
>> Date: Thu, 16 Jan 2020 02:50:19 +0100
>>
>> > 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 don't see how this resolves the backward-compatibility issue, sorry.

Sorry for the very late reply here.

The change in behaviour is what it is, but I think that users should be
able to get used to the new behaviour.

In fact, they might even like it more.  I think there is something to be
said about (in this case) aligning ourselves with most other editors or
programs people use: Firefox, LibreOffice, VSCode, etc.

(This goes even for users that don't read NEWS: The words are clearly
highlighted, so it should be intuitive and apparent what is going on (at
least after a while): to invoke mouse-save-then-kill, simply click
slightly to the left or right of the highlighted word.)

> Once again, we are not talking about adding a new feature from
> scratch, we are talking about changing a very old behavior.  So
> whether it's more natural or not is of secondary importance for this
> decision.
>
> I'm okay with making this conditional on some user option, but I
> object to an unconditional change.

That is a good solution, if the default is to enable it.  That would
allow users to easily switch back if they don't like the new behaviour.

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#11680: flyspell should use mouse-3 instead of mouse-2
  2020-08-13  6:10             ` Stefan Kangas
@ 2020-08-13 13:07               ` Eli Zaretskii
  2020-08-15  1:08                 ` Stefan Kangas
  0 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2020-08-13 13:07 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: l26wang, 11680

> From: Stefan Kangas <stefan@marxist.se>
> Date: Wed, 12 Aug 2020 23:10:11 -0700
> Cc: l26wang@gmail.com, 11680@debbugs.gnu.org
> 
> > I'm okay with making this conditional on some user option, but I
> > object to an unconditional change.
> 
> That is a good solution, if the default is to enable it.  That would
> allow users to easily switch back if they don't like the new behaviour.

I think it should be an opt-in behavior, conditional on a user
option.  We can later see if it is popular enough to make that the
default behavior.

Thanks.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#11680: flyspell should use mouse-3 instead of mouse-2
  2020-08-13 13:07               ` Eli Zaretskii
@ 2020-08-15  1:08                 ` Stefan Kangas
  2020-08-15 17:53                   ` Eli Zaretskii
                                     ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Stefan Kangas @ 2020-08-15  1:08 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: l26wang, 11680

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

Eli Zaretskii <eliz@gnu.org> writes:

> I think it should be an opt-in behavior, conditional on a user
> option.  We can later see if it is popular enough to make that the
> default behavior.

OK.  How about the attached patch?

Best regards,
Stefan Kangas

[-- Attachment #2: 0001-Add-new-option-flyspell-correct-on-mouse-3.patch --]
[-- Type: text/x-diff, Size: 4198 bytes --]

From 3c1ceeff2c8c80914c590f461c6b876c3c5882af Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
Date: Sat, 15 Aug 2020 02:53:35 +0200
Subject: [PATCH] Add new option flyspell-correct-on-mouse-3

* lisp/textmodes/flyspell.el
(flyspell-correct-on-mouse-3): New option to bind
'flyspell-correct-word' to 'mouse-3'.
(flyspell--set-correct-on-mouse-3): New function to update option.
(flyspell-mode): Update 'flyspell-mouse-map' if above option is
set.
* doc/emacs/fixit.texi (Spelling): Mention the new option.
* etc/NEWS: Announce the new option.
---
 doc/emacs/fixit.texi       |  9 +++++----
 etc/NEWS                   |  9 +++++++++
 lisp/textmodes/flyspell.el | 20 +++++++++++++++++++-
 3 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/doc/emacs/fixit.texi b/doc/emacs/fixit.texi
index 5046146dda..b6f65848d1 100644
--- a/doc/emacs/fixit.texi
+++ b/doc/emacs/fixit.texi
@@ -445,12 +445,13 @@ Spelling
 @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
+of possible corrections and actions.  If you want this menu on
+@kbd{mouse-3} instead, customize the variable
+@code{flyspell-correct-on-mouse-3}.  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
-@w{@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.
+@w{@kbd{C-c $}} (@code{flyspell-correct-word-before-point}) will pop
+up a misspelled word by editing it manually in any way you like.
 
 @findex flyspell-prog-mode
   Flyspell Prog mode works just like ordinary Flyspell mode, except
diff --git a/etc/NEWS b/etc/NEWS
index 8cd845a7b9..e6c1c6224a 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -839,6 +839,15 @@ height of lines or width of chars.
 *** New user option 'xwidget-webkit-bookmark-jump-new-session'.
 When non-nil, use a new xwidget webkit session after bookmark jump.
 Otherwise, it will use 'xwidget-webkit-last-session'.
+** Flyspell mode
+
++++
+*** Corrections and actions menu optionally 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.  You can now
+easily bind this menu to mouse-2 (usually the right mouse button)
+instead of mouse-3 (the default) by customizing the new option
+'flyspell-correct-on-mouse-3'.
 
 \f
 * New Modes and Packages in Emacs 28.1
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index b6ebb9f098..c594e02e98 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -445,6 +445,21 @@ flyspell-mode-map
     map)
   "Minor mode keymap for Flyspell mode--for the whole buffer.")
 
+;; correct on mouse 3
+(defun flyspell--set-correct-on-mouse-3 (var value)
+  (set-default var value)
+  (if value
+      (progn (define-key flyspell-mouse-map [mouse-2] nil)
+             (define-key flyspell-mouse-map [mouse-3] 'flyspell-correct-word))
+    (define-key flyspell-mouse-map [mouse-2] 'flyspell-correct-word)
+    (define-key flyspell-mouse-map [mouse-3] nil)))
+
+(defcustom flyspell-correct-on-mouse-3 nil
+  "Non-nil means to bind `mouse-3' to `flyspell-correct-word'.
+If this is set, also unbind `mouse-2'."
+  :type 'boolean
+  :set 'flyspell--set-correct-on-mouse-3)
+
 ;; dash character machinery
 (defvar flyspell-consider-dash-as-word-delimiter-flag nil
   "Non-nil means that the `-' char is considered as a word delimiter.")
@@ -514,7 +529,10 @@ flyspell-mode
   :group 'flyspell
   (if flyspell-mode
       (condition-case err
-	  (flyspell-mode-on)
+          (progn
+            (when flyspell-correct-on-mouse-3
+              (flyspell--set-correct-on-mouse-3 'flyspell-correct-on-mouse-3 t))
+	    (flyspell-mode-on))
 	(error (message "Error enabling Flyspell mode:\n%s" (cdr err))
 	       (flyspell-mode -1)))
     (flyspell-mode-off)))
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* bug#11680: flyspell should use mouse-3 instead of mouse-2
  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-19  1:07                   ` Juri Linkov
  2 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2020-08-15 17:53 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: l26wang, 11680

> From: Stefan Kangas <stefan@marxist.se>
> Date: Fri, 14 Aug 2020 18:08:59 -0700
> Cc: l26wang@gmail.com, 11680@debbugs.gnu.org
> 
> OK.  How about the attached patch?

LGTM.

> -@w{@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.
> +@w{@kbd{C-c $}} (@code{flyspell-correct-word-before-point}) will pop
> +up a misspelled word by editing it manually in any way you like.

I don't understand this part of the change: "C-c $" does pop up a menu
for me.

> +*** Corrections and actions menu optionally bound to mouse-3.

"... can be optionally bound to ..." is better, IMO.

> +(defcustom flyspell-correct-on-mouse-3 nil
> +  "Non-nil means to bind `mouse-3' to `flyspell-correct-word'.
> +If this is set, also unbind `mouse-2'."
> +  :type 'boolean
> +  :set 'flyspell--set-correct-on-mouse-3)

:version tag missing here.

Thanks.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#11680: flyspell should use mouse-3 instead of mouse-2
  2020-08-15 17:53                   ` Eli Zaretskii
@ 2020-08-16 17:53                     ` Stefan Kangas
  0 siblings, 0 replies; 19+ messages in thread
From: Stefan Kangas @ 2020-08-16 17:53 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: l26wang, 11680

close 11680 28.1
thanks

Eli Zaretskii <eliz@gnu.org> writes:

>> OK.  How about the attached patch?
>
> LGTM.

Thanks.  Fixed your comments and pushed to master as commit 1eae0a8784.

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#11680: flyspell should use mouse-3 instead of mouse-2
  2020-08-15  1:08                 ` Stefan Kangas
  2020-08-15 17:53                   ` Eli Zaretskii
@ 2020-08-17  0:38                   ` Juri Linkov
  2020-08-17  2:38                     ` Drew Adams
  2020-08-19  1:07                   ` Juri Linkov
  2 siblings, 1 reply; 19+ messages in thread
From: Juri Linkov @ 2020-08-17  0:38 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: l26wang, 11680

> +(defcustom flyspell-correct-on-mouse-3 nil
> +  "Non-nil means to bind `mouse-3' to `flyspell-correct-word'.
> +If this is set, also unbind `mouse-2'."
> +  :type 'boolean
> +  :set 'flyspell--set-correct-on-mouse-3)

In the future, a more general option would be preferable
that would enable using the right mouse button to pop up
context menus in more places in Emacs like most other apps do
nowadays, i.e. something like cua-emulation mode but for mouse-3.





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#11680: flyspell should use mouse-3 instead of mouse-2
  2020-08-17  0:38                   ` Juri Linkov
@ 2020-08-17  2:38                     ` Drew Adams
  2020-08-17 14:01                       ` Stefan Kangas
  0 siblings, 1 reply; 19+ messages in thread
From: Drew Adams @ 2020-08-17  2:38 UTC (permalink / raw)
  To: Juri Linkov, Stefan Kangas; +Cc: l26wang, 11680

> In the future, a more general option would be preferable
> that would enable using the right mouse button to pop up
> context menus in more places in Emacs like most other apps do
> nowadays, i.e. something like cua-emulation mode but for mouse-3.

(Caveat: I haven't followed this thread, at all.)

But if `mouse-3' behavior that allows for context-specific
popup menus is what's sought, then `mouse3.el' fulfills
that need, and with a great deal of flexibility.  This has
been the case since 2010.

Not only does it provide for context menus, but it does so
without sacrificing the other useful vanilla `mouse-3'
behaviors, which are also useful.  It adds to, instead of
replaces, existing `mouse-3' behavior.  It's compatible
with what Emacs users expect in general for `mouse-3'.

https://www.emacswiki.org/emacs/Mouse3

https://www.emacswiki.org/emacs/download/mouse3.el





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#11680: flyspell should use mouse-3 instead of mouse-2
  2020-08-17  2:38                     ` Drew Adams
@ 2020-08-17 14:01                       ` Stefan Kangas
  2020-08-17 15:12                         ` Drew Adams
  0 siblings, 1 reply; 19+ messages in thread
From: Stefan Kangas @ 2020-08-17 14:01 UTC (permalink / raw)
  To: Drew Adams, Juri Linkov; +Cc: l26wang, 11680

Drew Adams <drew.adams@oracle.com> writes:

>> In the future, a more general option would be preferable
>> that would enable using the right mouse button to pop up
>> context menus in more places in Emacs like most other apps do
>> nowadays, i.e. something like cua-emulation mode but for mouse-3.

Agreed, that would be very useful.

> (Caveat: I haven't followed this thread, at all.)
>
> But if `mouse-3' behavior that allows for context-specific
> popup menus is what's sought, then `mouse3.el' fulfills
> that need, and with a great deal of flexibility.  This has
> been the case since 2010.
>
> Not only does it provide for context menus, but it does so
> without sacrificing the other useful vanilla `mouse-3'
> behaviors, which are also useful.  It adds to, instead of
> replaces, existing `mouse-3' behavior.  It's compatible
> with what Emacs users expect in general for `mouse-3'.
>
> https://www.emacswiki.org/emacs/Mouse3
>
> https://www.emacswiki.org/emacs/download/mouse3.el

Thanks, I didn't know about this library but will look into it in
detail.  Is there anything stopping us from incuding this library in
Emacs?  Would it be suitable for general use?

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#11680: flyspell should use mouse-3 instead of mouse-2
  2020-08-17 14:01                       ` Stefan Kangas
@ 2020-08-17 15:12                         ` Drew Adams
  0 siblings, 0 replies; 19+ messages in thread
From: Drew Adams @ 2020-08-17 15:12 UTC (permalink / raw)
  To: Stefan Kangas, Juri Linkov; +Cc: l26wang, 11680

> > if `mouse-3' behavior that allows for context-specific
> > popup menus is what's sought, then `mouse3.el' fulfills
> > that need, and with a great deal of flexibility.  This has
> > been the case since 2010.
> >
> > Not only does it provide for context menus, but it does so
> > without sacrificing the other useful vanilla `mouse-3'
> > behaviors, which are also useful.  It adds to, instead of
> > replaces, existing `mouse-3' behavior.  It's compatible
> > with what Emacs users expect in general for `mouse-3'.
> > https://www.emacswiki.org/emacs/Mouse3
> > https://www.emacswiki.org/emacs/download/mouse3.el
> 
> Thanks, I didn't know about this library but will look into it in
> detail.  Is there anything stopping us from incuding this library in
> Emacs?  Would it be suitable for general use?

Yes, no problem.

As is generally the case with my libraries, there can
be code that accommodates backward compatibility, and
there can be code that does something extra/better if
some of my libraries (or some other libraries) have
been loaded.

For vanilla GNU Emacs such conditional code can be
removed or the conditional test can be removed.  E.g.,
(fboundp 'string-insert-rectangle) is for Emacs 24.4+.

Examples of code that makes use of other libraries:

* If library `isearch-prop.el' has been loaded then
  menu items `Isearch' and `Isearch Regexp' are there
  for searching the region.  (Submenu `Search/Replace'.)

* If library `highlight.el' has been loaded then menu
  items `Copy Text Properties' and `Yank Copied Text
  Properties' are available for acting on the region.
  (Submenus `Copy' and `Remove/Replace'.)

* If library `boxquote.el' has been loaded then menu
  items `Boxquote' and `Unboxquote' are there.
  (Submenu `Change Text'.)

* If `unaccent.el' is loaded then item `Remove Accents'.
  (Submenu `Change Text'.)

* If `highlight.el' is loaded then submenu `Highlight'
  is available.

* If `ebnf2ps.el' is loaded then `BNF PostScript Analyze',
  `BNF PostScript Print', and `BNF PostScript Save'.

* If `bookmark+.el' then `Highlight Bookmarks' and
  `Create Bookmarks Matching'.  (Submenu `Misc'.)

* If `help-fns+.el' then `Describe File' and `Describe
  Package'.  (Submenu `Thing at Pointer'.)

* If `highlight.el' then items `Highlight Symbol' and
  `Unhighlight Symbol'.  (Submenu `Thing at Pointer'.)





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#11680: flyspell should use mouse-3 instead of mouse-2
  2020-08-15  1:08                 ` Stefan Kangas
  2020-08-15 17:53                   ` Eli Zaretskii
  2020-08-17  0:38                   ` Juri Linkov
@ 2020-08-19  1:07                   ` Juri Linkov
  2020-08-19 10:00                     ` Stefan Kangas
  2 siblings, 1 reply; 19+ messages in thread
From: Juri Linkov @ 2020-08-19  1:07 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 11680, l26wang

>> I think it should be an opt-in behavior, conditional on a user
>> option.  We can later see if it is popular enough to make that the
>> default behavior.
>
> OK.  How about the attached patch?

A small problem: after customizing flyspell-use-mouse-3-for-menu to t,
hovering over a misspelled word displays a misleading tooltip
"mouse-2: correct word at point"
 =======





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#11680: flyspell should use mouse-3 instead of mouse-2
  2020-08-19  1:07                   ` Juri Linkov
@ 2020-08-19 10:00                     ` Stefan Kangas
  2020-08-27  5:14                       ` Stefan Kangas
  0 siblings, 1 reply; 19+ messages in thread
From: Stefan Kangas @ 2020-08-19 10:00 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 11680, l26wang

Juri Linkov <juri@linkov.net> writes:

> A small problem: after customizing flyspell-use-mouse-3-for-menu to t,
> hovering over a misspelled word displays a misleading tooltip
> "mouse-2: correct word at point"
>  =======

Thanks for reporting that.  I'll look into it.

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 19+ messages in thread

* bug#11680: flyspell should use mouse-3 instead of mouse-2
  2020-08-19 10:00                     ` Stefan Kangas
@ 2020-08-27  5:14                       ` Stefan Kangas
  0 siblings, 0 replies; 19+ messages in thread
From: Stefan Kangas @ 2020-08-27  5:14 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 11680, l26wang

Stefan Kangas <stefan@marxist.se> writes:

> Juri Linkov <juri@linkov.net> writes:
>
>> A small problem: after customizing flyspell-use-mouse-3-for-menu to t,
>> hovering over a misspelled word displays a misleading tooltip
>> "mouse-2: correct word at point"
>>  =======
>
> Thanks for reporting that.  I'll look into it.

Fixed on master (commit 15f6c07f15).





^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2020-08-27  5:14 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).