1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
<h4 class="subsection">Constructs in the Mode Line</h4> <p>Strings used as mode line constructs can use certain <code>%</code>-constructs to substitute various kinds of data. The following is a list of the defined <code>%</code>-constructs, and what they mean. </p> <p>In any construct except ‘<samp>%%</samp>’, you can add a decimal integer after the ‘<samp>%</samp>’ to specify a minimum field width. If the width is less, the field is padded to that width. Purely numeric constructs (‘<samp>c</samp>’, ‘<samp>i</samp>’, ‘<samp>I</samp>’, and ‘<samp>l</samp>’) are padded by inserting spaces to the left, and others are padded by inserting spaces to the right. </p> <dl compact> <dt><code>%b</code></dt> <dd>
<p>The current buffer name, obtained with the <code>buffer-name</code> function. See <a href="buffer-names">Buffer Names</a>. </p> </dd> <dt><code>%c</code></dt> <dd>
<p>The current column number of point, counting from zero starting at the left margin of the window. </p> </dd> <dt><code>%C</code></dt> <dd>
<p>The current column number of point, counting from one starting at the left margin of the window. </p> </dd> <dt><code>%e</code></dt> <dd>
<p>When Emacs is nearly out of memory for Lisp objects, a brief message saying so. Otherwise, this is empty. </p> </dd> <dt><code>%f</code></dt> <dd>
<p>The visited file name, obtained with the <code>buffer-file-name</code> function. See <a href="buffer-file-name">Buffer File Name</a>. </p> </dd> <dt><code>%F</code></dt> <dd>
<p>The title (only on a window system) or the name of the selected frame. See <a href="basic-parameters">Basic Parameters</a>. </p> </dd> <dt><code>%i</code></dt> <dd>
<p>The size of the accessible part of the current buffer; basically <code>(- (point-max) (point-min))</code>. </p> </dd> <dt><code>%I</code></dt> <dd>
<p>Like ‘<samp>%i</samp>’, but the size is printed in a more readable way by using ‘<samp>k</samp>’ for 10^3, ‘<samp>M</samp>’ for 10^6, ‘<samp>G</samp>’ for 10^9, etc., to abbreviate. </p> </dd> <dt><code>%l</code></dt> <dd>
<p>The current line number of point, counting within the accessible portion of the buffer. </p> </dd> <dt><code>%n</code></dt> <dd>
<p>‘<samp>Narrow</samp>’ when narrowing is in effect; nothing otherwise (see <code>narrow-to-region</code> in <a href="narrowing">Narrowing</a>). </p> </dd> <dt><code>%o</code></dt> <dd>
<p>The degree of <em>travel</em> of the window through (the visible portion of) the buffer, i.e. the size of the text above the top of the window expressed as a percentage of all the text outside the window, or ‘<samp>Top</samp>’, ‘<samp>Bottom</samp>’ or ‘<samp>All</samp>’. </p> </dd> <dt><code>%p</code></dt> <dd>
<p>The percentage of the buffer text above the <strong>top</strong> of window, or ‘<samp>Top</samp>’, ‘<samp>Bottom</samp>’ or ‘<samp>All</samp>’. Note that the default mode line construct truncates this to three characters. </p> </dd> <dt><code>%P</code></dt> <dd>
<p>The percentage of the buffer text that is above the <strong>bottom</strong> of the window (which includes the text visible in the window, as well as the text above the top), plus ‘<samp>Top</samp>’ if the top of the buffer is visible on screen; or ‘<samp>Bottom</samp>’ or ‘<samp>All</samp>’. </p> </dd> <dt><code>%q</code></dt> <dd>
<p>The percentages of text above both the <strong>top</strong> and the <strong>bottom</strong> of the window, separated by ‘<samp>-</samp>’, or ‘<samp>All</samp>’. </p> </dd> <dt><code>%s</code></dt> <dd>
<p>The status of the subprocess belonging to the current buffer, obtained with <code>process-status</code>. See <a href="process-information">Process Information</a>. </p> </dd> <dt><code>%z</code></dt> <dd>
<p>The mnemonics of keyboard, terminal, and buffer coding systems. </p> </dd> <dt><code>%Z</code></dt> <dd>
<p>Like ‘<samp>%z</samp>’, but including the end-of-line format. </p> </dd> <dt><code>%*</code></dt> <dd>
<p>‘<samp>%</samp>’ if the buffer is read only (see <code>buffer-read-only</code>); ‘<samp>*</samp>’ if the buffer is modified (see <code>buffer-modified-p</code>); ‘<samp>-</samp>’ otherwise. See <a href="buffer-modification">Buffer Modification</a>. </p> </dd> <dt><code>%+</code></dt> <dd>
<p>‘<samp>*</samp>’ if the buffer is modified (see <code>buffer-modified-p</code>); ‘<samp>%</samp>’ if the buffer is read only (see <code>buffer-read-only</code>); ‘<samp>-</samp>’ otherwise. This differs from ‘<samp>%*</samp>’ only for a modified read-only buffer. See <a href="buffer-modification">Buffer Modification</a>. </p> </dd> <dt><code>%&</code></dt> <dd>
<p>‘<samp>*</samp>’ if the buffer is modified, and ‘<samp>-</samp>’ otherwise. </p> </dd> <dt><code>%@</code></dt> <dd>
<p>‘<samp>@</samp>’ if the buffer’s <code>default-directory</code> (see <a href="file-name-expansion">File Name Expansion</a>) is on a remote machine, and ‘<samp>-</samp>’ otherwise. </p> </dd> <dt><code>%[</code></dt> <dd>
<p>An indication of the depth of recursive editing levels (not counting minibuffer levels): one ‘<samp>[</samp>’ for each editing level. See <a href="recursive-editing">Recursive Editing</a>. </p> </dd> <dt><code>%]</code></dt> <dd>
<p>One ‘<samp>]</samp>’ for each recursive editing level (not counting minibuffer levels). </p> </dd> <dt><code>%-</code></dt> <dd>
<p>Dashes sufficient to fill the remainder of the mode line. </p> </dd> <dt><code>%%</code></dt> <dd><p>The character ‘<samp>%</samp>’—this is how to include a literal ‘<samp>%</samp>’ in a string in which <code>%</code>-constructs are allowed. </p></dd> </dl> <p>The following <code>%</code>-construct is still supported, but it is obsolete, since you can get the same result using the variable <code>mode-name</code>. </p> <dl compact> <dt><code>%m</code></dt> <dd><p>The value of <code>mode-name</code>. </p></dd> </dl><div class="_attribution">
<p class="_attribution-p">
Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
<a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/_0025_002dConstructs.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/_0025_002dConstructs.html</a>
</p>
</div>
|