GNU bug report logs -
#14957
24.3.50; Flyspell language visible in mode line
Previous Next
Reported by: Sebastien Vauban <sva-news <at> mygooglest.com>
Date: Fri, 26 Jul 2013 13:01:03 UTC
Severity: wishlist
Tags: fixed
Found in version 24.3.50
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hello Michael,
Michael Heerdegen wrote:
>> (add-to-list 'mode-line-format
>> '(:eval
>> (let ((dict (and (featurep 'ispell)
>> (or ispell-local-dictionary
>> ispell-dictionary))))
>> (and dict
>> (concat " ["
>> (propertize (substring dict 0 2)
>> 'face 'mode-line-highlight)
>> "]"))))
>
> That's not good. `mode-line-format' "automatically becomes buffer-local
> when set" (see C-h v). Your `add-to-list' only manipulates the
> `mode-line-format' of the current buffer when your code is evaluated
> (*scratch*, probably).
>
> You have to modify the default value, like this:
>
> (setq-default mode-line-format
> (cons
> '(:eval
> (let ((dict (and (featurep 'ispell)
> (or ispell-local-dictionary
> ispell-dictionary))))
> (and dict
> (concat " ["
> (propertize (substring dict 0 2)
> 'face 'mode-line-highlight)
> "]"))))
> (default-value 'mode-line-format)))
>
> Does that help?
Yes, it does.
However, I still wonder how to put the language indicator at the *end* of the
modeline -- I tried this at first, but I'm now sure it's not a good idea.
We can't do that by inverting the two components in the above cons expression.
And it seems I'm not yet bilingual enough in Lisp...
FYI, there is one minor annoyance; I'd like to see the language indicator only
where it makes sense, that is NOT in (almost) every buffer. For example, I do
see "fr" (my default dictionary) in the Emacs manuals, which is twice wrong:
- they're in English, and
- they're read-only...
I guess the read-only feature is the way to specify (in an automatic way) the
visibility (by default) of that feature. WDYT? In such a case, we simply have
to add a condition in the above "and" expression.
Best regards,
Seb
--
Sebastien Vauban
This bug report was last modified 4 years and 242 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.