From: Stefan Kangas Date: Tue, 18 Aug 2020 10:43:16 +0000 (+0200) Subject: Rename new option to flyspell-use-mouse-3-for-menu X-Git-Tag: emacs-28.0.90~6558 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ae098c3e726da4d926f824f7caf28456f2a7c003;p=emacs.git 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 . --- diff --git a/doc/emacs/fixit.texi b/doc/emacs/fixit.texi index 507e780f58e..6633848716e 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 61b25d3a2e6..4b22c7e5f99 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 8608f850888..23f96d7e0ee 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -446,19 +446,19 @@ like \"Some." "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)))