@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 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
Flyspell Prog mode works just like ordinary Flyspell mode, except
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 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)
+instead of mouse-2 (the default) by customizing the new option
+'flyspell-correct-on-mouse-3'.
+
\f
* New Modes and Packages in Emacs 28.1
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
+ :version "28.1")
+
;; dash character machinery
(defvar flyspell-consider-dash-as-word-delimiter-flag nil
"Non-nil means that the `-' char is considered as a word delimiter.")
: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)))