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>.
This commit is contained in:
Stefan Kangas 2020-08-18 12:43:16 +02:00
parent e0c19e8dce
commit ae098c3e72
3 changed files with 10 additions and 10 deletions

View file

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

View file

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

View file

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