aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2012-12-25 19:37:29 +0200
committerEli Zaretskii2012-12-25 19:37:29 +0200
commitf1665bdc87db38350a9fb0b497d2b14afbfa7140 (patch)
tree3bfb612b95842a09dc542e935c95c05c93e3770b /src
parentb764d018bcc73471e2e548772aa5d8ca3a344cd9 (diff)
downloademacs-f1665bdc87db38350a9fb0b497d2b14afbfa7140.tar.gz
emacs-f1665bdc87db38350a9fb0b497d2b14afbfa7140.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/window.c10
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 @@
12012-12-25 Eli Zaretskii <eliz@gnu.org>
2
3 * window.c (window_body_cols): Subtract display margins from the
4 window body width on TTYs as well. See
5 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
6 for the original report.
7
12012-12-25 Dmitry Antipov <dmantipov@yandex.ru> 82012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
2 9
3 * xdisp.c (redisplay_window): Remove inner local variable 10 * 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)
801 occupies one column only. */ 801 occupies one column only. */
802 width -= 1; 802 width -= 1;
803 803
804 /* Display margins cannot be used for normal text. */
805 width -= WINDOW_LEFT_MARGIN_COLS (w) + WINDOW_RIGHT_MARGIN_COLS (w);
806
804 if (FRAME_WINDOW_P (f)) 807 if (FRAME_WINDOW_P (f))
805 /* On window-systems, fringes and display margins cannot be 808 /* On window-systems, fringes cannot be used for normal text. */
806 used for normal text. */ 809 width -= WINDOW_FRINGE_COLS (w);
807 width -= (WINDOW_FRINGE_COLS (w)
808 + WINDOW_LEFT_MARGIN_COLS (w)
809 + WINDOW_RIGHT_MARGIN_COLS (w));
810 810
811 return width; 811 return width;
812} 812}