emacs-diffs
[Top][All Lists]
Advanced

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

master b8f4478: Display the language in the Flyspell mode line


From: Lars Ingebrigtsen
Subject: master b8f4478: Display the language in the Flyspell mode line
Date: Sat, 19 Sep 2020 10:06:05 -0400 (EDT)

branch: master
commit b8f447867f20ebfc2bb80dd44ecfac9b7b2ea628
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Display the language in the Flyspell mode line
    
    * lisp/textmodes/flyspell.el (flyspell-mode): Display the language
    in the mode line (bug#14957).
---
 etc/NEWS                   |  4 ++++
 lisp/textmodes/flyspell.el | 16 +++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/etc/NEWS b/etc/NEWS
index 54bad06..26aa030 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1139,6 +1139,10 @@ easily bind this menu to 'down-mouse-3' (usually the 
right mouse button)
 instead of 'mouse-2' (the default) by customizing the new user option
 'flyspell-use-mouse-3-for-menu'.
 
+---
+*** The current dictionary is now displayed in the minor mode lighter.
+Clicking the dictionary name changes the current dictionary.
+
 ** Time
 
 ---
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 51ed3a2..e862e35 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -529,7 +529,21 @@ in your init file.
 
 \\[flyspell-region] checks all words inside a region.
 \\[flyspell-buffer] checks the whole buffer."
-  :lighter flyspell-mode-line-string
+  :lighter (flyspell-mode-line-string
+            ;; If `flyspell-mode-line-string' is nil, then nothing of
+            ;; the following is displayed in the mode line.
+            ((:propertize flyspell-mode-line-string)
+             (:propertize
+              (:eval
+              (concat "/" (substring (or ispell-local-dictionary
+                                         ispell-dictionary
+                                          "--")
+                                      0 2)))
+              face bold
+              help-echo "mouse-1: Change dictionary"
+              local-map (keymap
+                         (mode-line keymap
+                                    (mouse-1 . ispell-change-dictionary))))))
   :keymap flyspell-mode-map
   :group 'flyspell
   (if flyspell-mode



reply via email to

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