diff options
| author | Karl Heuer | 1994-10-04 16:34:57 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-10-04 16:34:57 +0000 |
| commit | d834a2e98cd59c3113fd602a24b2537a2d93cfe3 (patch) | |
| tree | e7412fb2241f3849bf68ba24120fe11ae757ea7a | |
| parent | 64db38486e06cdb992761c49488bba48fe067863 (diff) | |
| download | emacs-d834a2e98cd59c3113fd602a24b2537a2d93cfe3.tar.gz emacs-d834a2e98cd59c3113fd602a24b2537a2d93cfe3.zip | |
(make_window, Fset_window_hscroll, Fset_window_start, set_window_height,
set_window_width, Fset_window_buffer, Fselect_window, temp_output_buffer_show,
make_dummy_parent, Fsplit_window, change_window_height, window_scroll,
Fscroll_left, Fscroll_right, Frecenter, Fmove_to_window_line,
Fset_window_configuration, save_window_save, Fcurrent_window_configuration,
init_window_once): Don't use XFASTINT as an lvalue.
| -rw-r--r-- | src/window.c | 95 |
1 files changed, 49 insertions, 46 deletions
diff --git a/src/window.c b/src/window.c index 4cc0356f6a1..a4c6d7ebad1 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -131,14 +131,17 @@ make_window () | |||
| 131 | Qnil); | 131 | Qnil); |
| 132 | XSETTYPE (val, Lisp_Window); | 132 | XSETTYPE (val, Lisp_Window); |
| 133 | p = XWINDOW (val); | 133 | p = XWINDOW (val); |
| 134 | XFASTINT (p->sequence_number) = ++sequence_number; | 134 | XSETFASTINT (p->sequence_number, ++sequence_number); |
| 135 | XFASTINT (p->left) = XFASTINT (p->top) | 135 | XSETFASTINT (p->left, 0); |
| 136 | = XFASTINT (p->height) = XFASTINT (p->width) | 136 | XSETFASTINT (p->top, 0); |
| 137 | = XFASTINT (p->hscroll) = 0; | 137 | XSETFASTINT (p->height, 0); |
| 138 | XFASTINT (p->last_point_x) = XFASTINT (p->last_point_y) = 0; | 138 | XSETFASTINT (p->width, 0); |
| 139 | XSETFASTINT (p->hscroll, 0); | ||
| 140 | XSETFASTINT (p->last_point_x, 0); | ||
| 141 | XSETFASTINT (p->last_point_y, 0); | ||
| 139 | p->start = Fmake_marker (); | 142 | p->start = Fmake_marker (); |
| 140 | p->pointm = Fmake_marker (); | 143 | p->pointm = Fmake_marker (); |
| 141 | XFASTINT (p->use_time) = 0; | 144 | XSETFASTINT (p->use_time, 0); |
| 142 | p->frame = Qnil; | 145 | p->frame = Qnil; |
| 143 | p->display_table = Qnil; | 146 | p->display_table = Qnil; |
| 144 | p->dedicated = Qnil; | 147 | p->dedicated = Qnil; |
| @@ -295,7 +298,7 @@ NCOL should be zero or positive.") | |||
| 295 | register struct window *w; | 298 | register struct window *w; |
| 296 | 299 | ||
| 297 | CHECK_NUMBER (ncol, 1); | 300 | CHECK_NUMBER (ncol, 1); |
| 298 | if (XINT (ncol) < 0) XFASTINT (ncol) = 0; | 301 | if (XINT (ncol) < 0) XSETFASTINT (ncol, 0); |
| 299 | if (XFASTINT (ncol) >= (1 << (SHORTBITS - 1))) | 302 | if (XFASTINT (ncol) >= (1 << (SHORTBITS - 1))) |
| 300 | args_out_of_range (ncol, Qnil); | 303 | args_out_of_range (ncol, Qnil); |
| 301 | w = decode_window (window); | 304 | w = decode_window (window); |
| @@ -560,7 +563,7 @@ from overriding motion of point in order to display at this exact start.") | |||
| 560 | if (NILP (noforce)) | 563 | if (NILP (noforce)) |
| 561 | w->force_start = Qt; | 564 | w->force_start = Qt; |
| 562 | w->update_mode_line = Qt; | 565 | w->update_mode_line = Qt; |
| 563 | XFASTINT (w->last_modified) = 0; | 566 | XSETFASTINT (w->last_modified, 0); |
| 564 | if (!EQ (window, selected_window)) | 567 | if (!EQ (window, selected_window)) |
| 565 | windows_or_buffers_changed++; | 568 | windows_or_buffers_changed++; |
| 566 | return pos; | 569 | return pos; |
| @@ -1599,9 +1602,9 @@ set_window_height (window, height, nodelete) | |||
| 1599 | return; | 1602 | return; |
| 1600 | } | 1603 | } |
| 1601 | 1604 | ||
| 1602 | XFASTINT (w->last_modified) = 0; | 1605 | XSETFASTINT (w->last_modified, 0); |
| 1603 | windows_or_buffers_changed++; | 1606 | windows_or_buffers_changed++; |
| 1604 | XFASTINT (w->height) = height; | 1607 | XSETFASTINT (w->height, height); |
| 1605 | if (!NILP (w->hchild)) | 1608 | if (!NILP (w->hchild)) |
| 1606 | { | 1609 | { |
| 1607 | for (child = w->hchild; !NILP (child); child = XWINDOW (child)->next) | 1610 | for (child = w->hchild; !NILP (child); child = XWINDOW (child)->next) |
| @@ -1620,7 +1623,7 @@ set_window_height (window, height, nodelete) | |||
| 1620 | 1623 | ||
| 1621 | opos = lastobot + XFASTINT (c->height); | 1624 | opos = lastobot + XFASTINT (c->height); |
| 1622 | 1625 | ||
| 1623 | XFASTINT (c->top) = lastbot; | 1626 | XSETFASTINT (c->top, lastbot); |
| 1624 | 1627 | ||
| 1625 | pos = (((opos * height) << 1) + oheight) / (oheight << 1); | 1628 | pos = (((opos * height) << 1) + oheight) / (oheight << 1); |
| 1626 | 1629 | ||
| @@ -1660,9 +1663,9 @@ set_window_width (window, width, nodelete) | |||
| 1660 | return; | 1663 | return; |
| 1661 | } | 1664 | } |
| 1662 | 1665 | ||
| 1663 | XFASTINT (w->last_modified) = 0; | 1666 | XSETFASTINT (w->last_modified, 0); |
| 1664 | windows_or_buffers_changed++; | 1667 | windows_or_buffers_changed++; |
| 1665 | XFASTINT (w->width) = width; | 1668 | XSETFASTINT (w->width, width); |
| 1666 | if (!NILP (w->vchild)) | 1669 | if (!NILP (w->vchild)) |
| 1667 | { | 1670 | { |
| 1668 | for (child = w->vchild; !NILP (child); child = XWINDOW (child)->next) | 1671 | for (child = w->vchild; !NILP (child); child = XWINDOW (child)->next) |
| @@ -1681,7 +1684,7 @@ set_window_width (window, width, nodelete) | |||
| 1681 | 1684 | ||
| 1682 | opos = lastoright + XFASTINT (c->width); | 1685 | opos = lastoright + XFASTINT (c->width); |
| 1683 | 1686 | ||
| 1684 | XFASTINT (c->left) = lastright; | 1687 | XSETFASTINT (c->left, lastright); |
| 1685 | 1688 | ||
| 1686 | pos = (((opos * width) << 1) + owidth) / (owidth << 1); | 1689 | pos = (((opos * width) << 1) + owidth) / (owidth << 1); |
| 1687 | 1690 | ||
| @@ -1732,9 +1735,9 @@ BUFFER can be a buffer or buffer name.") | |||
| 1732 | } | 1735 | } |
| 1733 | 1736 | ||
| 1734 | w->buffer = buffer; | 1737 | w->buffer = buffer; |
| 1735 | XFASTINT (w->window_end_pos) = 0; | 1738 | XSETFASTINT (w->window_end_pos, 0); |
| 1736 | w->window_end_valid = Qnil; | 1739 | w->window_end_valid = Qnil; |
| 1737 | XFASTINT(w->hscroll) = 0; | 1740 | XSETFASTINT(w->hscroll, 0); |
| 1738 | Fset_marker (w->pointm, | 1741 | Fset_marker (w->pointm, |
| 1739 | make_number (BUF_PT (XBUFFER (buffer))), | 1742 | make_number (BUF_PT (XBUFFER (buffer))), |
| 1740 | buffer); | 1743 | buffer); |
| @@ -1743,7 +1746,7 @@ BUFFER can be a buffer or buffer name.") | |||
| 1743 | buffer); | 1746 | buffer); |
| 1744 | w->start_at_line_beg = Qnil; | 1747 | w->start_at_line_beg = Qnil; |
| 1745 | w->force_start = Qnil; | 1748 | w->force_start = Qnil; |
| 1746 | XFASTINT (w->last_modified) = 0; | 1749 | XSETFASTINT (w->last_modified, 0); |
| 1747 | windows_or_buffers_changed++; | 1750 | windows_or_buffers_changed++; |
| 1748 | if (EQ (window, selected_window)) | 1751 | if (EQ (window, selected_window)) |
| 1749 | Fset_buffer (buffer); | 1752 | Fset_buffer (buffer); |
| @@ -1768,7 +1771,7 @@ before each command.") | |||
| 1768 | if (NILP (w->buffer)) | 1771 | if (NILP (w->buffer)) |
| 1769 | error ("Trying to select deleted window or non-leaf window"); | 1772 | error ("Trying to select deleted window or non-leaf window"); |
| 1770 | 1773 | ||
| 1771 | XFASTINT (w->use_time) = ++window_select_count; | 1774 | XSETFASTINT (w->use_time, ++window_select_count); |
| 1772 | if (EQ (window, selected_window)) | 1775 | if (EQ (window, selected_window)) |
| 1773 | return window; | 1776 | return window; |
| 1774 | 1777 | ||
| @@ -2004,7 +2007,7 @@ temp_output_buffer_show (buf) | |||
| 2004 | #endif /* MULTI_FRAME */ | 2007 | #endif /* MULTI_FRAME */ |
| 2005 | Vminibuf_scroll_window = window; | 2008 | Vminibuf_scroll_window = window; |
| 2006 | w = XWINDOW (window); | 2009 | w = XWINDOW (window); |
| 2007 | XFASTINT (w->hscroll) = 0; | 2010 | XSETFASTINT (w->hscroll, 0); |
| 2008 | set_marker_restricted (w->start, make_number (1), buf); | 2011 | set_marker_restricted (w->start, make_number (1), buf); |
| 2009 | set_marker_restricted (w->pointm, make_number (1), buf); | 2012 | set_marker_restricted (w->pointm, make_number (1), buf); |
| 2010 | } | 2013 | } |
| @@ -2024,7 +2027,7 @@ make_dummy_parent (window) | |||
| 2024 | 2027 | ||
| 2025 | o = XWINDOW (old); | 2028 | o = XWINDOW (old); |
| 2026 | p = XWINDOW (new); | 2029 | p = XWINDOW (new); |
| 2027 | XFASTINT (p->sequence_number) = ++sequence_number; | 2030 | XSETFASTINT (p->sequence_number, ++sequence_number); |
| 2028 | 2031 | ||
| 2029 | /* Put new into window structure in place of window */ | 2032 | /* Put new into window structure in place of window */ |
| 2030 | replace_window (window, new); | 2033 | replace_window (window, new); |
| @@ -2133,17 +2136,17 @@ and put SIZE columns in the first of the pair.") | |||
| 2133 | { | 2136 | { |
| 2134 | p->height = o->height; | 2137 | p->height = o->height; |
| 2135 | p->top = o->top; | 2138 | p->top = o->top; |
| 2136 | XFASTINT (p->width) = XFASTINT (o->width) - size; | 2139 | XSETFASTINT (p->width, XFASTINT (o->width) - size); |
| 2137 | XFASTINT (o->width) = size; | 2140 | XSETFASTINT (o->width, size); |
| 2138 | XFASTINT (p->left) = XFASTINT (o->left) + size; | 2141 | XSETFASTINT (p->left, XFASTINT (o->left) + size); |
| 2139 | } | 2142 | } |
| 2140 | else | 2143 | else |
| 2141 | { | 2144 | { |
| 2142 | p->left = o->left; | 2145 | p->left = o->left; |
| 2143 | p->width = o->width; | 2146 | p->width = o->width; |
| 2144 | XFASTINT (p->height) = XFASTINT (o->height) - size; | 2147 | XSETFASTINT (p->height, XFASTINT (o->height) - size); |
| 2145 | XFASTINT (o->height) = size; | 2148 | XSETFASTINT (o->height, size); |
| 2146 | XFASTINT (p->top) = XFASTINT (o->top) + size; | 2149 | XSETFASTINT (p->top, XFASTINT (o->top) + size); |
| 2147 | } | 2150 | } |
| 2148 | 2151 | ||
| 2149 | return new; | 2152 | return new; |
| @@ -2309,7 +2312,7 @@ change_window_height (delta, widthflag) | |||
| 2309 | (*setsizefun) (parent, opht, 0); | 2312 | (*setsizefun) (parent, opht, 0); |
| 2310 | } | 2313 | } |
| 2311 | 2314 | ||
| 2312 | XFASTINT (p->last_modified) = 0; | 2315 | XSETFASTINT (p->last_modified, 0); |
| 2313 | } | 2316 | } |
| 2314 | #undef MINSIZE | 2317 | #undef MINSIZE |
| 2315 | #undef CURBEG | 2318 | #undef CURBEG |
| @@ -2381,13 +2384,13 @@ window_scroll (window, n, noerror) | |||
| 2381 | int lose; | 2384 | int lose; |
| 2382 | Lisp_Object bolp, nmoved; | 2385 | Lisp_Object bolp, nmoved; |
| 2383 | 2386 | ||
| 2384 | XFASTINT (tem) = PT; | 2387 | XSETFASTINT (tem, PT); |
| 2385 | tem = Fpos_visible_in_window_p (tem, window); | 2388 | tem = Fpos_visible_in_window_p (tem, window); |
| 2386 | 2389 | ||
| 2387 | if (NILP (tem)) | 2390 | if (NILP (tem)) |
| 2388 | { | 2391 | { |
| 2389 | Fvertical_motion (make_number (- (ht / 2)), window); | 2392 | Fvertical_motion (make_number (- (ht / 2)), window); |
| 2390 | XFASTINT (tem) = PT; | 2393 | XSETFASTINT (tem, PT); |
| 2391 | Fset_marker (w->start, tem, w->buffer); | 2394 | Fset_marker (w->start, tem, w->buffer); |
| 2392 | w->force_start = Qt; | 2395 | w->force_start = Qt; |
| 2393 | } | 2396 | } |
| @@ -2412,7 +2415,7 @@ window_scroll (window, n, noerror) | |||
| 2412 | set_marker_restricted (w->start, make_number (pos), w->buffer); | 2415 | set_marker_restricted (w->start, make_number (pos), w->buffer); |
| 2413 | w->start_at_line_beg = bolp; | 2416 | w->start_at_line_beg = bolp; |
| 2414 | w->update_mode_line = Qt; | 2417 | w->update_mode_line = Qt; |
| 2415 | XFASTINT (w->last_modified) = 0; | 2418 | XSETFASTINT (w->last_modified, 0); |
| 2416 | if (pos > opoint) | 2419 | if (pos > opoint) |
| 2417 | SET_PT (pos); | 2420 | SET_PT (pos); |
| 2418 | if (n < 0) | 2421 | if (n < 0) |
| @@ -2591,7 +2594,7 @@ Default for ARG is window width minus 2.") | |||
| 2591 | { | 2594 | { |
| 2592 | 2595 | ||
| 2593 | if (NILP (arg)) | 2596 | if (NILP (arg)) |
| 2594 | XFASTINT (arg) = window_internal_width (XWINDOW (selected_window)) - 2; | 2597 | XSETFASTINT (arg, window_internal_width (XWINDOW (selected_window)) - 2); |
| 2595 | else | 2598 | else |
| 2596 | arg = Fprefix_numeric_value (arg); | 2599 | arg = Fprefix_numeric_value (arg); |
| 2597 | 2600 | ||
| @@ -2608,7 +2611,7 @@ Default for ARG is window width minus 2.") | |||
| 2608 | register Lisp_Object arg; | 2611 | register Lisp_Object arg; |
| 2609 | { | 2612 | { |
| 2610 | if (NILP (arg)) | 2613 | if (NILP (arg)) |
| 2611 | XFASTINT (arg) = window_internal_width (XWINDOW (selected_window)) - 2; | 2614 | XSETFASTINT (arg, window_internal_width (XWINDOW (selected_window)) - 2); |
| 2612 | else | 2615 | else |
| 2613 | arg = Fprefix_numeric_value (arg); | 2616 | arg = Fprefix_numeric_value (arg); |
| 2614 | 2617 | ||
| @@ -2637,11 +2640,11 @@ redraws with point in the center of the current window.") | |||
| 2637 | extern int frame_garbaged; | 2640 | extern int frame_garbaged; |
| 2638 | 2641 | ||
| 2639 | SET_FRAME_GARBAGED (XFRAME (WINDOW_FRAME (w))); | 2642 | SET_FRAME_GARBAGED (XFRAME (WINDOW_FRAME (w))); |
| 2640 | XFASTINT (n) = ht / 2; | 2643 | XSETFASTINT (n, ht / 2); |
| 2641 | } | 2644 | } |
| 2642 | else if (CONSP (n)) /* Just C-u. */ | 2645 | else if (CONSP (n)) /* Just C-u. */ |
| 2643 | { | 2646 | { |
| 2644 | XFASTINT (n) = ht / 2; | 2647 | XSETFASTINT (n, ht / 2); |
| 2645 | } | 2648 | } |
| 2646 | else | 2649 | else |
| 2647 | { | 2650 | { |
| @@ -2680,7 +2683,7 @@ negative means relative to bottom of window.") | |||
| 2680 | Lisp_Object window; | 2683 | Lisp_Object window; |
| 2681 | 2684 | ||
| 2682 | if (NILP (arg)) | 2685 | if (NILP (arg)) |
| 2683 | XFASTINT (arg) = height / 2; | 2686 | XSETFASTINT (arg, height / 2); |
| 2684 | else | 2687 | else |
| 2685 | { | 2688 | { |
| 2686 | arg = Fprefix_numeric_value (arg); | 2689 | arg = Fprefix_numeric_value (arg); |
| @@ -2876,7 +2879,7 @@ by `current-window-configuration' (which see).") | |||
| 2876 | w->height = p->height; | 2879 | w->height = p->height; |
| 2877 | w->hscroll = p->hscroll; | 2880 | w->hscroll = p->hscroll; |
| 2878 | w->display_table = p->display_table; | 2881 | w->display_table = p->display_table; |
| 2879 | XFASTINT (w->last_modified) = 0; | 2882 | XSETFASTINT (w->last_modified, 0); |
| 2880 | 2883 | ||
| 2881 | /* Reinstall the saved buffer and pointers into it. */ | 2884 | /* Reinstall the saved buffer and pointers into it. */ |
| 2882 | if (NILP (p->buffer)) | 2885 | if (NILP (p->buffer)) |
| @@ -3036,7 +3039,7 @@ save_window_save (window, vector, i) | |||
| 3036 | p = SAVED_WINDOW_N (vector, i); | 3039 | p = SAVED_WINDOW_N (vector, i); |
| 3037 | w = XWINDOW (window); | 3040 | w = XWINDOW (window); |
| 3038 | 3041 | ||
| 3039 | XFASTINT (w->temslot) = i++; | 3042 | XSETFASTINT (w->temslot, i++); |
| 3040 | p->window = window; | 3043 | p->window = window; |
| 3041 | p->buffer = w->buffer; | 3044 | p->buffer = w->buffer; |
| 3042 | p->left = w->left; | 3045 | p->left = w->left; |
| @@ -3123,9 +3126,9 @@ redirection (see `redirect-frame-focus').") | |||
| 3123 | data = (struct save_window_data *) | 3126 | data = (struct save_window_data *) |
| 3124 | XVECTOR (Fmake_vector (make_number (SAVE_WINDOW_DATA_SIZE), | 3127 | XVECTOR (Fmake_vector (make_number (SAVE_WINDOW_DATA_SIZE), |
| 3125 | Qnil)); | 3128 | Qnil)); |
| 3126 | XFASTINT (data->frame_width) = FRAME_WIDTH (f); | 3129 | XSETFASTINT (data->frame_width, FRAME_WIDTH (f)); |
| 3127 | XFASTINT (data->frame_height) = FRAME_HEIGHT (f); | 3130 | XSETFASTINT (data->frame_height, FRAME_HEIGHT (f)); |
| 3128 | XFASTINT (data->frame_menu_bar_lines) = FRAME_MENU_BAR_LINES (f); | 3131 | XSETFASTINT (data->frame_menu_bar_lines, FRAME_MENU_BAR_LINES (f)); |
| 3129 | #ifdef MULTI_FRAME | 3132 | #ifdef MULTI_FRAME |
| 3130 | XSETFRAME (data->selected_frame, selected_frame); | 3133 | XSETFRAME (data->selected_frame, selected_frame); |
| 3131 | #endif | 3134 | #endif |
| @@ -3188,12 +3191,12 @@ init_window_once () | |||
| 3188 | just so that there is "something there." | 3191 | just so that there is "something there." |
| 3189 | Correct values are put in in init_xdisp */ | 3192 | Correct values are put in in init_xdisp */ |
| 3190 | 3193 | ||
| 3191 | XFASTINT (XWINDOW (FRAME_ROOT_WINDOW (selected_frame))->width) = 10; | 3194 | XSETFASTINT (XWINDOW (FRAME_ROOT_WINDOW (selected_frame))->width, 10); |
| 3192 | XFASTINT (XWINDOW (minibuf_window)->width) = 10; | 3195 | XSETFASTINT (XWINDOW (minibuf_window)->width, 10); |
| 3193 | 3196 | ||
| 3194 | XFASTINT (XWINDOW (FRAME_ROOT_WINDOW (selected_frame))->height) = 9; | 3197 | XSETFASTINT (XWINDOW (FRAME_ROOT_WINDOW (selected_frame))->height, 9); |
| 3195 | XFASTINT (XWINDOW (minibuf_window)->top) = 9; | 3198 | XSETFASTINT (XWINDOW (minibuf_window)->top, 9); |
| 3196 | XFASTINT (XWINDOW (minibuf_window)->height) = 1; | 3199 | XSETFASTINT (XWINDOW (minibuf_window)->height, 1); |
| 3197 | 3200 | ||
| 3198 | /* Prevent error in Fset_window_buffer. */ | 3201 | /* Prevent error in Fset_window_buffer. */ |
| 3199 | XWINDOW (FRAME_ROOT_WINDOW (selected_frame))->buffer = Qt; | 3202 | XWINDOW (FRAME_ROOT_WINDOW (selected_frame))->buffer = Qt; |
| @@ -3209,7 +3212,7 @@ init_window_once () | |||
| 3209 | a newly-created, never-selected window. Increment | 3212 | a newly-created, never-selected window. Increment |
| 3210 | window_select_count so the first selection ever will get | 3213 | window_select_count so the first selection ever will get |
| 3211 | something newer than this. */ | 3214 | something newer than this. */ |
| 3212 | XFASTINT (XWINDOW (selected_window)->use_time) = ++window_select_count; | 3215 | XSETFASTINT (XWINDOW (selected_window)->use_time, ++window_select_count); |
| 3213 | #endif /* not MULTI_FRAME */ | 3216 | #endif /* not MULTI_FRAME */ |
| 3214 | } | 3217 | } |
| 3215 | 3218 | ||