From 8ee4c52abc98e6522d812a29cfe57ffbdeb98144 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 26 Mar 2016 10:17:12 +0300 Subject: [PATCH] Improve documentatuon of 'truncate-partial-width-windows' * src/xdisp.c (syms_of_xdisp) : Clarify in the doc string how the width of partial-width windows is computed for the purposes of truncation decision. (Bug#4338) * doc/emacs/windows.texi (Split Window): Clarify how the width of windows is calculated for the purposes of truncation decision. * doc/emacs/display.texi (Line Truncation): Remove a redundant index entry. --- doc/emacs/display.texi | 1 - doc/emacs/windows.texi | 12 ++++++++---- src/xdisp.c | 7 +++++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index c8987c279c5..01f899f1c09 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi @@ -1601,7 +1601,6 @@ screen lines. Setting the variable @code{truncate-lines} in any way makes it local to the current buffer; until that time, the default value, which is normally @code{nil}, is in effect. -@vindex truncate-partial-width-windows If a split window becomes too narrow, Emacs may automatically enable line truncation. @xref{Split Window}, for the variable @code{truncate-partial-width-windows} which controls this. diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi index 7587f885a23..702963f75c5 100644 --- a/doc/emacs/windows.texi +++ b/doc/emacs/windows.texi @@ -117,10 +117,14 @@ variable @code{truncate-lines} (@pxref{Line Truncation}); it is instead controlled by the variable @code{truncate-partial-width-windows}. If the value of this variable is a positive integer (the default is 50), that specifies the minimum -width for a partial-width window before automatic line truncation -occurs; if the value is @code{nil}, automatic line truncation is -disabled; and for any other non-@code{nil} value, Emacs truncates -lines in every partial-width window regardless of its width. +total width for a partial-width window before automatic line +truncation occurs; if the value is @code{nil}, automatic line +truncation is disabled; and for any other non-@code{nil} value, Emacs +truncates lines in every partial-width window regardless of its width. +The total width of a window is in column units as reported by +@code{window-total-width} (@pxref{Window Sizes,,, elisp, The Emacs +Lisp Reference Manual}), it includes the fringes, the continuation and +truncation glyphs, the margins, and the scroll bar. On text terminals, side-by-side windows are separated by a vertical divider which is drawn using the @code{vertical-border} face. diff --git a/src/xdisp.c b/src/xdisp.c index d6ee2de8f39..d701306b22c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -31422,8 +31422,11 @@ Value is a number or a cons (WIDTH-DPI . HEIGHT-DPI). */); Vtruncate_partial_width_windows, doc: /* Non-nil means truncate lines in windows narrower than the frame. For an integer value, truncate lines in each window narrower than the -full frame width, provided the window width is less than that integer; -otherwise, respect the value of `truncate-lines'. +full frame width, provided the total window width in column units is less +than that integer; otherwise, respect the value of `truncate-lines'. +The total width of the window is as returned by `window-total-width', it +includes the fringes, the continuation and truncation glyphs, the +display margins (if any), and the scroll bar For any other non-nil value, truncate lines in all windows that do not span the full frame width. -- 2.39.2