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: Oliver Scholz
Subject: Re: Style in elisp: how to show a flag value in the modeline?
Date: Thu, 20 Feb 2003 13:48:59 +0100
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-msvc-nt5.1.2600)

francois.fleuret@noos.fr (François Fleuret) writes:

> Hi,
>
> 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 ?

Hmm, how about:

(defvar my-flag t)

(setq mode-line-format (copy-sequence mode-line-format))

(setcdr (nthcdr 4 mode-line-format)
        (cons '(:eval (if my-flag " True" " False"))
              (nthcdr 5 mode-line-format)))


It seems like an odd way to modify the mode-line, but I can't think of
any better right now.

    Oliver
-- 
2 Ventôse an 211 de la Révolution
Liberté, Egalité, Fraternité!


reply via email to

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