Mercurial > emacs
comparison src/window.c @ 35038:ac8eb6b4eee6
(Fdelete_other_windows): Set window's window_end_valid
to nil when changing the window's start. Don't change the
window's start when its top position hasn't changed. If we do,
this will set the window's optional_new_start, which act's like a
force_start during redisplay with C-x 1 M-> under particular
circumstances (see report from Per Starback to emacs-pretest-bug
from 2000-12-13.).
(Fdelete_other_windows): Set window's window_end_valid
to nil when changing the window's start.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Thu, 04 Jan 2001 12:53:14 +0000 |
parents | 4ab60becd588 |
children | 67fa29af4c7b |
comparison
equal
deleted
inserted
replaced
35037:3c5b13084896 | 35038:ac8eb6b4eee6 |
---|---|
1689 with argument OBJ. | 1689 with argument OBJ. |
1690 If FRAMES is Qt, look at all frames; | 1690 If FRAMES is Qt, look at all frames; |
1691 Qnil, look at just the selected frame; | 1691 Qnil, look at just the selected frame; |
1692 Qvisible, look at visible frames; | 1692 Qvisible, look at visible frames; |
1693 a frame, just look at windows on that frame. | 1693 a frame, just look at windows on that frame. |
1694 If MINI is non-zero, perform the operation on minibuffer windows too. | 1694 If MINI is non-zero, perform the operation on minibuffer windows too. */ |
1695 */ | |
1696 | 1695 |
1697 enum window_loop | 1696 enum window_loop |
1698 { | 1697 { |
1699 WINDOW_LOOP_UNUSED, | 1698 WINDOW_LOOP_UNUSED, |
1700 GET_BUFFER_WINDOW, /* Arg is buffer */ | 1699 GET_BUFFER_WINDOW, /* Arg is buffer */ |
1987 (window) | 1986 (window) |
1988 Lisp_Object window; | 1987 Lisp_Object window; |
1989 { | 1988 { |
1990 struct window *w; | 1989 struct window *w; |
1991 int startpos; | 1990 int startpos; |
1992 int top; | 1991 int top, new_top; |
1993 | 1992 |
1994 if (NILP (window)) | 1993 if (NILP (window)) |
1995 window = selected_window; | 1994 window = selected_window; |
1996 else | 1995 else |
1997 CHECK_LIVE_WINDOW (window, 0); | 1996 CHECK_LIVE_WINDOW (window, 0); |
1998 | |
1999 w = XWINDOW (window); | 1997 w = XWINDOW (window); |
2000 | 1998 |
2001 startpos = marker_position (w->start); | 1999 startpos = marker_position (w->start); |
2002 top = XFASTINT (w->top) - FRAME_TOP_MARGIN (XFRAME (WINDOW_FRAME (w))); | 2000 top = XFASTINT (w->top) - FRAME_TOP_MARGIN (XFRAME (WINDOW_FRAME (w))); |
2003 | 2001 |
2009 /* Try to minimize scrolling, by setting the window start to the point | 2007 /* Try to minimize scrolling, by setting the window start to the point |
2010 will cause the text at the old window start to be at the same place | 2008 will cause the text at the old window start to be at the same place |
2011 on the frame. But don't try to do this if the window start is | 2009 on the frame. But don't try to do this if the window start is |
2012 outside the visible portion (as might happen when the display is | 2010 outside the visible portion (as might happen when the display is |
2013 not current, due to typeahead). */ | 2011 not current, due to typeahead). */ |
2014 if (startpos >= BUF_BEGV (XBUFFER (w->buffer)) | 2012 new_top = XFASTINT (w->top) - FRAME_TOP_MARGIN (XFRAME (WINDOW_FRAME (w))); |
2013 if (new_top != top | |
2014 && startpos >= BUF_BEGV (XBUFFER (w->buffer)) | |
2015 && startpos <= BUF_ZV (XBUFFER (w->buffer))) | 2015 && startpos <= BUF_ZV (XBUFFER (w->buffer))) |
2016 { | 2016 { |
2017 struct position pos; | 2017 struct position pos; |
2018 struct buffer *obuf = current_buffer; | 2018 struct buffer *obuf = current_buffer; |
2019 | 2019 |
2021 /* This computation used to temporarily move point, but that can | 2021 /* This computation used to temporarily move point, but that can |
2022 have unwanted side effects due to text properties. */ | 2022 have unwanted side effects due to text properties. */ |
2023 pos = *vmotion (startpos, -top, w); | 2023 pos = *vmotion (startpos, -top, w); |
2024 | 2024 |
2025 set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos); | 2025 set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos); |
2026 w->window_end_valid = Qnil; | |
2026 w->start_at_line_beg = ((pos.bytepos == BEGV_BYTE | 2027 w->start_at_line_beg = ((pos.bytepos == BEGV_BYTE |
2027 || FETCH_BYTE (pos.bytepos - 1) == '\n') ? Qt | 2028 || FETCH_BYTE (pos.bytepos - 1) == '\n') ? Qt |
2028 : Qnil); | 2029 : Qnil); |
2029 /* We need to do this, so that the window-scroll-functions | 2030 /* We need to do this, so that the window-scroll-functions |
2030 get called. */ | 2031 get called. */ |