[Top][All Lists]

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

Re: From mode-line-format to string?

From: Kevin Rodgers
Subject: Re: From mode-line-format to string?
Date: Thu, 05 Sep 2002 12:11:29 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv: Gecko/20020406 Netscape6/6.2.2

Kai Gro├čjohann wrote:

I have the need for a variable with some of the features from
mode-line-format.  In particular, I'd like the concatenation features
and the list-with-first-element-being-variable feature.

So processing the value ("a" "b") should result in the string "ab".
(That's concatenation.)

And processing the value ((foo "valfoo") (bar "valbar")) should
result in "valfoovalbar" if both variables foo and bar are non-nil.
Else if bar is nil and foo is non-nil, "valfoo" should result, else if
foo is nil and bar is non-nil, "valbar" should result.

Is there a Lisp function or library that does this?


;;; Description:
;;; Emacs doesn't provide distinct functions for (1) generating a string
;;; from `mode-line-format' and (2) displaying it in the mode line.  In
;;; src/xdisp.c, display_mode_element() does both, and it doesn't have a
;;; Lisp binding.  apply-mode-line-format.el defines an eponymous Lisp
;;; function that returns any `mode-line-format' template as a string.

Kevin Rodgers <address@hidden>

reply via email to

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