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

[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:0.9.4.1) 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?


Sure:


http://groups.google.com/groups?selm=3CB48625.14978022%40ihs.com


;;; 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 <kevinr@ihs.com>



reply via email to

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