diff options
| author | Tom Tromey | 2013-03-08 11:57:29 -0700 |
|---|---|---|
| committer | Tom Tromey | 2013-03-08 11:57:29 -0700 |
| commit | 71f91792e3013b397996905224f387da5cc539a9 (patch) | |
| tree | 4c3d3ba909e76deea1cdf73b73fca67a57149465 /src/window.c | |
| parent | 6f4de085f065e11f4df3195d47479f28f5ef08ba (diff) | |
| parent | b5426561089d39f18b42bed9dbfcb531f43ed562 (diff) | |
| download | emacs-71f91792e3013b397996905224f387da5cc539a9.tar.gz emacs-71f91792e3013b397996905224f387da5cc539a9.zip | |
merge from trunk
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 97 |
1 files changed, 36 insertions, 61 deletions
diff --git a/src/window.c b/src/window.c index 32a6759f9f4..4b30a9d55da 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -116,9 +116,6 @@ Lisp_Object minibuf_selected_window; | |||
| 116 | /* Hook run at end of temp_output_buffer_show. */ | 116 | /* Hook run at end of temp_output_buffer_show. */ |
| 117 | static Lisp_Object Qtemp_buffer_show_hook; | 117 | static Lisp_Object Qtemp_buffer_show_hook; |
| 118 | 118 | ||
| 119 | /* Incremented for each window created. */ | ||
| 120 | static int sequence_number; | ||
| 121 | |||
| 122 | /* Nonzero after init_window_once has finished. */ | 119 | /* Nonzero after init_window_once has finished. */ |
| 123 | static int window_initialized; | 120 | static int window_initialized; |
| 124 | 121 | ||
| @@ -286,6 +283,9 @@ adjust_window_count (struct window *w, int arg) | |||
| 286 | b = b->base_buffer; | 283 | b = b->base_buffer; |
| 287 | b->window_count += arg; | 284 | b->window_count += arg; |
| 288 | eassert (b->window_count >= 0); | 285 | eassert (b->window_count >= 0); |
| 286 | /* These should be recalculated by redisplay code. */ | ||
| 287 | w->window_end_valid = 0; | ||
| 288 | w->base_line_pos = 0; | ||
| 289 | } | 289 | } |
| 290 | } | 290 | } |
| 291 | 291 | ||
| @@ -300,15 +300,6 @@ wset_buffer (struct window *w, Lisp_Object val) | |||
| 300 | adjust_window_count (w, 1); | 300 | adjust_window_count (w, 1); |
| 301 | } | 301 | } |
| 302 | 302 | ||
| 303 | /* Build a frequently used 4-integer (X Y W H) list. */ | ||
| 304 | |||
| 305 | static Lisp_Object | ||
| 306 | list4i (EMACS_INT x, EMACS_INT y, EMACS_INT w, EMACS_INT h) | ||
| 307 | { | ||
| 308 | return list4 (make_number (x), make_number (y), | ||
| 309 | make_number (w), make_number (h)); | ||
| 310 | } | ||
| 311 | |||
| 312 | DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0, | 303 | DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0, |
| 313 | doc: /* Return t if OBJECT is a window and nil otherwise. */) | 304 | doc: /* Return t if OBJECT is a window and nil otherwise. */) |
| 314 | (Lisp_Object object) | 305 | (Lisp_Object object) |
| @@ -1489,17 +1480,8 @@ if it isn't already recorded. */) | |||
| 1489 | CHECK_BUFFER (buf); | 1480 | CHECK_BUFFER (buf); |
| 1490 | b = XBUFFER (buf); | 1481 | b = XBUFFER (buf); |
| 1491 | 1482 | ||
| 1492 | #if 0 /* This change broke some things. We should make it later. */ | ||
| 1493 | /* If we don't know the end position, return nil. | ||
| 1494 | The user can compute it with vertical-motion if he wants to. | ||
| 1495 | It would be nicer to do it automatically, | ||
| 1496 | but that's so slow that it would probably bother people. */ | ||
| 1497 | if (NILP (w->window_end_valid)) | ||
| 1498 | return Qnil; | ||
| 1499 | #endif | ||
| 1500 | |||
| 1501 | if (! NILP (update) | 1483 | if (! NILP (update) |
| 1502 | && (windows_or_buffers_changed || NILP (w->window_end_valid)) | 1484 | && (windows_or_buffers_changed || !w->window_end_valid) |
| 1503 | && !noninteractive) | 1485 | && !noninteractive) |
| 1504 | { | 1486 | { |
| 1505 | struct text_pos startp; | 1487 | struct text_pos startp; |
| @@ -1553,7 +1535,7 @@ Return POS. */) | |||
| 1553 | { | 1535 | { |
| 1554 | register struct window *w = decode_live_window (window); | 1536 | register struct window *w = decode_live_window (window); |
| 1555 | 1537 | ||
| 1556 | CHECK_NUMBER_COERCE_MARKER (pos); | 1538 | /* Type of POS is checked by Fgoto_char or set_marker_restricted ... */ |
| 1557 | 1539 | ||
| 1558 | if (w == XWINDOW (selected_window)) | 1540 | if (w == XWINDOW (selected_window)) |
| 1559 | { | 1541 | { |
| @@ -1563,6 +1545,8 @@ Return POS. */) | |||
| 1563 | { | 1545 | { |
| 1564 | struct buffer *old_buffer = current_buffer; | 1546 | struct buffer *old_buffer = current_buffer; |
| 1565 | 1547 | ||
| 1548 | /* ... but here we want to catch type error before buffer change. */ | ||
| 1549 | CHECK_NUMBER_COERCE_MARKER (pos); | ||
| 1566 | set_buffer_internal (XBUFFER (w->buffer)); | 1550 | set_buffer_internal (XBUFFER (w->buffer)); |
| 1567 | Fgoto_char (pos); | 1551 | Fgoto_char (pos); |
| 1568 | set_buffer_internal (old_buffer); | 1552 | set_buffer_internal (old_buffer); |
| @@ -1588,9 +1572,8 @@ overriding motion of point in order to display at this exact start. */) | |||
| 1588 | { | 1572 | { |
| 1589 | register struct window *w = decode_live_window (window); | 1573 | register struct window *w = decode_live_window (window); |
| 1590 | 1574 | ||
| 1591 | CHECK_NUMBER_COERCE_MARKER (pos); | ||
| 1592 | set_marker_restricted (w->start, pos, w->buffer); | 1575 | set_marker_restricted (w->start, pos, w->buffer); |
| 1593 | /* this is not right, but much easier than doing what is right. */ | 1576 | /* This is not right, but much easier than doing what is right. */ |
| 1594 | w->start_at_line_beg = 0; | 1577 | w->start_at_line_beg = 0; |
| 1595 | if (NILP (noforce)) | 1578 | if (NILP (noforce)) |
| 1596 | w->force_start = 1; | 1579 | w->force_start = 1; |
| @@ -1706,7 +1689,7 @@ Return nil if window display is not up-to-date. In that case, use | |||
| 1706 | b = XBUFFER (w->buffer); | 1689 | b = XBUFFER (w->buffer); |
| 1707 | 1690 | ||
| 1708 | /* Fail if current matrix is not up-to-date. */ | 1691 | /* Fail if current matrix is not up-to-date. */ |
| 1709 | if (NILP (w->window_end_valid) | 1692 | if (!w->window_end_valid |
| 1710 | || current_buffer->clip_changed | 1693 | || current_buffer->clip_changed |
| 1711 | || current_buffer->prevent_redisplay_optimizations_p | 1694 | || current_buffer->prevent_redisplay_optimizations_p |
| 1712 | || w->last_modified < BUF_MODIFF (b) | 1695 | || w->last_modified < BUF_MODIFF (b) |
| @@ -2038,7 +2021,7 @@ replace_window (Lisp_Object old, Lisp_Object new, int setflag) | |||
| 2038 | n->pseudo_window_p = 0; | 2021 | n->pseudo_window_p = 0; |
| 2039 | wset_window_end_vpos (n, make_number (0)); | 2022 | wset_window_end_vpos (n, make_number (0)); |
| 2040 | wset_window_end_pos (n, make_number (0)); | 2023 | wset_window_end_pos (n, make_number (0)); |
| 2041 | wset_window_end_valid (n, Qnil); | 2024 | n->window_end_valid = 0; |
| 2042 | n->frozen_window_start_p = 0; | 2025 | n->frozen_window_start_p = 0; |
| 2043 | } | 2026 | } |
| 2044 | 2027 | ||
| @@ -2238,7 +2221,6 @@ candidate_window_p (Lisp_Object window, Lisp_Object owindow, Lisp_Object minibuf | |||
| 2238 | } | 2221 | } |
| 2239 | else if (EQ (all_frames, Qvisible)) | 2222 | else if (EQ (all_frames, Qvisible)) |
| 2240 | { | 2223 | { |
| 2241 | FRAME_SAMPLE_VISIBILITY (f); | ||
| 2242 | candidate_p = FRAME_VISIBLE_P (f) | 2224 | candidate_p = FRAME_VISIBLE_P (f) |
| 2243 | && (FRAME_TERMINAL (XFRAME (w->frame)) | 2225 | && (FRAME_TERMINAL (XFRAME (w->frame)) |
| 2244 | == FRAME_TERMINAL (XFRAME (selected_frame))); | 2226 | == FRAME_TERMINAL (XFRAME (selected_frame))); |
| @@ -2246,7 +2228,6 @@ candidate_window_p (Lisp_Object window, Lisp_Object owindow, Lisp_Object minibuf | |||
| 2246 | } | 2228 | } |
| 2247 | else if (INTEGERP (all_frames) && XINT (all_frames) == 0) | 2229 | else if (INTEGERP (all_frames) && XINT (all_frames) == 0) |
| 2248 | { | 2230 | { |
| 2249 | FRAME_SAMPLE_VISIBILITY (f); | ||
| 2250 | candidate_p = (FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f) | 2231 | candidate_p = (FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f) |
| 2251 | #ifdef HAVE_X_WINDOWS | 2232 | #ifdef HAVE_X_WINDOWS |
| 2252 | /* Yuck!! If we've just created the frame and the | 2233 | /* Yuck!! If we've just created the frame and the |
| @@ -2762,7 +2743,7 @@ window-start value is reasonable when this function is called. */) | |||
| 2762 | struct window *w, *r, *s; | 2743 | struct window *w, *r, *s; |
| 2763 | struct frame *f; | 2744 | struct frame *f; |
| 2764 | Lisp_Object sibling, pwindow, swindow IF_LINT (= Qnil), delta; | 2745 | Lisp_Object sibling, pwindow, swindow IF_LINT (= Qnil), delta; |
| 2765 | ptrdiff_t startpos IF_LINT (= 0); | 2746 | ptrdiff_t startpos IF_LINT (= 0), startbyte IF_LINT (= 0); |
| 2766 | int top IF_LINT (= 0), new_top, resize_failed; | 2747 | int top IF_LINT (= 0), new_top, resize_failed; |
| 2767 | 2748 | ||
| 2768 | w = decode_valid_window (window); | 2749 | w = decode_valid_window (window); |
| @@ -2801,6 +2782,7 @@ window-start value is reasonable when this function is called. */) | |||
| 2801 | if (!NILP (w->buffer)) | 2782 | if (!NILP (w->buffer)) |
| 2802 | { | 2783 | { |
| 2803 | startpos = marker_position (w->start); | 2784 | startpos = marker_position (w->start); |
| 2785 | startbyte = marker_byte_position (w->start); | ||
| 2804 | top = WINDOW_TOP_EDGE_LINE (w) | 2786 | top = WINDOW_TOP_EDGE_LINE (w) |
| 2805 | - FRAME_TOP_MARGIN (XFRAME (WINDOW_FRAME (w))); | 2787 | - FRAME_TOP_MARGIN (XFRAME (WINDOW_FRAME (w))); |
| 2806 | /* Make sure WINDOW is the frame's selected window. */ | 2788 | /* Make sure WINDOW is the frame's selected window. */ |
| @@ -2970,10 +2952,10 @@ window-start value is reasonable when this function is called. */) | |||
| 2970 | Fset_buffer (w->buffer); | 2952 | Fset_buffer (w->buffer); |
| 2971 | /* This computation used to temporarily move point, but that | 2953 | /* This computation used to temporarily move point, but that |
| 2972 | can have unwanted side effects due to text properties. */ | 2954 | can have unwanted side effects due to text properties. */ |
| 2973 | pos = *vmotion (startpos, -top, w); | 2955 | pos = *vmotion (startpos, startbyte, -top, w); |
| 2974 | 2956 | ||
| 2975 | set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos); | 2957 | set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos); |
| 2976 | wset_window_end_valid (w, Qnil); | 2958 | w->window_end_valid = 0; |
| 2977 | w->start_at_line_beg = (pos.bytepos == BEGV_BYTE | 2959 | w->start_at_line_beg = (pos.bytepos == BEGV_BYTE |
| 2978 | || FETCH_BYTE (pos.bytepos - 1) == '\n'); | 2960 | || FETCH_BYTE (pos.bytepos - 1) == '\n'); |
| 2979 | /* We need to do this, so that the window-scroll-functions | 2961 | /* We need to do this, so that the window-scroll-functions |
| @@ -3189,7 +3171,7 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int | |||
| 3189 | wset_window_end_pos (w, make_number (0)); | 3171 | wset_window_end_pos (w, make_number (0)); |
| 3190 | wset_window_end_vpos (w, make_number (0)); | 3172 | wset_window_end_vpos (w, make_number (0)); |
| 3191 | memset (&w->last_cursor, 0, sizeof w->last_cursor); | 3173 | memset (&w->last_cursor, 0, sizeof w->last_cursor); |
| 3192 | wset_window_end_valid (w, Qnil); | 3174 | |
| 3193 | if (!(keep_margins_p && samebuf)) | 3175 | if (!(keep_margins_p && samebuf)) |
| 3194 | { /* If we're not actually changing the buffer, don't reset hscroll and | 3176 | { /* If we're not actually changing the buffer, don't reset hscroll and |
| 3195 | vscroll. This case happens for example when called from | 3177 | vscroll. This case happens for example when called from |
| @@ -3438,8 +3420,6 @@ make_parent_window (Lisp_Object window, int horflag) | |||
| 3438 | adjust_window_count (p, 1); | 3420 | adjust_window_count (p, 1); |
| 3439 | XSETWINDOW (parent, p); | 3421 | XSETWINDOW (parent, p); |
| 3440 | 3422 | ||
| 3441 | p->sequence_number = ++sequence_number; | ||
| 3442 | |||
| 3443 | replace_window (window, parent, 1); | 3423 | replace_window (window, parent, 1); |
| 3444 | 3424 | ||
| 3445 | wset_next (o, Qnil); | 3425 | wset_next (o, Qnil); |
| @@ -3488,7 +3468,7 @@ make_window (void) | |||
| 3488 | w->nrows_scale_factor = w->ncols_scale_factor = 1; | 3468 | w->nrows_scale_factor = w->ncols_scale_factor = 1; |
| 3489 | w->phys_cursor_type = -1; | 3469 | w->phys_cursor_type = -1; |
| 3490 | w->phys_cursor_width = -1; | 3470 | w->phys_cursor_width = -1; |
| 3491 | w->sequence_number = ++sequence_number; | 3471 | w->column_number_displayed = -1; |
| 3492 | 3472 | ||
| 3493 | /* Reset window_list. */ | 3473 | /* Reset window_list. */ |
| 3494 | Vwindow_list = Qnil; | 3474 | Vwindow_list = Qnil; |
| @@ -3958,7 +3938,7 @@ set correctly. See the code of `split-window' for how this is done. */) | |||
| 3958 | wset_next (o, new); | 3938 | wset_next (o, new); |
| 3959 | } | 3939 | } |
| 3960 | 3940 | ||
| 3961 | wset_window_end_valid (n, Qnil); | 3941 | n->window_end_valid = 0; |
| 3962 | memset (&n->last_cursor, 0, sizeof n->last_cursor); | 3942 | memset (&n->last_cursor, 0, sizeof n->last_cursor); |
| 3963 | 3943 | ||
| 3964 | /* Get special geometry settings from reference window. */ | 3944 | /* Get special geometry settings from reference window. */ |
| @@ -4628,8 +4608,8 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror) | |||
| 4628 | } | 4608 | } |
| 4629 | 4609 | ||
| 4630 | /* Set the window start, and set up the window for redisplay. */ | 4610 | /* Set the window start, and set up the window for redisplay. */ |
| 4631 | set_marker_restricted (w->start, make_number (pos), | 4611 | set_marker_restricted_both (w->start, w->buffer, IT_CHARPOS (it), |
| 4632 | w->buffer); | 4612 | IT_BYTEPOS (it)); |
| 4633 | bytepos = marker_byte_position (w->start); | 4613 | bytepos = marker_byte_position (w->start); |
| 4634 | w->start_at_line_beg = (pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n'); | 4614 | w->start_at_line_beg = (pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n'); |
| 4635 | w->update_mode_line = 1; | 4615 | w->update_mode_line = 1; |
| @@ -4769,7 +4749,8 @@ window_scroll_line_based (Lisp_Object window, int n, int whole, int noerror) | |||
| 4769 | register Lisp_Object tem; | 4749 | register Lisp_Object tem; |
| 4770 | int lose; | 4750 | int lose; |
| 4771 | Lisp_Object bolp; | 4751 | Lisp_Object bolp; |
| 4772 | ptrdiff_t startpos; | 4752 | ptrdiff_t startpos = marker_position (w->start); |
| 4753 | ptrdiff_t startbyte = marker_byte_position (w->start); | ||
| 4773 | Lisp_Object original_pos = Qnil; | 4754 | Lisp_Object original_pos = Qnil; |
| 4774 | 4755 | ||
| 4775 | /* If scrolling screen-fulls, compute the number of lines to | 4756 | /* If scrolling screen-fulls, compute the number of lines to |
| @@ -4777,8 +4758,6 @@ window_scroll_line_based (Lisp_Object window, int n, int whole, int noerror) | |||
| 4777 | if (whole) | 4758 | if (whole) |
| 4778 | n *= max (1, ht - next_screen_context_lines); | 4759 | n *= max (1, ht - next_screen_context_lines); |
| 4779 | 4760 | ||
| 4780 | startpos = marker_position (w->start); | ||
| 4781 | |||
| 4782 | if (!NILP (Vscroll_preserve_screen_position)) | 4761 | if (!NILP (Vscroll_preserve_screen_position)) |
| 4783 | { | 4762 | { |
| 4784 | if (window_scroll_preserve_vpos <= 0 | 4763 | if (window_scroll_preserve_vpos <= 0 |
| @@ -4786,10 +4765,8 @@ window_scroll_line_based (Lisp_Object window, int n, int whole, int noerror) | |||
| 4786 | || NILP (Fget (KVAR (current_kboard, Vlast_command), Qscroll_command))) | 4765 | || NILP (Fget (KVAR (current_kboard, Vlast_command), Qscroll_command))) |
| 4787 | { | 4766 | { |
| 4788 | struct position posit | 4767 | struct position posit |
| 4789 | = *compute_motion (startpos, 0, 0, 0, | 4768 | = *compute_motion (startpos, startbyte, 0, 0, 0, |
| 4790 | PT, ht, 0, | 4769 | PT, ht, 0, -1, w->hscroll, 0, w); |
| 4791 | -1, w->hscroll, | ||
| 4792 | 0, w); | ||
| 4793 | window_scroll_preserve_vpos = posit.vpos; | 4770 | window_scroll_preserve_vpos = posit.vpos; |
| 4794 | window_scroll_preserve_hpos = posit.hpos + w->hscroll; | 4771 | window_scroll_preserve_hpos = posit.hpos + w->hscroll; |
| 4795 | } | 4772 | } |
| @@ -4805,9 +4782,10 @@ window_scroll_line_based (Lisp_Object window, int n, int whole, int noerror) | |||
| 4805 | { | 4782 | { |
| 4806 | Fvertical_motion (make_number (- (ht / 2)), window); | 4783 | Fvertical_motion (make_number (- (ht / 2)), window); |
| 4807 | startpos = PT; | 4784 | startpos = PT; |
| 4785 | startbyte = PT_BYTE; | ||
| 4808 | } | 4786 | } |
| 4809 | 4787 | ||
| 4810 | SET_PT (startpos); | 4788 | SET_PT_BOTH (startpos, startbyte); |
| 4811 | lose = n < 0 && PT == BEGV; | 4789 | lose = n < 0 && PT == BEGV; |
| 4812 | Fvertical_motion (make_number (n), window); | 4790 | Fvertical_motion (make_number (n), window); |
| 4813 | pos = PT; | 4791 | pos = PT; |
| @@ -5185,7 +5163,7 @@ displayed_window_lines (struct window *w) | |||
| 5185 | 5163 | ||
| 5186 | DEFUN ("recenter", Frecenter, Srecenter, 0, 1, "P", | 5164 | DEFUN ("recenter", Frecenter, Srecenter, 0, 1, "P", |
| 5187 | doc: /* Center point in selected window and maybe redisplay frame. | 5165 | doc: /* Center point in selected window and maybe redisplay frame. |
| 5188 | With prefix argument ARG, recenter putting point on screen line ARG | 5166 | With a numeric prefix argument ARG, recenter putting point on screen line ARG |
| 5189 | relative to the selected window. If ARG is negative, it counts up from the | 5167 | relative to the selected window. If ARG is negative, it counts up from the |
| 5190 | bottom of the window. (ARG should be less than the height of the window.) | 5168 | bottom of the window. (ARG should be less than the height of the window.) |
| 5191 | 5169 | ||
| @@ -5342,7 +5320,7 @@ and redisplay normally--don't erase and redraw the frame. */) | |||
| 5342 | 5320 | ||
| 5343 | iarg = max (iarg, this_scroll_margin); | 5321 | iarg = max (iarg, this_scroll_margin); |
| 5344 | 5322 | ||
| 5345 | pos = *vmotion (PT, -iarg, w); | 5323 | pos = *vmotion (PT, PT_BYTE, -iarg, w); |
| 5346 | charpos = pos.bufpos; | 5324 | charpos = pos.bufpos; |
| 5347 | bytepos = pos.bytepos; | 5325 | bytepos = pos.bytepos; |
| 5348 | } | 5326 | } |
| @@ -5361,14 +5339,14 @@ and redisplay normally--don't erase and redraw the frame. */) | |||
| 5361 | iarg = clip_to_bounds (this_scroll_margin, iarg, | 5339 | iarg = clip_to_bounds (this_scroll_margin, iarg, |
| 5362 | ht - this_scroll_margin - 1); | 5340 | ht - this_scroll_margin - 1); |
| 5363 | 5341 | ||
| 5364 | pos = *vmotion (PT, - iarg, w); | 5342 | pos = *vmotion (PT, PT_BYTE, - iarg, w); |
| 5365 | charpos = pos.bufpos; | 5343 | charpos = pos.bufpos; |
| 5366 | bytepos = pos.bytepos; | 5344 | bytepos = pos.bytepos; |
| 5367 | } | 5345 | } |
| 5368 | 5346 | ||
| 5369 | /* Set the new window start. */ | 5347 | /* Set the new window start. */ |
| 5370 | set_marker_both (w->start, w->buffer, charpos, bytepos); | 5348 | set_marker_both (w->start, w->buffer, charpos, bytepos); |
| 5371 | wset_window_end_valid (w, Qnil); | 5349 | w->window_end_valid = 0; |
| 5372 | 5350 | ||
| 5373 | w->optional_new_start = 1; | 5351 | w->optional_new_start = 1; |
| 5374 | 5352 | ||
| @@ -5808,8 +5786,7 @@ the return value is nil. Otherwise the value is t. */) | |||
| 5808 | { | 5786 | { |
| 5809 | /* Set window markers at start of visible range. */ | 5787 | /* Set window markers at start of visible range. */ |
| 5810 | if (XMARKER (w->start)->buffer == 0) | 5788 | if (XMARKER (w->start)->buffer == 0) |
| 5811 | set_marker_restricted (w->start, make_number (0), | 5789 | set_marker_restricted_both (w->start, w->buffer, 0, 0); |
| 5812 | w->buffer); | ||
| 5813 | if (XMARKER (w->pointm)->buffer == 0) | 5790 | if (XMARKER (w->pointm)->buffer == 0) |
| 5814 | set_marker_restricted_both | 5791 | set_marker_restricted_both |
| 5815 | (w->pointm, w->buffer, | 5792 | (w->pointm, w->buffer, |
| @@ -5827,10 +5804,8 @@ the return value is nil. Otherwise the value is t. */) | |||
| 5827 | wset_buffer (w, other_buffer_safely (Fcurrent_buffer ())); | 5804 | wset_buffer (w, other_buffer_safely (Fcurrent_buffer ())); |
| 5828 | /* This will set the markers to beginning of visible | 5805 | /* This will set the markers to beginning of visible |
| 5829 | range. */ | 5806 | range. */ |
| 5830 | set_marker_restricted (w->start, | 5807 | set_marker_restricted_both (w->start, w->buffer, 0, 0); |
| 5831 | make_number (0), w->buffer); | 5808 | set_marker_restricted_both (w->pointm, w->buffer, 0, 0); |
| 5832 | set_marker_restricted (w->pointm, | ||
| 5833 | make_number (0), w->buffer); | ||
| 5834 | w->start_at_line_beg = 1; | 5809 | w->start_at_line_beg = 1; |
| 5835 | if (!NILP (w->dedicated)) | 5810 | if (!NILP (w->dedicated)) |
| 5836 | /* Record this window as dead. */ | 5811 | /* Record this window as dead. */ |
| @@ -6203,11 +6178,11 @@ saved by this function. */) | |||
| 6203 | data->minibuf_selected_window = minibuf_level > 0 ? minibuf_selected_window : Qnil; | 6178 | data->minibuf_selected_window = minibuf_level > 0 ? minibuf_selected_window : Qnil; |
| 6204 | data->root_window = FRAME_ROOT_WINDOW (f); | 6179 | data->root_window = FRAME_ROOT_WINDOW (f); |
| 6205 | data->focus_frame = FRAME_FOCUS_FRAME (f); | 6180 | data->focus_frame = FRAME_FOCUS_FRAME (f); |
| 6206 | tem = Fmake_vector (make_number (n_windows), Qnil); | 6181 | tem = make_uninit_vector (n_windows); |
| 6207 | data->saved_windows = tem; | 6182 | data->saved_windows = tem; |
| 6208 | for (i = 0; i < n_windows; i++) | 6183 | for (i = 0; i < n_windows; i++) |
| 6209 | ASET (tem, i, | 6184 | ASET (tem, i, |
| 6210 | Fmake_vector (make_number (VECSIZE (struct saved_window)), Qnil)); | 6185 | Fmake_vector (make_number (VECSIZE (struct saved_window)), Qnil)); |
| 6211 | save_window_save (FRAME_ROOT_WINDOW (f), XVECTOR (tem), 0); | 6186 | save_window_save (FRAME_ROOT_WINDOW (f), XVECTOR (tem), 0); |
| 6212 | XSETWINDOW_CONFIGURATION (tem, data); | 6187 | XSETWINDOW_CONFIGURATION (tem, data); |
| 6213 | return (tem); | 6188 | return (tem); |
| @@ -6319,7 +6294,7 @@ display marginal areas and the text area. */) | |||
| 6319 | adjust_window_margins (w); | 6294 | adjust_window_margins (w); |
| 6320 | 6295 | ||
| 6321 | clear_glyph_matrix (w->current_matrix); | 6296 | clear_glyph_matrix (w->current_matrix); |
| 6322 | wset_window_end_valid (w, Qnil); | 6297 | w->window_end_valid = 0; |
| 6323 | 6298 | ||
| 6324 | ++windows_or_buffers_changed; | 6299 | ++windows_or_buffers_changed; |
| 6325 | adjust_glyphs (XFRAME (WINDOW_FRAME (w))); | 6300 | adjust_glyphs (XFRAME (WINDOW_FRAME (w))); |
| @@ -6389,7 +6364,7 @@ Fourth parameter HORIZONTAL-TYPE is currently unused. */) | |||
| 6389 | adjust_window_margins (w); | 6364 | adjust_window_margins (w); |
| 6390 | 6365 | ||
| 6391 | clear_glyph_matrix (w->current_matrix); | 6366 | clear_glyph_matrix (w->current_matrix); |
| 6392 | wset_window_end_valid (w, Qnil); | 6367 | w->window_end_valid = 0; |
| 6393 | 6368 | ||
| 6394 | ++windows_or_buffers_changed; | 6369 | ++windows_or_buffers_changed; |
| 6395 | adjust_glyphs (XFRAME (WINDOW_FRAME (w))); | 6370 | adjust_glyphs (XFRAME (WINDOW_FRAME (w))); |