Fix window-body-width on text terminals.
authorEli Zaretskii <eliz@gnu.org>
Tue, 25 Dec 2012 17:37:29 +0000 (19:37 +0200)
committerEli Zaretskii <eliz@gnu.org>
Tue, 25 Dec 2012 17:37:29 +0000 (19:37 +0200)
 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
src/window.c

index dfe3e38..a2b78cf 100644 (file)
@@ -1,3 +1,10 @@
+2012-12-25  Eli Zaretskii  <eliz@gnu.org>
+
+       * 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  <dmantipov@yandex.ru>
 
        * xdisp.c (redisplay_window): Remove inner local variable
index a7d30b7..3fca5b7 100644 (file)
@@ -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;
 }