aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-09-21 01:21:18 +0000
committerRichard M. Stallman1996-09-21 01:21:18 +0000
commit9bfd4456ce7e75f7cb62e0e28c3ed2ee2c632e87 (patch)
tree007f82e58b42702c6023f73bea586c8c0b744c9b
parent73f194f117b0ed1ef809b6c29332a9df9899c1c5 (diff)
downloademacs-9bfd4456ce7e75f7cb62e0e28c3ed2ee2c632e87.tar.gz
emacs-9bfd4456ce7e75f7cb62e0e28c3ed2ee2c632e87.zip
(preserve_other_columns, preserve_my_columns): Use new
macros WINDOW_LEFT_MARGIN and WINDOW_RIGHT_EDGE. (adjust_window_charstarts, verify_charstarts, cancel_my_columns): Use new macro WINDOW_LEFT_MARGIN instead of w->left. (direct_output_for_insert, direct_output_forward_char): Likewise. (buffer_posn_from_coords): Likewise. (verify_charstarts): Use new macro WINDOW_FULL_WIDTH_P. (update_frame): For determining when to wrap the cursor, use the new macro FRAME_WINDOW_WIDTH instead of FRAME_WIDTH; they aren't necessarily the same any more. (change_frame_size_1): Use FRAME_WINDOW_WIDTH to check for changes. Give `set_window_width' the window width value. Use new macro SET_FRAME_WIDTH.
-rw-r--r--src/dispnew.c43
1 files changed, 23 insertions, 20 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index 6edbf446036..57c6903a9ab 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -823,8 +823,8 @@ preserve_other_columns (w)
823 register int vpos; 823 register int vpos;
824 register struct frame_glyphs *current_frame, *desired_frame; 824 register struct frame_glyphs *current_frame, *desired_frame;
825 register FRAME_PTR frame = XFRAME (w->frame); 825 register FRAME_PTR frame = XFRAME (w->frame);
826 int start = XFASTINT (w->left); 826 int start = WINDOW_LEFT_MARGIN (w);
827 int end = XFASTINT (w->left) + XFASTINT (w->width); 827 int end = WINDOW_RIGHT_EDGE (w);
828 int bot = XFASTINT (w->top) + XFASTINT (w->height); 828 int bot = XFASTINT (w->top) + XFASTINT (w->height);
829 829
830 current_frame = FRAME_CURRENT_GLYPHS (frame); 830 current_frame = FRAME_CURRENT_GLYPHS (frame);
@@ -886,8 +886,8 @@ preserve_my_columns (w)
886 register int vpos, fin; 886 register int vpos, fin;
887 register struct frame_glyphs *l1, *l2; 887 register struct frame_glyphs *l1, *l2;
888 register FRAME_PTR frame = XFRAME (w->frame); 888 register FRAME_PTR frame = XFRAME (w->frame);
889 int start = XFASTINT (w->left); 889 int start = WINDOW_LEFT_MARGIN (w);
890 int end = XFASTINT (w->left) + XFASTINT (w->width); 890 int end = WINDOW_RIGHT_EDGE (w);
891 int bot = XFASTINT (w->top) + XFASTINT (w->height); 891 int bot = XFASTINT (w->top) + XFASTINT (w->height);
892 892
893 for (vpos = XFASTINT (w->top); vpos < bot; vpos++) 893 for (vpos = XFASTINT (w->top); vpos < bot; vpos++)
@@ -920,7 +920,7 @@ adjust_window_charstarts (w, vpos, adjust)
920 int vpos; 920 int vpos;
921 int adjust; 921 int adjust;
922{ 922{
923 int left = XFASTINT (w->left); 923 int left = WINDOW_LEFT_MARGIN (w);
924 int top = XFASTINT (w->top); 924 int top = XFASTINT (w->top);
925 int right = left + window_internal_width (w); 925 int right = left + window_internal_width (w);
926 int bottom = top + window_internal_height (w); 926 int bottom = top + window_internal_height (w);
@@ -948,12 +948,12 @@ verify_charstarts (w)
948 int i; 948 int i;
949 int top = XFASTINT (w->top); 949 int top = XFASTINT (w->top);
950 int bottom = top + window_internal_height (w); 950 int bottom = top + window_internal_height (w);
951 int left = XFASTINT (w->left); 951 int left = WINDOW_LEFT_MARGIN (w);
952 int right = left + window_internal_width (w); 952 int right = left + window_internal_width (w);
953 int next_line; 953 int next_line;
954 int truncate = (XINT (w->hscroll) 954 int truncate = (XINT (w->hscroll)
955 || (truncate_partial_width_windows 955 || (truncate_partial_width_windows
956 && (XFASTINT (w->width) < FRAME_WIDTH (f))) 956 && !WINDOW_FULL_WIDTH_P (w))
957 || !NILP (XBUFFER (w->buffer)->truncate_lines)); 957 || !NILP (XBUFFER (w->buffer)->truncate_lines));
958 958
959 for (i = top; i < bottom; i++) 959 for (i = top; i < bottom; i++)
@@ -1003,7 +1003,7 @@ cancel_my_columns (w)
1003 register int vpos; 1003 register int vpos;
1004 register struct frame_glyphs *desired_glyphs 1004 register struct frame_glyphs *desired_glyphs
1005 = FRAME_DESIRED_GLYPHS (XFRAME (w->frame)); 1005 = FRAME_DESIRED_GLYPHS (XFRAME (w->frame));
1006 register int start = XFASTINT (w->left); 1006 register int start = WINDOW_LEFT_MARGIN (w);
1007 register int bot = XFASTINT (w->top) + XFASTINT (w->height); 1007 register int bot = XFASTINT (w->top) + XFASTINT (w->height);
1008 1008
1009 for (vpos = XFASTINT (w->top); vpos < bot; vpos++) 1009 for (vpos = XFASTINT (w->top); vpos < bot; vpos++)
@@ -1042,10 +1042,10 @@ direct_output_for_insert (g)
1042 int vpos = FRAME_CURSOR_Y (frame); 1042 int vpos = FRAME_CURSOR_Y (frame);
1043 1043
1044 /* Give up if about to continue line. */ 1044 /* Give up if about to continue line. */
1045 if (hpos >= XFASTINT (w->left) + window_internal_width (w) - 1 1045 if (hpos >= WINDOW_LEFT_MARGIN (w) + window_internal_width (w) - 1
1046 1046
1047 /* Avoid losing if cursor is in invisible text off left margin */ 1047 /* Avoid losing if cursor is in invisible text off left margin */
1048 || (XINT (w->hscroll) && hpos == XFASTINT (w->left)) 1048 || (XINT (w->hscroll) && hpos == WINDOW_LEFT_MARGIN (w))
1049 1049
1050 /* Give up if cursor outside window (in minibuf, probably) */ 1050 /* Give up if cursor outside window (in minibuf, probably) */
1051 || cursor_in_echo_area 1051 || cursor_in_echo_area
@@ -1117,12 +1117,12 @@ direct_output_forward_char (n)
1117 int hpos = FRAME_CURSOR_X (frame); 1117 int hpos = FRAME_CURSOR_X (frame);
1118 1118
1119 /* Give up if in truncated text at end of line. */ 1119 /* Give up if in truncated text at end of line. */
1120 if (hpos >= XFASTINT (w->left) + window_internal_width (w) - 1) 1120 if (hpos >= WINDOW_LEFT_MARGIN (w) + window_internal_width (w) - 1)
1121 return 0; 1121 return 0;
1122 1122
1123 /* Avoid losing if cursor is in invisible text off left margin 1123 /* Avoid losing if cursor is in invisible text off left margin
1124 or about to go off either side of window. */ 1124 or about to go off either side of window. */
1125 if ((FRAME_CURSOR_X (frame) == XFASTINT (w->left) 1125 if ((FRAME_CURSOR_X (frame) == WINDOW_LEFT_MARGIN (w)
1126 && (XINT (w->hscroll) || n < 0)) 1126 && (XINT (w->hscroll) || n < 0))
1127 || (n > 0 1127 || (n > 0
1128 && (FRAME_CURSOR_X (frame) + 1 >= window_internal_width (w) - 1)) 1128 && (FRAME_CURSOR_X (frame) + 1 >= window_internal_width (w) - 1))
@@ -1342,8 +1342,9 @@ update_frame (f, force, inhibit_hairy_id)
1342 cursor_to (row, col); 1342 cursor_to (row, col);
1343 } 1343 }
1344 else 1344 else
1345 cursor_to (FRAME_CURSOR_Y (f), max (min (FRAME_CURSOR_X (f), 1345 cursor_to (FRAME_CURSOR_Y (f),
1346 FRAME_WIDTH (f) - 1), 0)); 1346 max (min (FRAME_CURSOR_X (f),
1347 FRAME_WINDOW_WIDTH (f) - 1), 0));
1347 } 1348 }
1348 1349
1349 update_end (f); 1350 update_end (f);
@@ -1467,7 +1468,7 @@ buffer_posn_from_coords (window, col, line)
1467 int col, line; 1468 int col, line;
1468{ 1469{
1469 int hscroll = XINT (window->hscroll); 1470 int hscroll = XINT (window->hscroll);
1470 int window_left = XFASTINT (window->left); 1471 int window_left = WINDOW_LEFT_MARGIN (window);
1471 1472
1472 /* The actual width of the window is window->width less one for the 1473 /* The actual width of the window is window->width less one for the
1473 DISP_CONTINUE_GLYPH, and less one if it's not the rightmost 1474 DISP_CONTINUE_GLYPH, and less one if it's not the rightmost
@@ -2083,6 +2084,7 @@ change_frame_size_1 (frame, newheight, newwidth, pretend, delay)
2083 register FRAME_PTR frame; 2084 register FRAME_PTR frame;
2084 int newheight, newwidth, pretend, delay; 2085 int newheight, newwidth, pretend, delay;
2085{ 2086{
2087 int new_frame_window_width;
2086 /* If we can't deal with the change now, queue it for later. */ 2088 /* If we can't deal with the change now, queue it for later. */
2087 if (delay) 2089 if (delay)
2088 { 2090 {
@@ -2101,13 +2103,14 @@ change_frame_size_1 (frame, newheight, newwidth, pretend, delay)
2101 newheight = FRAME_HEIGHT (frame); 2103 newheight = FRAME_HEIGHT (frame);
2102 if (newwidth == 0) 2104 if (newwidth == 0)
2103 newwidth = FRAME_WIDTH (frame); 2105 newwidth = FRAME_WIDTH (frame);
2106 new_frame_window_width = FRAME_WINDOW_WIDTH_ARG (frame, newwidth);
2104 2107
2105 /* Round up to the smallest acceptable size. */ 2108 /* Round up to the smallest acceptable size. */
2106 check_frame_size (frame, &newheight, &newwidth); 2109 check_frame_size (frame, &newheight, &newwidth);
2107 2110
2108 /* If we're not changing the frame size, quit now. */ 2111 /* If we're not changing the frame size, quit now. */
2109 if (newheight == FRAME_HEIGHT (frame) 2112 if (newheight == FRAME_HEIGHT (frame)
2110 && newwidth == FRAME_WIDTH (frame)) 2113 && new_frame_window_width == FRAME_WINDOW_WIDTH (frame))
2111 return; 2114 return;
2112 2115
2113 BLOCK_INPUT; 2116 BLOCK_INPUT;
@@ -2149,11 +2152,11 @@ change_frame_size_1 (frame, newheight, newwidth, pretend, delay)
2149#endif 2152#endif
2150 } 2153 }
2151 2154
2152 if (newwidth != FRAME_WIDTH (frame)) 2155 if (new_frame_window_width != FRAME_WINDOW_WIDTH (frame))
2153 { 2156 {
2154 set_window_width (FRAME_ROOT_WINDOW (frame), newwidth, 0); 2157 set_window_width (FRAME_ROOT_WINDOW (frame), new_frame_window_width, 0);
2155 if (FRAME_HAS_MINIBUF_P (frame)) 2158 if (FRAME_HAS_MINIBUF_P (frame))
2156 set_window_width (FRAME_MINIBUF_WINDOW (frame), newwidth, 0); 2159 set_window_width (FRAME_MINIBUF_WINDOW (frame), new_frame_window_width, 0);
2157 2160
2158 if (FRAME_TERMCAP_P (frame) && !pretend) 2161 if (FRAME_TERMCAP_P (frame) && !pretend)
2159 FrameCols = newwidth; 2162 FrameCols = newwidth;
@@ -2168,7 +2171,7 @@ change_frame_size_1 (frame, newheight, newwidth, pretend, delay)
2168 } 2171 }
2169 2172
2170 FRAME_HEIGHT (frame) = newheight; 2173 FRAME_HEIGHT (frame) = newheight;
2171 FRAME_WIDTH (frame) = newwidth; 2174 SET_FRAME_WIDTH (frame, newwidth);
2172 2175
2173 if (FRAME_CURSOR_X (frame) >= FRAME_WIDTH (frame)) 2176 if (FRAME_CURSOR_X (frame) >= FRAME_WIDTH (frame))
2174 FRAME_CURSOR_X (frame) = FRAME_WIDTH (frame) - 1; 2177 FRAME_CURSOR_X (frame) = FRAME_WIDTH (frame) - 1;