Subject: bug#14957: 24.3.50; Flyspell language visible in mode line

From: Lars Ingebrigtsen <[email-masked]>
Date: Sat, 19 Sep 2020 16:01:57 +0200

Eli Zaretskii <[email-masked]> writes:

> That's sub-optimal IMO.  I like the "Fly[br]" variant much better.

Me too.  Or...  Fly/br?  That's one character less.  I did that instead;
feel free to change if "Fly[br]" is more understandable.

Michael Heerdegen <[email-masked]> writes:

> Isn't it possible to use a sequence of multiple `propertize' mode-line
> specs?

Hm...  I thought they were overwritten here:

(defvar mode-line-modes
[...]
	  `(:propertize ("" minor-mode-alist)
			mouse-face mode-line-highlight
			help-echo "Minor mode\n\
mouse-1: Display minor mode menu\n\
mouse-2: Show help for minor mode\n\
mouse-3: Toggle minor modes"
			local-map ,mode-line-minor-mode-keymap)

But the properties :propertize properties seem to survive?  Yup.

Now implemented and pushed.  I had to cheat a bit here, since the
define-minor-mode machinery doesn't allow evaluating anything at all in
the :lighter keyword, so I had to put a keymap construct directly into
it:

+              local-map (keymap
+                         (mode-line keymap
+                                    (mouse-1 . ispell-change-dictionary))))))

Which is kinda hacky, but...

There was also some suggestion about showing this data in all buffers
that have ispell-dictionary bound, but in my testing, I found that that
led to the language being displayed in some special modes, too, so I
don't think that's workable.  So it's just in Flyspell mode.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no