diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/elisp/display-tables.html | |
new repository
Diffstat (limited to 'devdocs/elisp/display-tables.html')
| -rw-r--r-- | devdocs/elisp/display-tables.html | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/devdocs/elisp/display-tables.html b/devdocs/elisp/display-tables.html new file mode 100644 index 00000000..cc04b654 --- /dev/null +++ b/devdocs/elisp/display-tables.html @@ -0,0 +1,32 @@ + <h4 class="subsection">Display Tables</h4> <p>A display table is a special-purpose char-table (see <a href="char_002dtables">Char-Tables</a>), with <code>display-table</code> as its subtype, which is used to override the usual character display conventions. This section describes how to make, inspect, and assign elements to a display table object. The next section (see <a href="active-display-table">Active Display Table</a>) describes the various standard display tables and their precedence. </p> <dl> <dt id="make-display-table">Function: <strong>make-display-table</strong> +</dt> <dd><p>This creates and returns a display table. The table initially has <code>nil</code> in all elements. </p></dd> +</dl> <p>The ordinary elements of the display table are indexed by character codes; the element at index <var>c</var> says how to display the character code <var>c</var>. The value should be <code>nil</code> (which means to display the character <var>c</var> according to the usual display conventions; see <a href="usual-display">Usual Display</a>), or a vector of glyph codes (which means to display the character <var>c</var> as those glyphs; see <a href="glyphs">Glyphs</a>). </p> <p><strong>Warning:</strong> if you use the display table to change the display of newline characters, the whole buffer will be displayed as one long line. </p> <p>The display table also has six <em>extra slots</em> which serve special purposes. Here is a table of their meanings; <code>nil</code> in any slot means to use the default for that slot, as stated below. </p> <dl compact> <dt>0</dt> <dd> +<p>The glyph for the end of a truncated screen line (the default for this is ‘<samp>$</samp>’). See <a href="glyphs">Glyphs</a>. On graphical terminals, Emacs by default uses arrows in the fringes to indicate truncation, so the display table has no effect, unless you disable the fringes (see <a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Fringes.html#Fringes">Window Fringes</a> in <cite>the GNU Emacs Manual</cite>). </p> </dd> <dt>1</dt> <dd> +<p>The glyph for the end of a continued line (the default is ‘<samp>\</samp>’). On graphical terminals, Emacs by default uses curved arrows in the fringes to indicate continuation, so the display table has no effect, unless you disable the fringes. </p> </dd> <dt>2</dt> <dd> +<p>The glyph for indicating a character displayed as an octal character code (the default is ‘<samp>\</samp>’). </p> </dd> <dt>3</dt> <dd> +<p>The glyph for indicating a control character (the default is ‘<samp>^</samp>’). </p> </dd> <dt>4</dt> <dd> +<p>A vector of glyphs for indicating the presence of invisible lines (the default is ‘<samp>...</samp>’). See <a href="selective-display">Selective Display</a>. </p> </dd> <dt>5</dt> <dd><p>The glyph used to draw the border between side-by-side windows (the default is ‘<samp>|</samp>’). See <a href="splitting-windows">Splitting Windows</a>. This currently has effect only on text terminals; on graphical terminals, if vertical scroll bars are supported and in use, a scroll bar separates the two windows, and if there are no vertical scroll bars and no dividers (see <a href="window-dividers">Window Dividers</a>), Emacs uses a thin line to indicate the border. </p></dd> </dl> <p>For example, here is how to construct a display table that mimics the effect of setting <code>ctl-arrow</code> to a non-<code>nil</code> value (see <a href="glyphs">Glyphs</a>, for the function <code>make-glyph-code</code>): </p> <div class="example"> <pre class="example">(setq disptab (make-display-table)) +(dotimes (i 32) + (or (= i ?\t) + (= i ?\n) + (aset disptab i + (vector (make-glyph-code ?^ 'escape-glyph) + (make-glyph-code (+ i 64) 'escape-glyph))))) +(aset disptab 127 + (vector (make-glyph-code ?^ 'escape-glyph) + (make-glyph-code ?? 'escape-glyph))))) +</pre> +</div> <dl> <dt id="display-table-slot">Function: <strong>display-table-slot</strong> <em>display-table slot</em> +</dt> <dd><p>This function returns the value of the extra slot <var>slot</var> of <var>display-table</var>. The argument <var>slot</var> may be a number from 0 to 5 inclusive, or a slot name (symbol). Valid symbols are <code>truncation</code>, <code>wrap</code>, <code>escape</code>, <code>control</code>, <code>selective-display</code>, and <code>vertical-border</code>. </p></dd> +</dl> <dl> <dt id="set-display-table-slot">Function: <strong>set-display-table-slot</strong> <em>display-table slot value</em> +</dt> <dd><p>This function stores <var>value</var> in the extra slot <var>slot</var> of <var>display-table</var>. The argument <var>slot</var> may be a number from 0 to 5 inclusive, or a slot name (symbol). Valid symbols are <code>truncation</code>, <code>wrap</code>, <code>escape</code>, <code>control</code>, <code>selective-display</code>, and <code>vertical-border</code>. </p></dd> +</dl> <dl> <dt id="describe-display-table">Function: <strong>describe-display-table</strong> <em>display-table</em> +</dt> <dd><p>This function displays a description of the display table <var>display-table</var> in a help buffer. </p></dd> +</dl> <dl> <dt id="describe-current-display-table">Command: <strong>describe-current-display-table</strong> +</dt> <dd><p>This command displays a description of the current display table in a help buffer. </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/Display-Tables.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Display-Tables.html</a> + </p> +</div> |
