GNU Emacs Lisp Reference Manual
%-Constructs in the Mode LineThe following table lists the recognized %-constructs and what they mean. In any construct except `%%', you can add a decimal integer after the `%' to specify how many characters to display.
%bbuffer-name function. See Buffer Names.%fbuffer-file-name function. See Buffer File Name.%F%c%l%*%' if the buffer is read only (see buffer-read-only);*' if the buffer is modified (see buffer-modified-p);-' otherwise. See Buffer Modification.%+*' if the buffer is modified (see buffer-modified-p);%' if the buffer is read only (see buffer-read-only);-' otherwise. This differs from `%*' only for a modified read-only buffer. See Buffer Modification.%&*' if the buffer is modified, and `-' otherwise.%sprocess-status. See Process Information.%t%pTop', `Bottom' or `All'.%PTop' if the top of the buffer is visible on screen; or `Bottom' or `All'.%nNarrow' when narrowing is in effect; nothing otherwise (see narrow-to-region in Narrowing).%[[' for each editing level. See Recursive Editing.%]]' for each recursive editing level (not counting minibuffer levels).%%%'---this is how to include a literal `%' in a string in which %-constructs are allowed.%-The following two %-constructs are still supported, but they are obsolete, since you can get the same results with the variables mode-name and global-mode-string.
%mmode-name.%Mglobal-mode-string. Currently, only display-time modifies the value of global-mode-string.