]> git.eshelyaron.com Git - emacs.git/commitdiff
Display the language in the Flyspell mode line
authorLars Ingebrigtsen <larsi@gnus.org>
Sat, 19 Sep 2020 14:05:55 +0000 (16:05 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sat, 19 Sep 2020 14:05:55 +0000 (16:05 +0200)
* lisp/textmodes/flyspell.el (flyspell-mode): Display the language
in the mode line (bug#14957).

etc/NEWS
lisp/textmodes/flyspell.el

index 54bad068f8573e5571c62fa9e5647f7ea68ca6e7..26aa030391d6ec2b321b905c64a3780471fc986a 100644 (file)
--- 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
 
 ---
index 51ed3a2f7898ca0e6b1b8baa42f25adae91a38f8..e862e354b5c852ae58e36f6849cd8724b77afa9f 100644 (file)
@@ -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