comparison man/lispref/modes.texi @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents 501cfd01ee6d
children
comparison
equal deleted inserted replaced
411:12e008d41344 412:697ef44129c6
328 @end group 328 @end group
329 329
330 @group 330 @group
331 ;; @r{Set syntax of chars up to 0 to class of chars that are} 331 ;; @r{Set syntax of chars up to 0 to class of chars that are}
332 ;; @r{part of symbol names but not words.} 332 ;; @r{part of symbol names but not words.}
333 ;; @r{(The number 0 is @code{48} in the @sc{ascii} character set.)} 333 ;; @r{(The number 0 is @code{48} in the @sc{ASCII} character set.)}
334 (while (< i ?0) 334 (while (< i ?0)
335 (modify-syntax-entry i "_ " emacs-lisp-mode-syntax-table) 335 (modify-syntax-entry i "_ " emacs-lisp-mode-syntax-table)
336 (setq i (1+ i))) 336 (setq i (1+ i)))
337 @dots{} 337 @dots{}
338 @end group 338 @end group
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{modeline-format}. The data structure is called a @dfn{modeline 923 @code{mode-line-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 string, symbol, glyph, generic 946 A modeline construct may be a list, a symbol, or a string. If the
947 specifier, list or cons cell. 947 value is a list, each element may be a list, a symbol, or a string.
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 processed as a modeline construct, in place of 959 @var{symbol} is used as a modeline construct, in place of @var{symbol}.
960 @var{symbol}. However, the symbols @code{t} and @code{nil} are ignored; 960 However, the symbols @code{t} and @code{nil} are ignored; so is any
961 so is any symbol whose value is void. 961 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.
974 965
975 @item (@var{string} @var{rest}@dots{}) @r{or} (@var{list} @var{rest}@dots{}) 966 @item (@var{string} @var{rest}@dots{}) @r{or} (@var{list} @var{rest}@dots{})
976 A list whose first element is a string or list means to process all the 967 A list whose first element is a string or list means to process all the
977 elements recursively and concatenate the results. This is the most 968 elements recursively and concatenate the results. This is the most
978 common form of mode line construct. 969 common form of mode line construct.
994 @var{width} is positive) or truncated (to @minus{}@var{width} columns, 985 @var{width} is positive) or truncated (to @minus{}@var{width} columns,
995 if @var{width} is negative) on the right. 986 if @var{width} is negative) on the right.
996 987
997 For example, the usual way to show what percentage of a buffer is above 988 For example, the usual way to show what percentage of a buffer is above
998 the top of the window is to use a list like this: @code{(-3 "%p")}. 989 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.
1012 @end table 990 @end table
1013 991
1014 If you do alter @code{modeline-format} itself, the new value should 992 If you do alter @code{modeline-format} itself, the new value should
1015 use the same variables that appear in the default value (@pxref{Modeline 993 use the same variables that appear in the default value (@pxref{Modeline
1016 Variables}), rather than duplicating their contents or displaying 994 Variables}), rather than duplicating their contents or displaying
1222 The status of the subprocess belonging to the current buffer, obtained with 1200 The status of the subprocess belonging to the current buffer, obtained with
1223 @code{process-status}. @xref{Process Information}. 1201 @code{process-status}. @xref{Process Information}.
1224 1202
1225 @c The following two may only apply in XEmacs. 1203 @c The following two may only apply in XEmacs.
1226 @item %l 1204 @item %l
1227 The current line number. 1205 the current line number.
1228 1206
1229 @item %S 1207 @item %S
1230 The name of the selected frame; this is only meaningful under the 1208 the name of the selected frame; this is only meaningful under the
1231 X Window System. @xref{Frame Name}. 1209 X Window System. @xref{Frame Name}.
1232 1210
1233 @item %t 1211 @item %t
1234 Whether the visited file is a text file or a binary file. (This is a 1212 Whether the visited file is a text file or a binary file. (This is a
1235 meaningful distinction only on certain operating systems.) 1213 meaningful distinction only on certain operating systems.)
1245 visible on screen; or @samp{Bottom} or @samp{All}. 1223 visible on screen; or @samp{Bottom} or @samp{All}.
1246 1224
1247 @item %n 1225 @item %n
1248 @samp{Narrow} when narrowing is in effect; nothing otherwise (see 1226 @samp{Narrow} when narrowing is in effect; nothing otherwise (see
1249 @code{narrow-to-region} in @ref{Narrowing}). 1227 @code{narrow-to-region} in @ref{Narrowing}).
1250
1251 @item %C
1252 Under XEmacs/mule, the mnemonic for @code{buffer-file-coding-system}.
1253 1228
1254 @item %[ 1229 @item %[
1255 An indication of the depth of recursive editing levels (not counting 1230 An indication of the depth of recursive editing levels (not counting
1256 minibuffer levels): one @samp{[} for each editing level. 1231 minibuffer levels): one @samp{[} for each editing level.
1257 @xref{Recursive Editing}. 1232 @xref{Recursive Editing}.