GNU bug report logs -
#14694
24.3; format-mode-line failing with :eval form via a variable in a conditional construct
Previous Next
Reported by: Phil Sainty <psainty <at> orcon.net.nz>
Date: Sun, 23 Jun 2013 05:13:01 UTC
Severity: normal
Tags: notabug
Found in version 24.3
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #14 received at 14694 <at> debbugs.gnu.org (full text, mbox):
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
This bug report was last modified 11 years and 338 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.