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

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

bug#14694: 24.3; format-mode-line failing with :eval form via a variable


From: Phil Sainty
Subject: bug#14694: 24.3; format-mode-line failing with :eval form via a variable in a conditional construct
Date: Mon, 24 Jun 2013 05:48:23 +1200
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130509 Thunderbird/17.0.6

On 24/06/2013 04:45, Stefan Monnier wrote:
ELISP> (setq indirect-eval '(:eval "indirect eval"))
ELISP> (format-mode-line '(t indirect-eval "else"))
""

You need (put 'indirect-eval 'risky-local-variable t)

Argh, I see that in the documentation now. Thank you Stefan
(and Eli).

I'm afraid I made an embarrassing rookie mistake in checking
the result of (format-mode-line indirect-eval) instead of
(format-mode-line 'indirect-eval), and thinking that I was
seeing an inconsistency when there was none. Otherwise I'd no
doubt have spotted the information about that property.

My apologies; please close.


Eli asked:
> And anyway, why would you need format-mode-line to produce a
> different value?

The specific goal was to enable customisation of the display of
`mode-name' in the mode line (generally to abbreviate it and reduce
the space used) *without* also affecting what is displayed when that
variable is processed in other contexts (such as by `describe-mode'),
in which cases `format-mode-line' will be called.

Advising `format-mode-line' to provide an indicator variable to use
in a conditional construct does facilitate this. I just wanted check
that I wasn't missing another approach which didn't require the advice.


-Phil







reply via email to

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