emacs-diffs
[Top][All Lists]
Advanced

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

master ae098c3: Rename new option to flyspell-use-mouse-3-for-menu


From: Stefan Kangas
Subject: master ae098c3: Rename new option to flyspell-use-mouse-3-for-menu
Date: Tue, 18 Aug 2020 06:50:07 -0400 (EDT)

branch: master
commit ae098c3e726da4d926f824f7caf28456f2a7c003
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>

    Rename new option to flyspell-use-mouse-3-for-menu
    
    * lisp/textmodes/flyspell.el (flyspell-use-mouse-3-for-menu): Rename
    from 'flyspell-correct-on-mouse-3'.  The previous name did not make it
    clear that it's about opening a menu.  (Bug#11680)
    (flyspell--set-use-mouse-3-for-menu): Rename from
    'flyspell--set-correct-on-mouse-3'.  Bind menu to 'down-mouse-3'
    instead of 'mouse-3' to be more in line with user expectations.
    (flyspell-mode): Use the above new names.
    * doc/emacs/fixit.texi (Spelling):
    * etc/NEWS: Update documentation to use the new name.
    
    Suggested by Stefan Monnier <monnier@iro.umontreal.ca>.
---
 doc/emacs/fixit.texi       |  2 +-
 etc/NEWS                   |  4 ++--
 lisp/textmodes/flyspell.el | 14 +++++++-------
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/doc/emacs/fixit.texi b/doc/emacs/fixit.texi
index 507e780..6633848 100644
--- a/doc/emacs/fixit.texi
+++ b/doc/emacs/fixit.texi
@@ -447,7 +447,7 @@ use @code{flyspell-region} or @code{flyspell-buffer} for 
that.
 it with @kbd{mouse-2} (@code{flyspell-correct-word}) to display a menu
 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
+@code{flyspell-use-mouse-3-for-menu}.  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
diff --git a/etc/NEWS b/etc/NEWS
index 61b25d3..4b22c7e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -881,9 +881,9 @@ Otherwise, it will use 'xwidget-webkit-last-session'.
 *** Corrections and actions menu can be 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-3 (usually the right mouse button)
+easily bind this menu to down-mouse-3 (usually the right mouse button)
 instead of mouse-2 (the default) by customizing the new option
-'flyspell-correct-on-mouse-3'.
+'flyspell-use-mouse-3-for-menu'.
 
 
 * New Modes and Packages in Emacs 28.1
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 8608f85..23f96d7 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -446,19 +446,19 @@ like <img alt=\"Some thing.\">."
   "Minor mode keymap for Flyspell mode--for the whole buffer.")
 
 ;; correct on mouse 3
-(defun flyspell--set-correct-on-mouse-3 (var value)
+(defun flyspell--set-use-mouse-3-for-menu (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 [down-mouse-3] 
'flyspell-correct-word))
     (define-key flyspell-mouse-map [mouse-2] 'flyspell-correct-word)
-    (define-key flyspell-mouse-map [mouse-3] nil)))
+    (define-key flyspell-mouse-map [down-mouse-3] nil)))
 
-(defcustom flyspell-correct-on-mouse-3 nil
+(defcustom flyspell-use-mouse-3-for-menu 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
+  :set 'flyspell--set-use-mouse-3-for-menu
   :version "28.1")
 
 ;; dash character machinery
@@ -531,8 +531,8 @@ in your init file.
   (if flyspell-mode
       (condition-case err
           (progn
-            (when flyspell-correct-on-mouse-3
-              (flyspell--set-correct-on-mouse-3 'flyspell-correct-on-mouse-3 
t))
+            (when flyspell-use-mouse-3-for-menu
+              (flyspell--set-use-mouse-3-for-menu 
'flyspell-use-mouse-3-for-menu t))
            (flyspell-mode-on))
        (error (message "Error enabling Flyspell mode:\n%s" (cdr err))
               (flyspell-mode -1)))



reply via email to

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