all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Stephen J. Turnbull" <stephen@xemacs.org>
Cc: Alan Mackenzie <acm@muc.de>, emacs-devel@gnu.org
Subject: Re: Elisp manual: @section Mode Line Format is unclear (cont.)
Date: Fri, 30 Dec 2005 16:33:27 +0900	[thread overview]
Message-ID: <87k6dnrqd4.fsf_-_@tleepslib.sk.tsukuba.ac.jp> (raw)
In-Reply-To: <jezmmjjutw.fsf@sykes.suse.de> (Andreas Schwab's message of "Fri, 30 Dec 2005 01:24:11 +0100")

Sorry about the premature send.  I just got in from playing with my
daughter and my frozen fingers weren't flexible enough to get to C-x C-x....

Prefatory material omitted, here's the beef.

What Alan would like to see, I suppose, is something like:

 - Variable: mode-line-format
     The value of this variable is a mode-line construct which
     describes the mode-line to redisplay.

     The simplest form of mode-line construct is a string containing
     zero or more %-constructs.  A %-construct is a reference to a
     variable whose value is to be interpolated into the modeline at
     that point.  The %-construct is introduced by the character `%',
     followed by optional formatting specifications, and terminated by
     a single character which indicates the variable whose value is to
     be interpolated.  *Note:: %-constructs.  Example:

     `(setq mode-line-format "%B")'

     puts the buffer name, and nothing else, in the mode-line of the
     current buffer.

     A symbol is also a mode-line construct.  Its value is interpolated
     in the mode-line display, but %-constructs are *not* interpreted.
     Example:

     `(setq buffer-format "%B" mode-line-format 'buffer-format)'

     does not have the same effect as the above.  Instead, it produces
     a (rather useless) mode-line containing only the string "%B".

     The mode-line can include images by [however you do that in Emacs].

     Finally, a mode-line construct may be a list of mode-line
     constructs.  If the car is a symbol, the list is treated as a
     conditional.  If the symbol's value is non-nil, the cadr is
     evaluated (recursively, as necessary), and interpolated.
     Otherwise the caddr is evaluated and interpolated.

     If the car is an integer, its magnitude is a target width.  When
     positive, the rest of the elements of the list are evaluated,
     concatenated, and if necessary right-padded with spaces to
     achieve the target width.  When negative, the result is truncated
     to the target width.

     Otherwise, these are evaluated (recursively, as necessary) until
     all resolve to strings, which are concatenated left-to-right to
     produce the mode-line display.  Example:

     `(setq buffer-format "%B" mode-line-format '("%B" buffer-format))'

     displays a mode-line containing the buffer name, followed by the
     string "%B" with no space intervening.

(Note: the above is not likely to be an accurate description of either
XEmacs or Emacs, as there are other, more arcane possibilities.)


-- 
School of Systems and Information Engineering http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba                    Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
               Ask not how you can "do" free software business;
              ask what your business can "do for" free software.

  parent reply	other threads:[~2005-12-30  7:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-29 23:04 Elisp manual: @section Mode Line Format is unclear Alan Mackenzie
2005-12-30  0:24 ` Andreas Schwab
2005-12-30  1:05   ` David Kastrup
2005-12-30  7:02   ` Stephen J. Turnbull
2005-12-30  7:33   ` Stephen J. Turnbull [this message]
2005-12-30  4:57 ` Richard M. Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k6dnrqd4.fsf_-_@tleepslib.sk.tsukuba.ac.jp \
    --to=stephen@xemacs.org \
    --cc=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.