Commit 9bfd4456 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(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.
parent 73f194f1
...@@ -823,8 +823,8 @@ preserve_other_columns (w) ...@@ -823,8 +823,8 @@ preserve_other_columns (w)
register int vpos; register int vpos;
register struct frame_glyphs *current_frame, *desired_frame; register struct frame_glyphs *current_frame, *desired_frame;
register FRAME_PTR frame = XFRAME (w->frame); register FRAME_PTR frame = XFRAME (w->frame);
int start = XFASTINT (w->left); int start = WINDOW_LEFT_MARGIN (w);
int end = XFASTINT (w->left) + XFASTINT (w->width); int end = WINDOW_RIGHT_EDGE (w);
int bot = XFASTINT (w->top) + XFASTINT (w->height); int bot = XFASTINT (w->top) + XFASTINT (w->height);
current_frame = FRAME_CURRENT_GLYPHS (frame); current_frame = FRAME_CURRENT_GLYPHS (frame);
...@@ -886,8 +886,8 @@ preserve_my_columns (w) ...@@ -886,8 +886,8 @@ preserve_my_columns (w)
register int vpos, fin; register int vpos, fin;
register struct frame_glyphs *l1, *l2; register struct frame_glyphs *l1, *l2;
register FRAME_PTR frame = XFRAME (w->frame); register FRAME_PTR frame = XFRAME (w->frame);
int start = XFASTINT (w->left); int start = WINDOW_LEFT_MARGIN (w);
int end = XFASTINT (w->left) + XFASTINT (w->width); int end = WINDOW_RIGHT_EDGE (w);
int bot = XFASTINT (w->top) + XFASTINT (w->height); int bot = XFASTINT (w->top) + XFASTINT (w->height);
for (vpos = XFASTINT (w->top); vpos < bot; vpos++) for (vpos = XFASTINT (w->top); vpos < bot; vpos++)
...@@ -920,7 +920,7 @@ adjust_window_charstarts (w, vpos, adjust) ...@@ -920,7 +920,7 @@ adjust_window_charstarts (w, vpos, adjust)
int vpos; int vpos;
int adjust; int adjust;
{ {
int left = XFASTINT (w->left); int left = WINDOW_LEFT_MARGIN (w);
int top = XFASTINT (w->top); int top = XFASTINT (w->top);
int right = left + window_internal_width (w); int right = left + window_internal_width (w);
int bottom = top + window_internal_height (w); int bottom = top + window_internal_height (w);
...@@ -948,12 +948,12 @@ verify_charstarts (w) ...@@ -948,12 +948,12 @@ verify_charstarts (w)
int i; int i;
int top = XFASTINT (w->top); int top = XFASTINT (w->top);
int bottom = top + window_internal_height (w); int bottom = top + window_internal_height (w);
int left = XFASTINT (w->left); int left = WINDOW_LEFT_MARGIN (w);
int right = left + window_internal_width (w); int right = left + window_internal_width (w);
int next_line; int next_line;
int truncate = (XINT (w->hscroll) int truncate = (XINT (w->hscroll)
|| (truncate_partial_width_windows || (truncate_partial_width_windows
&& (XFASTINT (w->width) < FRAME_WIDTH (f))) && !WINDOW_FULL_WIDTH_P (w))
|| !NILP (XBUFFER (w->buffer)->truncate_lines)); || !NILP (XBUFFER (w->buffer)->truncate_lines));
for (i = top; i < bottom; i++) for (i = top; i < bottom; i++)
...@@ -1003,7 +1003,7 @@ cancel_my_columns (w) ...@@ -1003,7 +1003,7 @@ cancel_my_columns (w)
register int vpos; register int vpos;
register struct frame_glyphs *desired_glyphs register struct frame_glyphs *desired_glyphs
= FRAME_DESIRED_GLYPHS (XFRAME (w->frame)); = FRAME_DESIRED_GLYPHS (XFRAME (w->frame));
register int start = XFASTINT (w->left); register int start = WINDOW_LEFT_MARGIN (w);
register int bot = XFASTINT (w->top) + XFASTINT (w->height); register int bot = XFASTINT (w->top) + XFASTINT (w->height);
for (vpos = XFASTINT (w->top); vpos < bot; vpos++) for (vpos = XFASTINT (w->top); vpos < bot; vpos++)
...@@ -1042,10 +1042,10 @@ direct_output_for_insert (g) ...@@ -1042,10 +1042,10 @@ direct_output_for_insert (g)
int vpos = FRAME_CURSOR_Y (frame); int vpos = FRAME_CURSOR_Y (frame);
/* Give up if about to continue line. */ /* Give up if about to continue line. */
if (hpos >= XFASTINT (w->left) + window_internal_width (w) - 1 if (hpos >= WINDOW_LEFT_MARGIN (w) + window_internal_width (w) - 1
/* Avoid losing if cursor is in invisible text off left margin */ /* Avoid losing if cursor is in invisible text off left margin */
|| (XINT (w->hscroll) && hpos == XFASTINT (w->left)) || (XINT (w->hscroll) && hpos == WINDOW_LEFT_MARGIN (w))
/* Give up if cursor outside window (in minibuf, probably) */ /* Give up if cursor outside window (in minibuf, probably) */
|| cursor_in_echo_area || cursor_in_echo_area
...@@ -1117,12 +1117,12 @@ direct_output_forward_char (n) ...@@ -1117,12 +1117,12 @@ direct_output_forward_char (n)
int hpos = FRAME_CURSOR_X (frame); int hpos = FRAME_CURSOR_X (frame);
/* Give up if in truncated text at end of line. */ /* Give up if in truncated text at end of line. */
if (hpos >= XFASTINT (w->left) + window_internal_width (w) - 1) if (hpos >= WINDOW_LEFT_MARGIN (w) + window_internal_width (w) - 1)
return 0; return 0;
/* Avoid losing if cursor is in invisible text off left margin /* Avoid losing if cursor is in invisible text off left margin
or about to go off either side of window. */ or about to go off either side of window. */
if ((FRAME_CURSOR_X (frame) == XFASTINT (w->left) if ((FRAME_CURSOR_X (frame) == WINDOW_LEFT_MARGIN (w)
&& (XINT (w->hscroll) || n < 0)) && (XINT (w->hscroll) || n < 0))
|| (n > 0 || (n > 0
&& (FRAME_CURSOR_X (frame) + 1 >= window_internal_width (w) - 1)) && (FRAME_CURSOR_X (frame) + 1 >= window_internal_width (w) - 1))
...@@ -1342,8 +1342,9 @@ update_frame (f, force, inhibit_hairy_id) ...@@ -1342,8 +1342,9 @@ update_frame (f, force, inhibit_hairy_id)
cursor_to (row, col); cursor_to (row, col);
} }
else else
cursor_to (FRAME_CURSOR_Y (f), max (min (FRAME_CURSOR_X (f), cursor_to (FRAME_CURSOR_Y (f),
FRAME_WIDTH (f) - 1), 0)); max (min (FRAME_CURSOR_X (f),
FRAME_WINDOW_WIDTH (f) - 1), 0));
} }
update_end (f); update_end (f);
...@@ -1467,7 +1468,7 @@ buffer_posn_from_coords (window, col, line) ...@@ -1467,7 +1468,7 @@ buffer_posn_from_coords (window, col, line)
int col, line; int col, line;
{ {
int hscroll = XINT (window->hscroll); int hscroll = XINT (window->hscroll);
int window_left = XFASTINT (window->left); int window_left = WINDOW_LEFT_MARGIN (window);
/* The actual width of the window is window->width less one for the /* The actual width of the window is window->width less one for the
DISP_CONTINUE_GLYPH, and less one if it's not the rightmost 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,6 +2084,7 @@ change_frame_size_1 (frame, newheight, newwidth, pretend, delay)
register FRAME_PTR frame; register FRAME_PTR frame;
int newheight, newwidth, pretend, delay; int newheight, newwidth, pretend, delay;
{ {
int new_frame_window_width;
/* If we can't deal with the change now, queue it for later. */ /* If we can't deal with the change now, queue it for later. */
if (delay) if (delay)
{ {
...@@ -2101,13 +2103,14 @@ change_frame_size_1 (frame, newheight, newwidth, pretend, delay) ...@@ -2101,13 +2103,14 @@ change_frame_size_1 (frame, newheight, newwidth, pretend, delay)
newheight = FRAME_HEIGHT (frame); newheight = FRAME_HEIGHT (frame);
if (newwidth == 0) if (newwidth == 0)
newwidth = FRAME_WIDTH (frame); newwidth = FRAME_WIDTH (frame);
new_frame_window_width = FRAME_WINDOW_WIDTH_ARG (frame, newwidth);
/* Round up to the smallest acceptable size. */ /* Round up to the smallest acceptable size. */
check_frame_size (frame, &newheight, &newwidth); check_frame_size (frame, &newheight, &newwidth);
/* If we're not changing the frame size, quit now. */ /* If we're not changing the frame size, quit now. */
if (newheight == FRAME_HEIGHT (frame) if (newheight == FRAME_HEIGHT (frame)
&& newwidth == FRAME_WIDTH (frame)) && new_frame_window_width == FRAME_WINDOW_WIDTH (frame))
return; return;
BLOCK_INPUT; BLOCK_INPUT;
...@@ -2149,11 +2152,11 @@ change_frame_size_1 (frame, newheight, newwidth, pretend, delay) ...@@ -2149,11 +2152,11 @@ change_frame_size_1 (frame, newheight, newwidth, pretend, delay)
#endif #endif
} }
if (newwidth != FRAME_WIDTH (frame)) if (new_frame_window_width != FRAME_WINDOW_WIDTH (frame))
{ {
set_window_width (FRAME_ROOT_WINDOW (frame), newwidth, 0); set_window_width (FRAME_ROOT_WINDOW (frame), new_frame_window_width, 0);
if (FRAME_HAS_MINIBUF_P (frame)) if (FRAME_HAS_MINIBUF_P (frame))
set_window_width (FRAME_MINIBUF_WINDOW (frame), newwidth, 0); set_window_width (FRAME_MINIBUF_WINDOW (frame), new_frame_window_width, 0);
if (FRAME_TERMCAP_P (frame) && !pretend) if (FRAME_TERMCAP_P (frame) && !pretend)
FrameCols = newwidth; FrameCols = newwidth;
...@@ -2168,7 +2171,7 @@ change_frame_size_1 (frame, newheight, newwidth, pretend, delay) ...@@ -2168,7 +2171,7 @@ change_frame_size_1 (frame, newheight, newwidth, pretend, delay)
} }
FRAME_HEIGHT (frame) = newheight; FRAME_HEIGHT (frame) = newheight;
FRAME_WIDTH (frame) = newwidth; SET_FRAME_WIDTH (frame, newwidth);
if (FRAME_CURSOR_X (frame) >= FRAME_WIDTH (frame)) if (FRAME_CURSOR_X (frame) >= FRAME_WIDTH (frame))
FRAME_CURSOR_X (frame) = FRAME_WIDTH (frame) - 1; FRAME_CURSOR_X (frame) = FRAME_WIDTH (frame) - 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment