[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug#14957: 24.3.50; Flyspell language visible in mode line
From: |
Sebastien Vauban |
Subject: |
Re: bug#14957: 24.3.50; Flyspell language visible in mode line |
Date: |
Tue, 14 Jan 2014 09:58:32 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt) |
Hello Michael,
Michael Heerdegen wrote:
>> (add-to-list 'mode-line-format ...)
>
> 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?
It does and did.
Though, when opening some types of files (?) [1], I just observed that there is
an error message generated:
╭────
│ File mode specification error: (wrong-type-argument buffer-or-string-p
│ (:eval (let ((dict (and (featurep (quote ispell)) (not buffer-read-only)
│ (or ispell-local-dictionary ispell-dictionary)))) (and dict (propertize
│ (concat " " (substring dict 0 2)) (quote face) (quote
│ mode-line-highlight))))))
╰────
I'm not sure what to understand from that... That `mode-line-format' must be
a string? Hence, how do we put the `eval' stuff?
Best regards,
Seb
[1] Opening a file with a `.csv' extension.
--
Sebastien Vauban
- Re: bug#14957: 24.3.50; Flyspell language visible in mode line,
Sebastien Vauban <=
Message not available
Message not available