]> git.eshelyaron.com Git - emacs.git/commitdiff
Refer to correct mouse button in flyspell message
authorStefan Kangas <stefankangas@gmail.com>
Thu, 27 Aug 2020 04:48:39 +0000 (06:48 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Thu, 27 Aug 2020 04:51:47 +0000 (06:51 +0200)
* lisp/textmodes/flyspell.el (make-flyspell-overlay)
(flyspell-mode-on): Refer to mouse-3 in help messages when the
variable 'flyspell-use-mouse-3-for-menu' is non-nil.  (Bug#11680)

lisp/textmodes/flyspell.el

index 23f96d7e0eea69f128157f9a6b3dc64680843160..0af8ba872db7ebbc1c5b223864a98acb9a1da743 100644 (file)
@@ -645,14 +645,15 @@ in your init file.
   ;; the welcome message
   (if (and flyspell-issue-message-flag
           flyspell-issue-welcome-flag
-          (called-interactively-p 'interactive))
-      (let ((binding (where-is-internal 'flyspell-auto-correct-word
-                                       nil 'non-ascii)))
-       (message "%s"
-        (if binding
-            (format "Welcome to flyspell. Use %s or Mouse-2 to correct words."
-                    (key-description binding))
-          "Welcome to flyspell. Use Mouse-2 to correct words.")))))
+           (called-interactively-p 'interactive))
+      (let* ((binding (where-is-internal 'flyspell-auto-correct-word
+                                         nil 'non-ascii))
+             (mouse-button (if flyspell-use-mouse-3-for-menu
+                               "Mouse-3" "Mouse-2")))
+        (message "Welcome to Flyspell. Use %s to correct words"
+                 (if binding
+                     (format "%s or %s" (key-description binding) mouse-button)
+                   (format "%s" mouse-button))))))
 
 ;;*---------------------------------------------------------------------*/
 ;;*    flyspell-delay-commands ...                                      */
@@ -1802,7 +1803,9 @@ for the overlay."
     (overlay-put overlay 'mouse-face mouse-face)
     (overlay-put overlay 'flyspell-overlay t)
     (overlay-put overlay 'evaporate t)
-    (overlay-put overlay 'help-echo "mouse-2: correct word at point")
+    (overlay-put overlay 'help-echo (concat (if flyspell-use-mouse-3-for-menu
+                                                "mouse-3"
+                                              "mouse-2") ": correct word at point"))
     ;; If misspelled text has a 'keymap' property, let that remain in
     ;; effect for the bindings that flyspell-mouse-map doesn't override.
     (set-keymap-parent flyspell-mouse-map (get-char-property beg 'keymap))