Truncation
When a line of text extends beyond the right edge of a window, Emacs can continue the line (make it wrap to the next screen line), or truncate the line (limit it to one screen line). The additional screen lines used to display a long text line are called continuation lines. Continuation is not the same as filling; continuation happens on the screen only, not in the buffer contents, and it breaks a line precisely at the right margin, not at a word boundary. See Filling.
On a graphical display, tiny arrow images in the window fringes indicate truncated and continued lines (see Fringes). On a text terminal, a ‘$’ in the rightmost column of the window indicates truncation; a ‘\’ on the rightmost column indicates a line that wraps. (The display table can specify alternate characters to use for this; see Display Tables).
- User Option: truncate-lines
If this buffer-local variable is non-
nil
, lines that extend beyond the right edge of the window are truncated; otherwise, they are continued. As a special exception, the variabletruncate-partial-width-windows
takes precedence in partial-width windows (i.e., windows that do not occupy the entire frame width).
- User Option: truncate-partial-width-windows
-
This variable controls line truncation in partial-width windows. A partial-width window is one that does not occupy the entire frame width (see Splitting Windows). If the value is
nil
, line truncation is determined by the variabletruncate-lines
(see above). If the value is an integer n, lines are truncated if the partial-width window has fewer than n columns, regardless of the value oftruncate-lines
; if the partial-width window has n or more columns, line truncation is determined bytruncate-lines
. For any other non-nil
value, lines are truncated in every partial-width window, regardless of the value oftruncate-lines
.
When horizontal scrolling (see Horizontal Scrolling) is in use in a window, that forces truncation.
- Variable: wrap-prefix
-
If this buffer-local variable is non-
nil
, it defines a wrap prefix which Emacs displays at the start of every continuation line. (If lines are truncated,wrap-prefix
is never used.) Its value may be a string or an image (see Other Display Specs), or a stretch of whitespace such as specified by the:width
or:align-to
display properties (see Specified Space). The value is interpreted in the same way as adisplay
text property. See Display Property.A wrap prefix may also be specified for regions of text, using the
wrap-prefix
text or overlay property. This takes precedence over thewrap-prefix
variable. See Special Properties.
- Variable: line-prefix
-
If this buffer-local variable is non-
nil
, it defines a line prefix which Emacs displays at the start of every non-continuation line. Its value may be a string or an image (see Other Display Specs), or a stretch of whitespace such as specified by the:width
or:align-to
display properties (see Specified Space). The value is interpreted in the same way as adisplay
text property. See Display Property.A line prefix may also be specified for regions of text using the
line-prefix
text or overlay property. This takes precedence over theline-prefix
variable. See Special Properties.
Copyright © 1990-1996, 1998-2021 Free Software Foundation, Inc.
Licensed under the GNU GPL license.
https://www.gnu.org/software/emacs/manual/html_node/elisp/Truncation.html