bug-gnu-emacs
[Top][All Lists]
Advanced

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

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


From: Michael Heerdegen
Subject: bug#14957: 24.3.50; Flyspell language visible in mode line
Date: Fri, 08 Nov 2013 22:30:31 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Hi Sebastien,

> (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:

--8<---------------cut here---------------start------------->8---
(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)))
--8<---------------cut here---------------end--------------->8---

Does that help?


Regards,

Michael.





reply via email to

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