From: Lars Ingebrigtsen Date: Sat, 19 Sep 2020 14:05:55 +0000 (+0200) Subject: Display the language in the Flyspell mode line X-Git-Tag: emacs-28.0.90~6008 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b8f447867f20ebfc2bb80dd44ecfac9b7b2ea628;p=emacs.git Display the language in the Flyspell mode line * lisp/textmodes/flyspell.el (flyspell-mode): Display the language in the mode line (bug#14957). --- diff --git a/etc/NEWS b/etc/NEWS index 54bad068f85..26aa030391d 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 51ed3a2f789..e862e354b5c 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