comparison man/lispref/modes.texi @ 408:501cfd01ee6d r21-2-34

Import from CVS: tag r21-2-34
author cvs
date Mon, 13 Aug 2007 11:18:11 +0200
parents 74fd4e045ea6
children 697ef44129c6
comparison
equal deleted inserted replaced
407:ed6218a7d4d3 408:501cfd01ee6d
918 @subsection The Data Structure of the Modeline 918 @subsection The Data Structure of the Modeline
919 @cindex modeline construct 919 @cindex modeline construct
920 920
921 The modeline contents are controlled by a data structure of lists, 921 The modeline contents are controlled by a data structure of lists,
922 strings, symbols, and numbers kept in the buffer-local variable 922 strings, symbols, and numbers kept in the buffer-local variable
923 @code{mode-line-format}. The data structure is called a @dfn{modeline 923 @code{modeline-format}. The data structure is called a @dfn{modeline
924 construct}, and it is built in recursive fashion out of simpler modeline 924 construct}, and it is built in recursive fashion out of simpler modeline
925 constructs. The same data structure is used for constructing 925 constructs. The same data structure is used for constructing
926 frame titles (@pxref{Frame Titles}). 926 frame titles (@pxref{Frame Titles}).
927 927
928 @defvar modeline-format 928 @defvar modeline-format
941 of variables such as @code{mode-name} and @code{minor-mode-alist}. 941 of variables such as @code{mode-name} and @code{minor-mode-alist}.
942 Because of this, very few modes need to alter @code{modeline-format}. 942 Because of this, very few modes need to alter @code{modeline-format}.
943 For most purposes, it is sufficient to alter the variables referenced by 943 For most purposes, it is sufficient to alter the variables referenced by
944 @code{modeline-format}. 944 @code{modeline-format}.
945 945
946 A modeline construct may be a list, a symbol, or a string. If the 946 A modeline construct may be a string, symbol, glyph, generic
947 value is a list, each element may be a list, a symbol, or a string. 947 specifier, list or cons cell.
948 948
949 @table @code 949 @table @code
950 @cindex percent symbol in modeline 950 @cindex percent symbol in modeline
951 @item @var{string} 951 @item @var{string}
952 A string as a modeline construct is displayed verbatim in the mode line 952 A string as a modeline construct is displayed verbatim in the mode line
954 specify the field width for space filling on the right (i.e., the data 954 specify the field width for space filling on the right (i.e., the data
955 is left justified). @xref{%-Constructs}. 955 is left justified). @xref{%-Constructs}.
956 956
957 @item @var{symbol} 957 @item @var{symbol}
958 A symbol as a modeline construct stands for its value. The value of 958 A symbol as a modeline construct stands for its value. The value of
959 @var{symbol} is used as a modeline construct, in place of @var{symbol}. 959 @var{symbol} is processed as a modeline construct, in place of
960 However, the symbols @code{t} and @code{nil} are ignored; so is any 960 @var{symbol}. However, the symbols @code{t} and @code{nil} are ignored;
961 symbol whose value is void. 961 so is any symbol whose value is void.
962 962
963 There is one exception: if the value of @var{symbol} is a string, it is 963 There is one exception: if the value of @var{symbol} is a string, it is
964 displayed verbatim: the @code{%}-constructs are not recognized. 964 displayed verbatim: the @code{%}-constructs are not recognized.
965
966 @item @var{glyph}
967 A glyph is displayed as is.
968
969 @item @var{generic-specifier}
970 A @var{generic-specifier} (i.e. a specifier of type @code{generic})
971 stands for its instance. The instance of @var{generic-specifier} is
972 computed in the current window using the equivalent of
973 @code{specifier-instance} and the value is processed.
965 974
966 @item (@var{string} @var{rest}@dots{}) @r{or} (@var{list} @var{rest}@dots{}) 975 @item (@var{string} @var{rest}@dots{}) @r{or} (@var{list} @var{rest}@dots{})
967 A list whose first element is a string or list means to process all the 976 A list whose first element is a string or list means to process all the
968 elements recursively and concatenate the results. This is the most 977 elements recursively and concatenate the results. This is the most
969 common form of mode line construct. 978 common form of mode line construct.
985 @var{width} is positive) or truncated (to @minus{}@var{width} columns, 994 @var{width} is positive) or truncated (to @minus{}@var{width} columns,
986 if @var{width} is negative) on the right. 995 if @var{width} is negative) on the right.
987 996
988 For example, the usual way to show what percentage of a buffer is above 997 For example, the usual way to show what percentage of a buffer is above
989 the top of the window is to use a list like this: @code{(-3 "%p")}. 998 the top of the window is to use a list like this: @code{(-3 "%p")}.
999
1000 @item (@var{extent} @var{rest}@dots{})
1001
1002 A list whose car is an extent means the cdr of the list is processed
1003 normally but the results are displayed using the face of the extent, and
1004 mouse clicks over this section are processed using the keymap of the
1005 extent. (In addition, if the extent has a help-echo property, that
1006 string will be echoed when the mouse moves over this section.) If
1007 extents are nested, all keymaps are properly consulted when processing
1008 mouse clicks, but multiple faces are not correctly merged (only the
1009 first face is used), and lists of faces are not correctly handled.
1010 @c #### Document generate-modeline-string.
1011 @c See `generated-modeline-string' for more information.
990 @end table 1012 @end table
991 1013
992 If you do alter @code{modeline-format} itself, the new value should 1014 If you do alter @code{modeline-format} itself, the new value should
993 use the same variables that appear in the default value (@pxref{Modeline 1015 use the same variables that appear in the default value (@pxref{Modeline
994 Variables}), rather than duplicating their contents or displaying 1016 Variables}), rather than duplicating their contents or displaying
1200 The status of the subprocess belonging to the current buffer, obtained with 1222 The status of the subprocess belonging to the current buffer, obtained with
1201 @code{process-status}. @xref{Process Information}. 1223 @code{process-status}. @xref{Process Information}.
1202 1224
1203 @c The following two may only apply in XEmacs. 1225 @c The following two may only apply in XEmacs.
1204 @item %l 1226 @item %l
1205 the current line number. 1227 The current line number.
1206 1228
1207 @item %S 1229 @item %S
1208 the name of the selected frame; this is only meaningful under the 1230 The name of the selected frame; this is only meaningful under the
1209 X Window System. @xref{Frame Name}. 1231 X Window System. @xref{Frame Name}.
1210 1232
1211 @item %t 1233 @item %t
1212 Whether the visited file is a text file or a binary file. (This is a 1234 Whether the visited file is a text file or a binary file. (This is a
1213 meaningful distinction only on certain operating systems.) 1235 meaningful distinction only on certain operating systems.)
1223 visible on screen; or @samp{Bottom} or @samp{All}. 1245 visible on screen; or @samp{Bottom} or @samp{All}.
1224 1246
1225 @item %n 1247 @item %n
1226 @samp{Narrow} when narrowing is in effect; nothing otherwise (see 1248 @samp{Narrow} when narrowing is in effect; nothing otherwise (see
1227 @code{narrow-to-region} in @ref{Narrowing}). 1249 @code{narrow-to-region} in @ref{Narrowing}).
1250
1251 @item %C
1252 Under XEmacs/mule, the mnemonic for @code{buffer-file-coding-system}.
1228 1253
1229 @item %[ 1254 @item %[
1230 An indication of the depth of recursive editing levels (not counting 1255 An indication of the depth of recursive editing levels (not counting
1231 minibuffer levels): one @samp{[} for each editing level. 1256 minibuffer levels): one @samp{[} for each editing level.
1232 @xref{Recursive Editing}. 1257 @xref{Recursive Editing}.