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

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

Re: Style in elisp: how to show a flag value in the modeline?


From: Stefan Monnier <address@hidden>
Subject: Re: Style in elisp: how to show a flag value in the modeline?
Date: 20 Feb 2003 15:45:54 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>>>>> "FF" == François Fleuret <francois.fleuret@noos.fr> writes:
> What is the good way to show in the modeline the value of a boolean of
> a flag associated to a major-mode ? The current solution I came with
> is to change the value of `mode-name'. But I have the feeling that
> should be done another way. Any advice ?

I think a standard way to do it is

  (set (make-local-variable 'mode-line-process)
       '("" (var-1 " var-1 is ON" " var-1 is OFF") var-2))

this would display the boolean status of var-1 and the current value
of var-2 right after the major-mode and before the minor modes.
At least that's what I use in PCL-CVS and it works well.
The value of mode-line-process (and of var-2 as well) is interpreted in
the same way as mode-line-format (except maybe that % escape thingies
don't work, IIRC).


        Stefan


reply via email to

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