[Top][All Lists]

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

master 15f6c07: Refer to correct mouse button in flyspell message

From: Stefan Kangas
Subject: master 15f6c07: Refer to correct mouse button in flyspell message
Date: Thu, 27 Aug 2020 00:56:25 -0400 (EDT)

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

    Refer to correct mouse button in flyspell message
    * 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 | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 23f96d7..0af8ba8 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -645,14 +645,15 @@ in your init file.
   ;; the welcome message
   (if (and flyspell-issue-message-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 
     ;; 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))

reply via email to

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