From f1665bdc87db38350a9fb0b497d2b14afbfa7140 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 25 Dec 2012 19:37:29 +0200 Subject: [PATCH] Fix window-body-width on text terminals. src/window.c (window_body_cols): Subtract display margins from the window body width on TTYs as well. See http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html for the original report. --- src/ChangeLog | 7 +++++++ src/window.c | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index dfe3e3818eb..a2b78cf5679 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2012-12-25 Eli Zaretskii + + * window.c (window_body_cols): Subtract display margins from the + window body width on TTYs as well. See + http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html + for the original report. + 2012-12-25 Dmitry Antipov * xdisp.c (redisplay_window): Remove inner local variable diff --git a/src/window.c b/src/window.c index a7d30b7a467..3fca5b7351e 100644 --- a/src/window.c +++ b/src/window.c @@ -801,12 +801,12 @@ window_body_cols (struct window *w) occupies one column only. */ width -= 1; + /* Display margins cannot be used for normal text. */ + width -= WINDOW_LEFT_MARGIN_COLS (w) + WINDOW_RIGHT_MARGIN_COLS (w); + if (FRAME_WINDOW_P (f)) - /* On window-systems, fringes and display margins cannot be - used for normal text. */ - width -= (WINDOW_FRINGE_COLS (w) - + WINDOW_LEFT_MARGIN_COLS (w) - + WINDOW_RIGHT_MARGIN_COLS (w)); + /* On window-systems, fringes cannot be used for normal text. */ + width -= WINDOW_FRINGE_COLS (w); return width; } -- 2.39.2