emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r104536: Add some new members to wind


From: martin rudalics
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104536: Add some new members to window structure in window.h.
Date: Wed, 08 Jun 2011 10:35:20 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104536
committer: martin rudalics <address@hidden>
branch nick: trunk
timestamp: Wed 2011-06-08 10:35:20 +0200
message:
  Add some new members to window structure in window.h.
  
  * window.h (window): Add some new members to window structure -
  normal_lines, normal_cols, new_total, new_normal, clone_number,
  splits, nest, prev_buffers, next_buffers.
  (WINDOW_TOTAL_SIZE): Move here from window.c.
  (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define.
  
  * window.c (WINDOW_TOTAL_SIZE): Move to window.h.
  (make_dummy_parent): Set new members of windows structure.
  (make_window): Move down in code.  Handle new members of window
  structure.
  (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
  (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
  (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
  (Fset_window_prev_buffers, Fwindow_next_buffers)
  (Fset_window_next_buffers, Fset_window_clone_number): New
  functions.
  (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
  (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
  Doc-string fixes.
  (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
  Argument WINDOW can be now internal window too.
  (Fwindow_use_time): Move up in code.
  (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
  Rewrite doc-string.
  (Fset_window_configuration, saved_window)
  (Fcurrent_window_configuration, save_window_save): Handle new
  members of window structure.
modified:
  src/ChangeLog
  src/window.c
  src/window.h
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-06-08 05:40:45 +0000
+++ b/src/ChangeLog     2011-06-08 08:35:20 +0000
@@ -1,7 +1,34 @@
 2011-06-08  Martin Rudalics  <address@hidden>
 
+       * window.h (window): Add some new members to window structure -
+       normal_lines, normal_cols, new_total, new_normal, clone_number,
+       splits, nest, prev_buffers, next_buffers.
+       (WINDOW_TOTAL_SIZE): Move here from window.c.
+       (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define.
+
        * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
        Remove.
+       (make_dummy_parent): Set new members of windows structure.
+       (make_window): Move down in code.  Handle new members of window
+       structure.
+       (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
+       (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
+       (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
+       (Fset_window_prev_buffers, Fwindow_next_buffers)
+       (Fset_window_next_buffers, Fset_window_clone_number): New
+       functions.
+       (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
+       (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
+       Doc-string fixes.
+       (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
+       Argument WINDOW can be now internal window too.
+       (Fwindow_use_time): Move up in code.
+       (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
+       Rewrite doc-string.
+       (Fset_window_configuration, saved_window)
+       (Fcurrent_window_configuration, save_window_save): Handle new
+       members of window structure.
+       (WINDOW_TOTAL_SIZE): Move to window.h.
 
 2011-06-07  Martin Rudalics  <address@hidden>
 

=== modified file 'src/window.c'
--- a/src/window.c      2011-06-08 05:40:45 +0000
+++ b/src/window.c      2011-06-08 08:35:20 +0000
@@ -410,6 +410,14 @@
   return select_window (window, norecord, 0);
 }
 
+DEFUN ("window-clone-number", Fwindow_clone_number, Swindow_clone_number, 0, 
1, 0,
+       doc: /* Return WINDOW's clone number.
+WINDOW can be any window and defaults to the selected one.  */)
+     (Lisp_Object window)
+{
+  return decode_any_window (window)->clone_number;
+}
+
 DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0,
        doc: /* Return the buffer that WINDOW is displaying.
 WINDOW can be any window and defaults to the selected one.
@@ -463,233 +471,80 @@
 {
   return decode_any_window (window)->prev;
 }
-
-Lisp_Object
-make_window (void)
-{
-  Lisp_Object val;
-  register struct window *p;
-
-  p = allocate_window ();
-  ++sequence_number;
-  XSETFASTINT (p->sequence_number, sequence_number);
-  XSETFASTINT (p->left_col, 0);
-  XSETFASTINT (p->top_line, 0);
-  XSETFASTINT (p->total_lines, 0);
-  XSETFASTINT (p->total_cols, 0);
-  XSETFASTINT (p->hscroll, 0);
-  XSETFASTINT (p->min_hscroll, 0);
-  p->orig_top_line = p->orig_total_lines = Qnil;
-  p->start = Fmake_marker ();
-  p->pointm = Fmake_marker ();
-  XSETFASTINT (p->use_time, 0);
-  p->frame = Qnil;
-  p->display_table = Qnil;
-  p->dedicated = Qnil;
-  p->window_parameters = Qnil;
-  p->pseudo_window_p = 0;
-  memset (&p->cursor, 0, sizeof (p->cursor));
-  memset (&p->last_cursor, 0, sizeof (p->last_cursor));
-  memset (&p->phys_cursor, 0, sizeof (p->phys_cursor));
-  p->desired_matrix = p->current_matrix = 0;
-  p->nrows_scale_factor = p->ncols_scale_factor = 1;
-  p->phys_cursor_type = -1;
-  p->phys_cursor_width = -1;
-  p->must_be_updated_p = 0;
-  XSETFASTINT (p->window_end_vpos, 0);
-  XSETFASTINT (p->window_end_pos, 0);
-  p->window_end_valid = Qnil;
-  p->vscroll = 0;
-  XSETWINDOW (val, p);
-  XSETFASTINT (p->last_point, 0);
-  p->frozen_window_start_p = 0;
-  p->last_cursor_off_p = p->cursor_off_p = 0;
-  p->left_margin_cols = Qnil;
-  p->right_margin_cols = Qnil;
-  p->left_fringe_width = Qnil;
-  p->right_fringe_width = Qnil;
-  p->fringes_outside_margins = Qnil;
-  p->scroll_bar_width = Qnil;
-  p->vertical_scroll_bar_type = Qt;
-  p->resize_proportionally = Qnil;
-
-  Vwindow_list = Qnil;
-  return val;
-}
-
-DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p,
-       Spos_visible_in_window_p, 0, 3, 0,
-       doc: /* Return non-nil if position POS is currently on the frame in 
WINDOW.
-Return nil if that position is scrolled vertically out of view.
-If a character is only partially visible, nil is returned, unless the
-optional argument PARTIALLY is non-nil.
-If POS is only out of view because of horizontal scrolling, return non-nil.
-If POS is t, it specifies the position of the last visible glyph in WINDOW.
-POS defaults to point in WINDOW; WINDOW defaults to the selected window.
-
-If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil,
-return value is a list of 2 or 6 elements (X Y [RTOP RBOT ROWH VPOS]),
-where X and Y are the pixel coordinates relative to the top left corner
-of the window.  The remaining elements are omitted if the character after
-POS is fully visible; otherwise, RTOP and RBOT are the number of pixels
-off-window at the top and bottom of the row, ROWH is the height of the
-display row, and VPOS is the row number (0-based) containing POS.  */)
-  (Lisp_Object pos, Lisp_Object window, Lisp_Object partially)
-{
-  register struct window *w;
-  register EMACS_INT posint;
-  register struct buffer *buf;
-  struct text_pos top;
-  Lisp_Object in_window = Qnil;
-  int rtop, rbot, rowh, vpos, fully_p = 1;
-  int x, y;
-
-  w = decode_window (window);
-  buf = XBUFFER (w->buffer);
-  SET_TEXT_POS_FROM_MARKER (top, w->start);
-
-  if (EQ (pos, Qt))
-    posint = -1;
-  else if (!NILP (pos))
-    {
-      CHECK_NUMBER_COERCE_MARKER (pos);
-      posint = XINT (pos);
-    }
-  else if (w == XWINDOW (selected_window))
-    posint = PT;
-  else
-    posint = XMARKER (w->pointm)->charpos;
-
-  /* If position is above window start or outside buffer boundaries,
-     or if window start is out of range, position is not visible.  */
-  if ((EQ (pos, Qt)
-       || (posint >= CHARPOS (top) && posint <= BUF_ZV (buf)))
-      && CHARPOS (top) >= BUF_BEGV (buf)
-      && CHARPOS (top) <= BUF_ZV (buf)
-      && pos_visible_p (w, posint, &x, &y, &rtop, &rbot, &rowh, &vpos)
-      && (fully_p = !rtop && !rbot, (!NILP (partially) || fully_p)))
-    in_window = Qt;
-
-  if (!NILP (in_window) && !NILP (partially))
-    {
-      Lisp_Object part = Qnil;
-      if (!fully_p)
-       part = list4 (make_number (rtop), make_number (rbot),
-                       make_number (rowh), make_number (vpos));
-      in_window = Fcons (make_number (x),
-                        Fcons (make_number (y), part));
-    }
-
-  return in_window;
-}
-
-DEFUN ("window-line-height", Fwindow_line_height,
-       Swindow_line_height, 0, 2, 0,
-       doc: /* Return height in pixels of text line LINE in window WINDOW.
-If WINDOW is nil or omitted, use selected window.
-
-Return height of current line if LINE is omitted or nil.  Return height of
-header or mode line if LINE is `header-line' and `mode-line'.
-Otherwise, LINE is a text line number starting from 0.  A negative number
-counts from the end of the window.
-
-Value is a list (HEIGHT VPOS YPOS OFFBOT), where HEIGHT is the height
-in pixels of the visible part of the line, VPOS and YPOS are the
-vertical position in lines and pixels of the line, relative to the top
-of the first text line, and OFFBOT is the number of off-window pixels at
-the bottom of the text line.  If there are off-window pixels at the top
-of the (first) text line, YPOS is negative.
-
-Return nil if window display is not up-to-date.  In that case, use
-`pos-visible-in-window-p' to obtain the information.  */)
-  (Lisp_Object line, Lisp_Object window)
-{
-  register struct window *w;
-  register struct buffer *b;
-  struct glyph_row *row, *end_row;
-  int max_y, crop, i, n;
-
-  w = decode_window (window);
-
-  if (noninteractive
-      || w->pseudo_window_p)
-    return Qnil;
-
-  CHECK_BUFFER (w->buffer);
-  b = XBUFFER (w->buffer);
-
-  /* Fail if current matrix is not up-to-date.  */
-  if (NILP (w->window_end_valid)
-      || current_buffer->clip_changed
-      || current_buffer->prevent_redisplay_optimizations_p
-      || XFASTINT (w->last_modified) < BUF_MODIFF (b)
-      || XFASTINT (w->last_overlay_modified) < BUF_OVERLAY_MODIFF (b))
-    return Qnil;
-
-  if (NILP (line))
-    {
-      i = w->cursor.vpos;
-      if (i < 0 || i >= w->current_matrix->nrows
-         || (row = MATRIX_ROW (w->current_matrix, i), !row->enabled_p))
-       return Qnil;
-      max_y = window_text_bottom_y (w);
-      goto found_row;
-    }
-
-  if (EQ (line, Qheader_line))
-    {
-      if (!WINDOW_WANTS_HEADER_LINE_P (w))
-       return Qnil;
-      row = MATRIX_HEADER_LINE_ROW (w->current_matrix);
-      if (!row->enabled_p)
-       return Qnil;
-      return list4 (make_number (row->height),
-                   make_number (0), make_number (0),
-                   make_number (0));
-    }
-
-  if (EQ (line, Qmode_line))
-    {
-      row = MATRIX_MODE_LINE_ROW (w->current_matrix);
-      if (!row->enabled_p)
-       return Qnil;
-      return list4 (make_number (row->height),
-                   make_number (0), /* not accurate */
-                   make_number (WINDOW_HEADER_LINE_HEIGHT (w)
-                                + window_text_bottom_y (w)),
-                   make_number (0));
-    }
-
-  CHECK_NUMBER (line);
-  n = XINT (line);
-
-  row = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
-  end_row = MATRIX_BOTTOM_TEXT_ROW (w->current_matrix, w);
-  max_y = window_text_bottom_y (w);
-  i = 0;
-
-  while ((n < 0 || i < n)
-        && row <= end_row && row->enabled_p
-        && row->y + row->height < max_y)
-    row++, i++;
-
-  if (row > end_row || !row->enabled_p)
-    return Qnil;
-
-  if (++n < 0)
-    {
-      if (-n > i)
-       return Qnil;
-      row += n;
-      i += n;
-    }
-
- found_row:
-  crop = max (0, (row->y + row->height) - max_y);
-  return list4 (make_number (row->height + min (0, row->y) - crop),
-               make_number (i),
-               make_number (row->y),
-               make_number (crop));
+
+DEFUN ("window-splits", Fwindow_splits, Swindow_splits, 0, 1, 0,
+       doc: /* Return splits status for WINDOW.
+WINDOW can be any window and defaults to the selected one.
+
+If the value returned by this function is nil and WINDOW is resized, the
+corresponding space is preferably taken from (or given to) WINDOW's
+right sibling.  When WINDOW is deleted, its space is given to its left
+sibling.
+
+If the value returned by this function is non-nil, resizing and deleting
+WINDOW may resize all windows in the same combination.  */)
+  (Lisp_Object window)
+{
+  return decode_any_window (window)->splits;
+}
+
+DEFUN ("set-window-splits", Fset_window_splits, Sset_window_splits, 2, 2, 0,
+       doc: /* Set splits status of WINDOW to STATUS.
+WINDOW can be any window and defaults to the selected one.  Return
+STATUS.
+
+If STATUS is nil and WINDOW is later resized, the corresponding space is
+preferably taken from (or given to) WINDOW's right sibling.  When WINDOW
+is deleted, its space is given to its left sibling.
+
+If STATUS is non-nil, resizing and deleting WINDOW may resize all
+windows in the same combination.  */)
+  (Lisp_Object window, Lisp_Object status)
+{
+  register struct window *w = decode_any_window (window);
+
+  w->splits = status;
+
+  return w->splits;
+}
+
+DEFUN ("window-nest", Fwindow_nest, Swindow_nest, 0, 1, 0,
+       doc: /* Return nest status of WINDOW.
+WINDOW can be any window and defaults to the selected one.
+
+If the return value is nil, subwindows of WINDOW can be recombined with
+WINDOW's siblings.  A return value of non-nil means that subwindows of
+WINDOW are never \(re-)combined with WINDOW's siblings.  */)
+  (Lisp_Object window)
+{
+  return decode_any_window (window)->nest;
+}
+
+DEFUN ("set-window-nest", Fset_window_nest, Sset_window_nest, 2, 2, 0,
+       doc: /* Set nest status of WINDOW to STATUS.
+WINDOW can be any window and defaults to the selected one.  Return
+STATUS.
+
+If STATUS is nil, subwindows of WINDOW can be recombined with WINDOW's
+siblings.  STATUS non-nil means that subwindows of WINDOW are never
+\(re-)combined with WINDOW's siblings.  */)
+  (Lisp_Object window, Lisp_Object status)
+{
+  register struct window *w = decode_any_window (window);
+
+  w->nest = status;
+
+  return w->nest;
+}
+
+DEFUN ("window-use-time", Fwindow_use_time, Swindow_use_time, 0, 1, 0,
+       doc: /* Return WINDOW's use time.
+WINDOW defaults to the selected window.  The window with the highest use
+time is the most recently selected one.  The window with the lowest use
+time is the least recently selected one.  */)
+  (Lisp_Object window)
+{
+  return decode_window (window)->use_time;
 }
 
 DEFUN ("window-total-size", Fwindow_total_size, Swindow_total_size, 0, 2, 0,
@@ -714,6 +569,34 @@
     return decode_any_window (window)->total_cols;
 }
 
+DEFUN ("window-new-total", Fwindow_new_total, Swindow_new_total, 0, 1, 0,
+       doc: /* Return new total size of WINDOW.
+WINDOW defaults to the selected window.   */)
+  (Lisp_Object window)
+{
+  return decode_any_window (window)->new_total;
+}
+
+DEFUN ("window-normal-size", Fwindow_normal_size, Swindow_normal_size, 0, 2, 0,
+       doc: /* Return normal height of WINDOW.
+WINDOW can be any window and defaults to the selected one.  Optional
+argument HORIZONTAL non-nil means return normal width of WINDOW.  */)
+  (Lisp_Object window, Lisp_Object horizontal)
+{
+  if (NILP (horizontal))
+    return decode_any_window (window)->normal_lines;
+  else
+    return decode_any_window (window)->normal_cols;
+}
+
+DEFUN ("window-new-normal", Fwindow_new_normal, Swindow_new_normal, 0, 1, 0,
+       doc: /* Return new normal size of WINDOW.
+WINDOW can be any window and defaults to the selected one.   */)
+  (Lisp_Object window)
+{
+  return decode_any_window (window)->new_normal;
+}
+
 DEFUN ("window-left-column", Fwindow_left_column, Swindow_left_column, 0, 1, 0,
        doc: /* Return left column of WINDOW.
 WINDOW can be any window and defaults to the selected one.  */)
@@ -802,7 +685,7 @@
 
 DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0,
        doc: /* Return the number of columns by which WINDOW is scrolled from 
left margin.
-WINDOW defaults to the selected window.  */)
+WINDOW must be a live window and defaults to the selected one.  */)
   (Lisp_Object window)
 {
   return decode_window (window)->hscroll;
@@ -1372,7 +1255,7 @@
 
 DEFUN ("window-at", Fwindow_at, Swindow_at, 2, 3, 0,
        doc: /* Return window containing coordinates X and Y on FRAME.
-If omitted, FRAME defaults to the currently selected frame.
+FRAME must be a live frame and defaults to the selected one.
 The top left corner of the frame is considered to be row 0,
 column 0.  */)
   (Lisp_Object x, Lisp_Object y, Lisp_Object frame)
@@ -1398,7 +1281,7 @@
 
 DEFUN ("window-point", Fwindow_point, Swindow_point, 0, 1, 0,
        doc: /* Return current value of point in WINDOW.
-WINDOW defaults to the selected window.
+WINDOW must be a live window and defaults to the selected one.
 
 For a nonselected window, this is the value point would have
 if that window were selected.
@@ -1420,7 +1303,7 @@
 
 DEFUN ("window-start", Fwindow_start, Swindow_start, 0, 1, 0,
        doc: /* Return position at which display currently starts in WINDOW.
-WINDOW defaults to the selected window.
+WINDOW must be a live window and defaults to the selected one.
 This is updated by redisplay or by calling `set-window-start'.  */)
   (Lisp_Object window)
 {
@@ -1440,7 +1323,7 @@
 
 DEFUN ("window-end", Fwindow_end, Swindow_end, 0, 2, 0,
        doc: /* Return position at which display currently ends in WINDOW.
-WINDOW defaults to the selected window.
+WINDOW must be a live window and defaults to the selected one.
 This is updated by redisplay, when it runs to completion.
 Simply changing the buffer text or setting `window-start'
 does not update this value.
@@ -1559,6 +1442,179 @@
   return pos;
 }
 
+DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p,
+       Spos_visible_in_window_p, 0, 3, 0,
+       doc: /* Return non-nil if position POS is currently on the frame in 
WINDOW.
+Return nil if that position is scrolled vertically out of view.
+If a character is only partially visible, nil is returned, unless the
+optional argument PARTIALLY is non-nil.
+If POS is only out of view because of horizontal scrolling, return non-nil.
+If POS is t, it specifies the position of the last visible glyph in WINDOW.
+POS defaults to point in WINDOW; WINDOW defaults to the selected window.
+
+If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil,
+return value is a list of 2 or 6 elements (X Y [RTOP RBOT ROWH VPOS]),
+where X and Y are the pixel coordinates relative to the top left corner
+of the window.  The remaining elements are omitted if the character after
+POS is fully visible; otherwise, RTOP and RBOT are the number of pixels
+off-window at the top and bottom of the row, ROWH is the height of the
+display row, and VPOS is the row number (0-based) containing POS.  */)
+  (Lisp_Object pos, Lisp_Object window, Lisp_Object partially)
+{
+  register struct window *w;
+  register EMACS_INT posint;
+  register struct buffer *buf;
+  struct text_pos top;
+  Lisp_Object in_window = Qnil;
+  int rtop, rbot, rowh, vpos, fully_p = 1;
+  int x, y;
+
+  w = decode_window (window);
+  buf = XBUFFER (w->buffer);
+  SET_TEXT_POS_FROM_MARKER (top, w->start);
+
+  if (EQ (pos, Qt))
+    posint = -1;
+  else if (!NILP (pos))
+    {
+      CHECK_NUMBER_COERCE_MARKER (pos);
+      posint = XINT (pos);
+    }
+  else if (w == XWINDOW (selected_window))
+    posint = PT;
+  else
+    posint = XMARKER (w->pointm)->charpos;
+
+  /* If position is above window start or outside buffer boundaries,
+     or if window start is out of range, position is not visible.  */
+  if ((EQ (pos, Qt)
+       || (posint >= CHARPOS (top) && posint <= BUF_ZV (buf)))
+      && CHARPOS (top) >= BUF_BEGV (buf)
+      && CHARPOS (top) <= BUF_ZV (buf)
+      && pos_visible_p (w, posint, &x, &y, &rtop, &rbot, &rowh, &vpos)
+      && (fully_p = !rtop && !rbot, (!NILP (partially) || fully_p)))
+    in_window = Qt;
+
+  if (!NILP (in_window) && !NILP (partially))
+    {
+      Lisp_Object part = Qnil;
+      if (!fully_p)
+       part = list4 (make_number (rtop), make_number (rbot),
+                       make_number (rowh), make_number (vpos));
+      in_window = Fcons (make_number (x),
+                        Fcons (make_number (y), part));
+    }
+
+  return in_window;
+}
+
+DEFUN ("window-line-height", Fwindow_line_height,
+       Swindow_line_height, 0, 2, 0,
+       doc: /* Return height in pixels of text line LINE in window WINDOW.
+WINDOW defaults to the selected window.
+
+Return height of current line if LINE is omitted or nil.  Return height of
+header or mode line if LINE is `header-line' or `mode-line'.
+Otherwise, LINE is a text line number starting from 0.  A negative number
+counts from the end of the window.
+
+Value is a list (HEIGHT VPOS YPOS OFFBOT), where HEIGHT is the height
+in pixels of the visible part of the line, VPOS and YPOS are the
+vertical position in lines and pixels of the line, relative to the top
+of the first text line, and OFFBOT is the number of off-window pixels at
+the bottom of the text line.  If there are off-window pixels at the top
+of the (first) text line, YPOS is negative.
+
+Return nil if window display is not up-to-date.  In that case, use
+`pos-visible-in-window-p' to obtain the information.  */)
+  (Lisp_Object line, Lisp_Object window)
+{
+  register struct window *w;
+  register struct buffer *b;
+  struct glyph_row *row, *end_row;
+  int max_y, crop, i, n;
+
+  w = decode_window (window);
+
+  if (noninteractive || w->pseudo_window_p)
+    return Qnil;
+
+  CHECK_BUFFER (w->buffer);
+  b = XBUFFER (w->buffer);
+
+  /* Fail if current matrix is not up-to-date.  */
+  if (NILP (w->window_end_valid)
+      || current_buffer->clip_changed
+      || current_buffer->prevent_redisplay_optimizations_p
+      || XFASTINT (w->last_modified) < BUF_MODIFF (b)
+      || XFASTINT (w->last_overlay_modified) < BUF_OVERLAY_MODIFF (b))
+    return Qnil;
+
+  if (NILP (line))
+    {
+      i = w->cursor.vpos;
+      if (i < 0 || i >= w->current_matrix->nrows
+         || (row = MATRIX_ROW (w->current_matrix, i), !row->enabled_p))
+       return Qnil;
+      max_y = window_text_bottom_y (w);
+      goto found_row;
+    }
+
+  if (EQ (line, Qheader_line))
+    {
+      if (!WINDOW_WANTS_HEADER_LINE_P (w))
+       return Qnil;
+      row = MATRIX_HEADER_LINE_ROW (w->current_matrix);
+      if (!row->enabled_p)
+       return Qnil;
+      return list4 (make_number (row->height),
+                   make_number (0), make_number (0),
+                   make_number (0));
+    }
+
+  if (EQ (line, Qmode_line))
+    {
+      row = MATRIX_MODE_LINE_ROW (w->current_matrix);
+      if (!row->enabled_p)
+       return Qnil;
+      return list4 (make_number (row->height),
+                   make_number (0), /* not accurate */
+                   make_number (WINDOW_HEADER_LINE_HEIGHT (w)
+                                + window_text_bottom_y (w)),
+                   make_number (0));
+    }
+
+  CHECK_NUMBER (line);
+  n = XINT (line);
+
+  row = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
+  end_row = MATRIX_BOTTOM_TEXT_ROW (w->current_matrix, w);
+  max_y = window_text_bottom_y (w);
+  i = 0;
+
+  while ((n < 0 || i < n)
+        && row <= end_row && row->enabled_p
+        && row->y + row->height < max_y)
+    row++, i++;
+
+  if (row > end_row || !row->enabled_p)
+    return Qnil;
+
+  if (++n < 0)
+    {
+      if (-n > i)
+       return Qnil;
+      row += n;
+      i += n;
+    }
+
+ found_row:
+  crop = max (0, (row->y + row->height) - max_y);
+  return list4 (make_number (row->height + min (0, row->y) - crop),
+               make_number (i),
+               make_number (row->y),
+               make_number (crop));
+}
 
 DEFUN ("window-dedicated-p", Fwindow_dedicated_p, Swindow_dedicated_p,
        0, 1, 0,
@@ -1586,22 +1642,22 @@
 DEFUN ("set-window-dedicated-p", Fset_window_dedicated_p,
        Sset_window_dedicated_p, 2, 2, 0,
        doc: /* Mark WINDOW as dedicated according to FLAG.
-WINDOW defaults to the selected window.  FLAG non-nil means mark WINDOW
-as dedicated to its buffer.  FLAG nil means mark WINDOW as non-dedicated.
-Return FLAG.
+WINDOW must be a live window and defaults to the selected one.  FLAG
+non-nil means mark WINDOW as dedicated to its buffer.  FLAG nil means
+mark WINDOW as non-dedicated.  Return FLAG.
 
 When a window is dedicated to its buffer, `display-buffer' will refrain
 from displaying another buffer in it.  `get-lru-window' and
 `get-largest-window' treat dedicated windows specially.
-`delete-windows-on', `replace-buffer-in-windows', `quit-window' and
-`kill-buffer' can delete a dedicated window and the containing
-frame.
+`delete-windows-on', `replace-buffer-in-windows', `quit-window',
+`quit-restore-window' and `kill-buffer' can delete a dedicated window
+and the containing frame.
 
 As a special case, if FLAG is t, mark WINDOW as "strongly" dedicated to
 its buffer.  Functions like `set-window-buffer' may change the buffer
 displayed by a window, unless that window is strongly dedicated to its
 buffer.  If and when `set-window-buffer' displays another buffer in a
-window, it also makes sure that the window is not marked as dedicated.  */)
+window, it also makes sure that the window is no more dedicated.  */)
   (Lisp_Object window, Lisp_Object flag)
 {
   register struct window *w = decode_window (window);
@@ -1610,6 +1666,52 @@
   return w->dedicated;
 }
 
+DEFUN ("window-prev-buffers", Fwindow_prev_buffers, Swindow_prev_buffers,
+       0, 1, 0,
+       doc:  /* Return buffers previously shown in WINDOW.
+WINDOW must be a live window and defaults to the selected one.
+
+The return value is either nil or a list of <buffer, window-start,
+window-point> triples where buffer was previously shown in WINDOW.  */)
+  (Lisp_Object window)
+{
+  return decode_window (window)->prev_buffers;
+}
+
+DEFUN ("set-window-prev-buffers", Fset_window_prev_buffers,
+       Sset_window_prev_buffers, 2, 2, 0,
+       doc: /* Set WINDOW's previous buffers to PREV-BUFFERS.
+WINDOW must be a live window and defaults to the selected one.  Return
+PREV-BUFFERS.
+
+PREV-BUFFERS should be either nil or a list of <buffer, window-start,
+window-point> triples where buffer was previously shown in WINDOW.  */)
+     (Lisp_Object window, Lisp_Object prev_buffers)
+{
+  return decode_any_window (window)->prev_buffers = prev_buffers;
+}
+
+DEFUN ("window-next-buffers", Fwindow_next_buffers, Swindow_next_buffers,
+       0, 1, 0,
+       doc:  /* Return list of buffers recently re-shown in WINDOW.
+WINDOW must be a live window and defaults to the selected one.  */)
+     (Lisp_Object window)
+{
+  return decode_window (window)->next_buffers;
+}
+
+DEFUN ("set-window-next-buffers", Fset_window_next_buffers,
+       Sset_window_next_buffers, 2, 2, 0,
+       doc: /* Set WINDOW's next buffers to NEXT-BUFFERS.
+WINDOW must be a live window and defaults to the selected one.  Return
+NEXT-BUFFERS.
+
+NEXT-BUFFERS should be either nil or a list of buffers that have been
+recently re-shown in WINDOW.  */)
+     (Lisp_Object window, Lisp_Object next_buffers)
+{
+  return decode_any_window (window)->next_buffers = next_buffers;
+}
 
 DEFUN ("window-parameters", Fwindow_parameters, Swindow_parameters,
        0, 1, 0,
@@ -1618,7 +1720,7 @@
 elements of the form (PARAMETER . VALUE). */)
   (Lisp_Object window)
 {
-  return Fcopy_alist (decode_window (window)->window_parameters);
+  return Fcopy_alist (decode_any_window (window)->window_parameters);
 }
 
 DEFUN ("window-parameter", Fwindow_parameter, Swindow_parameter,
@@ -1629,7 +1731,7 @@
 {
   Lisp_Object result;
 
-  result = Fassq (parameter, decode_window (window)->window_parameters);
+  result = Fassq (parameter, decode_any_window (window)->window_parameters);
   return CDR_SAFE (result);
 }
 
@@ -1639,7 +1741,7 @@
 WINDOW defaults to the selected window.  Return VALUE.  */)
   (Lisp_Object window, Lisp_Object parameter, Lisp_Object value)
 {
-  register struct window *w = decode_window (window);
+  register struct window *w = decode_any_window (window);
   Lisp_Object old_alist_elt;
 
   old_alist_elt = Fassq (parameter, w->window_parameters);
@@ -1650,7 +1752,6 @@
   return value;
 }
 
-
 DEFUN ("window-display-table", Fwindow_display_table, Swindow_display_table,
        0, 1, 0,
        doc: /* Return the display-table that WINDOW is using.
@@ -2033,7 +2134,7 @@
 
 /* Add window W to *USER_DATA.  USER_DATA is actually a Lisp_Object
    pointer.  This is a callback function for foreach_window, used in
-   function window_list.  */
+   the window_list function.  */
 
 static int
 add_window_to_list (struct window *w, void *user_data)
@@ -2662,26 +2763,25 @@
   window_loop (CHECK_ALL_WINDOWS, Qnil, 1, Qt);
 }
 
-DEFUN ("window-use-time", Fwindow_use_time, Swindow_use_time, 0, 1, 0,
-       doc: /* Return WINDOW's use time.
-WINDOW defaults to the selected window.  The window with the highest use
-time is the most recently selected one.  The window with the lowest use
-time is the least recently selected one.  */)
-  (Lisp_Object window)
-{
-  return decode_window (window)->use_time;
-}
-
 DEFUN ("get-buffer-window", Fget_buffer_window, Sget_buffer_window, 0, 2, 0,
        doc: /* Return a window currently displaying BUFFER-OR-NAME, or nil if 
none.
-BUFFER-OR-NAME may be a buffer or a buffer name and defaults to the
-current buffer.
-If optional argument FRAME is `visible', search all visible frames.
-If optional argument FRAME is 0, search all visible and iconified frames.
-If FRAME is t, search all frames.
-If FRAME is nil, search only the selected frame.
-If FRAME is a frame, search only that frame.  */)
-  (Lisp_Object buffer_or_name, Lisp_Object frame)
+BUFFER-OR-NAME may be a buffer or a buffer name and defaults to
+the current buffer.
+
+The optional argument ALL-FRAMES specifies the frames to consider:
+
+- t means consider all windows on all existing frames.
+
+- `visible' means consider all windows on all visible frames.
+
+- 0 (the number zero) means consider all windows on all visible
+    and iconified frames.
+
+- A frame means consider all windows on that frame only.
+
+Any other value of ALL-FRAMES means consider all windows on the
+selected frame and no others.  */)
+     (Lisp_Object buffer_or_name, Lisp_Object all_frames)
 {
   Lisp_Object buffer;
 
@@ -2691,7 +2791,7 @@
     buffer = Fget_buffer (buffer_or_name);
 
   if (BUFFERP (buffer))
-    return window_loop (GET_BUFFER_WINDOW, buffer, 1, frame);
+    return window_loop (GET_BUFFER_WINDOW, buffer, 1, all_frames);
   else
     return Qnil;
 }
@@ -3723,6 +3823,17 @@
   unbind_to (count, Qnil);
 }
 
+DEFUN ("set-window-clone-number", Fset_window_clone_number, 
Sset_window_clone_number, 2, 2, 0,
+       doc: /* Set WINDOW's clone number to CLONE-NUMBER.
+WINDOW can be any window and defaults to the selected one.  */)
+     (Lisp_Object window, Lisp_Object clone_number)
+{
+  register struct window *w = decode_any_window (window);
+
+  CHECK_NUMBER (clone_number);
+  w->clone_number = clone_number;
+  return w->clone_number;
+}
 
 DEFUN ("set-window-buffer", Fset_window_buffer, Sset_window_buffer, 2, 3, 0,
        doc: /* Make WINDOW display BUFFER-OR-NAME as its contents.
@@ -3912,6 +4023,7 @@
 
   ++sequence_number;
   XSETFASTINT (p->sequence_number, sequence_number);
+  XSETFASTINT (p->clone_number, sequence_number);
 
   /* Put new into window structure in place of window */
   replace_window (window, new);
@@ -3925,6 +4037,112 @@
   p->start = Qnil;
   p->pointm = Qnil;
   p->buffer = Qnil;
+
+  p->splits = Qnil;
+  p->nest = Qnil;
+  p->window_parameters = Qnil;
+
+}
+
+/* Make new window from scratch.  */
+Lisp_Object
+make_window (void)
+{
+  Lisp_Object window;
+  register struct window *w;
+
+  w = allocate_window ();
+  /* Initialize all Lisp data.  */
+  w->frame = w->mini_p = Qnil;
+  w->next = w->prev = w->hchild = w->vchild = w->parent = Qnil;
+  XSETFASTINT (w->left_col, 0);
+  XSETFASTINT (w->top_line, 0);
+  XSETFASTINT (w->total_lines, 0);
+  XSETFASTINT (w->total_cols, 0);
+  w->normal_lines = make_float (1.0);
+  w->normal_cols = make_float (1.0);
+  XSETFASTINT (w->new_total, 0);
+  XSETFASTINT (w->new_normal, 0);
+  w->buffer = Qnil;
+  w->start = Fmake_marker ();
+  w->pointm = Fmake_marker ();
+  w->force_start = w->optional_new_start = Qnil;
+  XSETFASTINT (w->hscroll, 0);
+  XSETFASTINT (w->min_hscroll, 0);
+  XSETFASTINT (w->use_time, 0);
+  ++sequence_number;
+  XSETFASTINT (w->sequence_number, sequence_number);
+  XSETFASTINT (w->clone_number, sequence_number);
+  w->temslot = w->last_modified = w->last_overlay_modified = Qnil;
+  XSETFASTINT (w->last_point, 0);
+  w->last_had_star = w->vertical_scroll_bar = Qnil;
+  w->left_margin_cols = w->right_margin_cols = Qnil;
+  w->left_fringe_width = w->right_fringe_width = Qnil;
+  w->fringes_outside_margins = Qnil;
+  w->scroll_bar_width = Qnil;
+  w->vertical_scroll_bar_type = Qt;
+  w->last_mark_x = w->last_mark_y = Qnil;
+  XSETFASTINT (w->window_end_pos, 0);
+  XSETFASTINT (w->window_end_vpos, 0);
+  w->window_end_valid = w->update_mode_line = Qnil;
+  w->start_at_line_beg = w->display_table = w->dedicated = Qnil;
+  w->base_line_number = w->base_line_pos = w->region_showing = Qnil;
+  w->column_number_displayed = w->redisplay_end_trigger = Qnil;
+  w->splits = w->nest = w->window_parameters = Qnil;
+  w->prev_buffers = w->next_buffers = Qnil;
+  /* Initialize non-Lisp data.  */
+  w->desired_matrix = w->current_matrix = 0;
+  w->nrows_scale_factor = w->ncols_scale_factor = 1;
+  memset (&w->cursor, 0, sizeof (w->cursor));
+  memset (&w->last_cursor, 0, sizeof (w->last_cursor));
+  memset (&w->phys_cursor, 0, sizeof (w->phys_cursor));
+  w->phys_cursor_type = -1;
+  w->phys_cursor_width = -1;
+  w->last_cursor_off_p = w->cursor_off_p = 0;
+  w->must_be_updated_p = 0;
+  w->pseudo_window_p = 0;
+  w->frozen_window_start_p = 0;
+  w->vscroll = 0;
+  w->resize_proportionally = Qnil;
+  /* Reset window_list.  */
+  Vwindow_list = Qnil;
+  /* Return window.  */
+  XSETWINDOW (window, w);
+  return window;
+}
+
+DEFUN ("set-window-new-total", Fset_window_new_total, Sset_window_new_total, 
2, 3, 0,
+       doc: /* Set new total size of WINDOW to SIZE.
+Return SIZE.
+
+Optional argument ADD non-nil means add SIZE to the new total size of
+WINDOW and return the sum.
+
+Note: This function does not operate on any subwindows of WINDOW.  */)
+     (Lisp_Object window, Lisp_Object size, Lisp_Object add)
+{
+  struct window *w = decode_any_window (window);
+
+  CHECK_NUMBER (size);
+  if (NILP (add))
+    XSETINT (w->new_total, XINT (size));
+  else
+    XSETINT (w->new_total, XINT (w->new_total) + XINT (size));
+
+  return w->new_total;
+}
+
+DEFUN ("set-window-new-normal", Fset_window_new_normal, 
Sset_window_new_normal, 1, 2, 0,
+       doc: /* Set new normal size of WINDOW to SIZE.
+Return SIZE.
+
+Note: This function does not operate on any subwindows of WINDOW.  */)
+     (Lisp_Object window, Lisp_Object size)
+{
+  struct window *w = decode_any_window (window);
+
+  w->new_normal = size;
+  return w->new_normal;
 }
 
 DEFUN ("split-window", Fsplit_window, Ssplit_window, 0, 3, "",
@@ -5970,9 +6188,11 @@
 struct saved_window
 {
   struct vectorlike_header header;
-  Lisp_Object window;
+
+  Lisp_Object window, clone_number;
   Lisp_Object buffer, start, pointm, mark;
   Lisp_Object left_col, top_line, total_cols, total_lines;
+  Lisp_Object normal_cols, normal_lines;
   Lisp_Object hscroll, min_hscroll;
   Lisp_Object parent, prev;
   Lisp_Object start_at_line_beg;
@@ -5982,6 +6202,7 @@
   Lisp_Object left_fringe_width, right_fringe_width, fringes_outside_margins;
   Lisp_Object scroll_bar_width, vertical_scroll_bar_type;
   Lisp_Object dedicated, resize_proportionally;
+  Lisp_Object splits, nest, window_parameters;
 };
 
 #define SAVED_WINDOW_N(swv,n) \
@@ -6186,6 +6407,7 @@
                }
            }
 
+         w->clone_number = p->clone_number;
          /* If we squirreled away the buffer in the window's height,
             restore it now.  */
          if (BUFFERP (w->total_lines))
@@ -6194,6 +6416,8 @@
          w->top_line = p->top_line;
          w->total_cols = p->total_cols;
          w->total_lines = p->total_lines;
+         w->normal_cols = p->normal_cols;
+         w->normal_lines = p->normal_lines;
          w->hscroll = p->hscroll;
          w->min_hscroll = p->min_hscroll;
          w->display_table = p->display_table;
@@ -6207,6 +6431,9 @@
          w->scroll_bar_width = p->scroll_bar_width;
          w->vertical_scroll_bar_type = p->vertical_scroll_bar_type;
          w->dedicated = p->dedicated;
+         w->splits = p->splits;
+         w->nest = p->nest;
+         w->window_parameters = p->window_parameters;
          w->resize_proportionally = p->resize_proportionally;
          XSETFASTINT (w->last_modified, 0);
          XSETFASTINT (w->last_overlay_modified, 0);
@@ -6445,11 +6672,14 @@
 
       XSETFASTINT (w->temslot, i); i++;
       p->window = window;
+      p->clone_number = w->clone_number;
       p->buffer = w->buffer;
       p->left_col = w->left_col;
       p->top_line = w->top_line;
       p->total_cols = w->total_cols;
       p->total_lines = w->total_lines;
+      p->normal_cols = w->normal_cols;
+      p->normal_lines = w->normal_lines;
       p->hscroll = w->hscroll;
       p->min_hscroll = w->min_hscroll;
       p->display_table = w->display_table;
@@ -6463,7 +6693,10 @@
       p->scroll_bar_width = w->scroll_bar_width;
       p->vertical_scroll_bar_type = w->vertical_scroll_bar_type;
       p->dedicated = w->dedicated;
+      p->splits = w->splits;
+      p->nest = w->nest;
       p->resize_proportionally = w->resize_proportionally;
+      p->window_parameters = w->window_parameters;
       if (!NILP (w->buffer))
        {
          /* Save w's value of point in the window configuration.
@@ -7281,16 +7514,26 @@
   defsubr (&Sset_frame_selected_window);
   defsubr (&Spos_visible_in_window_p);
   defsubr (&Swindow_line_height);
+  defsubr (&Swindow_clone_number);
   defsubr (&Swindow_buffer);
   defsubr (&Swindow_parent);
   defsubr (&Swindow_vchild);
   defsubr (&Swindow_hchild);
   defsubr (&Swindow_next);
   defsubr (&Swindow_prev);
+  defsubr (&Swindow_splits);
+  defsubr (&Sset_window_splits);
+  defsubr (&Swindow_nest);
+  defsubr (&Sset_window_nest);
   defsubr (&Swindow_use_time);
   defsubr (&Swindow_top_line);
   defsubr (&Swindow_left_column);
   defsubr (&Swindow_total_size);
+  defsubr (&Swindow_normal_size);
+  defsubr (&Swindow_new_total);
+  defsubr (&Swindow_new_normal);
+  defsubr (&Sset_window_new_total);
+  defsubr (&Sset_window_new_normal);
   defsubr (&Swindow_body_size);
   defsubr (&Swindow_hscroll);
   defsubr (&Sset_window_hscroll);
@@ -7322,6 +7565,7 @@
   defsubr (&Sreplace_buffer_in_windows);
   defsubr (&Sdelete_window);
   defsubr (&Sset_window_buffer);
+  defsubr (&Sset_window_clone_number);
   defsubr (&Sselect_window);
   defsubr (&Sforce_window_update);
   defsubr (&Stemp_output_buffer_show);
@@ -7355,6 +7599,10 @@
   defsubr (&Scompare_window_configurations);
   defsubr (&Swindow_list);
   defsubr (&Swindow_list_1);
+  defsubr (&Swindow_prev_buffers);
+  defsubr (&Sset_window_prev_buffers);
+  defsubr (&Swindow_next_buffers);
+  defsubr (&Sset_window_next_buffers);
   defsubr (&Swindow_parameters);
   defsubr (&Swindow_parameter);
   defsubr (&Sset_window_parameter);

=== modified file 'src/window.h'
--- a/src/window.h      2011-06-07 12:51:07 +0000
+++ b/src/window.h      2011-06-08 08:35:20 +0000
@@ -93,38 +93,57 @@
 
     /* The frame this window is on.  */
     Lisp_Object frame;
+
     /* t if this window is a minibuffer window.  */
     Lisp_Object mini_p;
-    /* Following child (to right or down) at same level of tree */
-    Lisp_Object next;
-    /* Preceding child (to left or up) at same level of tree */
-    Lisp_Object prev;
-    /* First child of this window. */
-    /* vchild is used if this is a vertical combination,
-       hchild if this is a horizontal combination. */
+
+    /* Following (to right or down) and preceding (to left or up) child
+       at same level of tree.  */
+    Lisp_Object next, prev;
+
+    /* First child of this window: vchild is used if this is a vertical
+       combination, hchild if this is a horizontal combination.  Of the
+       fields vchild, hchild and buffer, one and only one is non-nil
+       unless the window is dead.  */
     Lisp_Object hchild, vchild;
-    /* The window this one is a child of. */
+
+    /* The window this one is a child of.  */
     Lisp_Object parent;
-    /* The upper left corner coordinates of this window,
-       as integers relative to upper left corner of frame = 0, 0 */
+
+    /* The upper left corner coordinates of this window, as integers
+       relative to upper left corner of frame = 0, 0.  */
     Lisp_Object left_col;
     Lisp_Object top_line;
-    /* The size of the window */
+
+    /* The size of the window.  */
     Lisp_Object total_lines;
     Lisp_Object total_cols;
-    /* The buffer displayed in this window */
-    /* Of the fields vchild, hchild and buffer, only one is non-nil.  */
+
+    /* The normal size of the window.  */
+    Lisp_Object normal_lines;
+    Lisp_Object normal_cols;
+
+    /* New sizes of the window.  */
+    Lisp_Object new_total;
+    Lisp_Object new_normal;
+
+    /* The buffer displayed in this window.  Of the fields vchild,
+       hchild and buffer, one and only one is non-nil unless the window
+       is dead.  */
     Lisp_Object buffer;
+
     /* A marker pointing to where in the text to start displaying.
        BIDI Note: This is the _logical-order_ start, i.e. the smallest
        buffer position visible in the window, not necessarily the
        character displayed in the top left corner of the window.  */
     Lisp_Object start;
+
     /* A marker pointing to where in the text point is in this window,
        used only when the window is not selected.
        This exists so that when multiple windows show one buffer
        each one can have its own value of point.  */
     Lisp_Object pointm;
+
     /* Non-nil means next redisplay must use the value of start
        set up for it in advance.  Set by scrolling commands.  */
     Lisp_Object force_start;
@@ -133,26 +152,38 @@
        This is used in Fdelete_other_windows to force a call to
        Vwindow_scroll_functions; also by Frecenter with argument.  */
     Lisp_Object optional_new_start;
+
     /* Number of columns display within the window is scrolled to the left.  */
     Lisp_Object hscroll;
     /* Minimum hscroll for automatic hscrolling.  This is the value
        the user has set, by set-window-hscroll for example.  */
     Lisp_Object min_hscroll;
-    /* Number saying how recently window was selected */
+
+    /* Number saying how recently window was selected.  */
     Lisp_Object use_time;
-    /* Unique number of window assigned when it was created */
+
+    /* Unique number of window assigned when it was created.  */
     Lisp_Object sequence_number;
-    /* No permanent meaning; used by save-window-excursion's bookkeeping */
+
+    /* Sequence number of window this window was cloned from.  Identic
+       to sequence number if window was not cloned.  */
+    Lisp_Object clone_number;
+
+    /* No permanent meaning; used by save-window-excursion's
+       bookkeeping.  */
     Lisp_Object temslot;
-    /* text.modified of displayed buffer as of last time display completed */
+
+    /* text.modified of displayed buffer as of last time display
+       completed.  */
     Lisp_Object last_modified;
     /* BUF_OVERLAY_MODIFIED of displayed buffer as of last complete update.  */
     Lisp_Object last_overlay_modified;
-    /* Value of point at that time */
+    /* Value of point at that time.  */
     Lisp_Object last_point;
     /* Non-nil if the buffer was "modified" when the window
        was last updated.  */
     Lisp_Object last_had_star;
+
     /* This window's vertical scroll bar.  This field is only for use
        by the window-system-dependent code which implements the
        scroll bars; it can store anything it likes here.  If this
@@ -167,14 +198,14 @@
     /* Width of left and right fringes.
        A value of nil or t means use frame values.  */
     Lisp_Object left_fringe_width, right_fringe_width;
-
-  /* Non-nil means fringes are drawn outside display margins;
-     othersize draw them between margin areas and text.  */
+    /* Non-nil means fringes are drawn outside display margins;
+       othersize draw them between margin areas and text.  */
     Lisp_Object fringes_outside_margins;
 
     /* Pixel width of scroll bars.
        A value of nil or t means use frame values.  */
     Lisp_Object scroll_bar_width;
+
     /* Type of vertical scroll bar.  A value of nil means
        no scroll bar.  A value of t means use frame value.  */
     Lisp_Object vertical_scroll_bar_type;
@@ -183,6 +214,7 @@
     /* May be nil if mark does not exist or was not on frame */
     Lisp_Object last_mark_x;
     Lisp_Object last_mark_y;
+
     /* Z - the buffer position of the last glyph in the current matrix
        of W.  Only valid if WINDOW_END_VALID is not nil.  */
     Lisp_Object window_end_pos;
@@ -194,30 +226,38 @@
        since in that case the frame image that window_end_pos
        did not get onto the frame.  */
     Lisp_Object window_end_valid;
+
     /* Non-nil means must regenerate mode line of this window */
     Lisp_Object update_mode_line;
+
     /* Non-nil means current value of `start'
        was the beginning of a line when it was chosen.  */
     Lisp_Object start_at_line_beg;
+
     /* Display-table to use for displaying chars in this window.
        Nil means use the buffer's own display-table.  */
     Lisp_Object display_table;
+
     /* Non-nil means window is marked as dedicated.  */
     Lisp_Object dedicated;
-    /* Line number and position of a line somewhere above the
-       top of the screen.  */
-    /* If this field is nil, it means we don't have a base line.  */
+
+    /* Line number and position of a line somewhere above the top of the
+       screen.  If this field is nil, it means we don't have a base
+       line.  */
     Lisp_Object base_line_number;
     /* If this field is nil, it means we don't have a base line.
        If it is a buffer, it means don't display the line number
        as long as the window shows that buffer.  */
     Lisp_Object base_line_pos;
+
     /* If we have highlighted the region (or any part of it),
        this is the mark position that we used, as an integer.  */
     Lisp_Object region_showing;
+
     /* The column number currently displayed in this window's mode line,
        or nil if column numbers are not being displayed.  */
     Lisp_Object column_number_displayed;
+
     /* If redisplay in this window goes beyond this buffer position,
        must run the redisplay-end-trigger-hook.  */
     Lisp_Object redisplay_end_trigger;
@@ -228,6 +268,21 @@
     /* Original window height and top before mini-window was enlarged. */
     Lisp_Object orig_total_lines, orig_top_line;
 
+    /* Non-nil means deleting or resizing this window distributes
+       space among all windows in the same combination.  */
+    Lisp_Object splits;
+
+    /* Non-nil means this window's child windows are never
+       (re-)combined.  */
+    Lisp_Object nest;
+
+    /* Alist of <buffer, window-start, window-point> triples listing
+       buffers previously shown in this window.  */
+    Lisp_Object prev_buffers;
+
+    /* List of buffers re-shown in this window.  */
+    Lisp_Object next_buffers;
+
     /* An alist with parameteres.  */
     Lisp_Object window_parameters;
 
@@ -361,6 +416,17 @@
 #define WINDOW_TOTAL_HEIGHT(W) \
   (WINDOW_TOTAL_LINES (W) * WINDOW_FRAME_LINE_HEIGHT (W))
 
+/* For HORFLAG non-zero the total number of columns of window W.  Otherwise
+   the total number of lines of W.  */
+
+#define WINDOW_TOTAL_SIZE(w, horflag) \
+  (horflag ? WINDOW_TOTAL_COLS (w) : WINDOW_TOTAL_LINES (w))
+
+/* The smallest acceptable dimensions for a window.  Anything smaller
+   might crash Emacs.  */
+
+#define MIN_SAFE_WINDOW_WIDTH  (2)
+#define MIN_SAFE_WINDOW_HEIGHT (1)
 
 /* Return the canonical frame column at which window W starts.
    This includes a left-hand scroll bar, if any.  */
@@ -859,6 +925,7 @@
 EXFUN (Fpos_visible_in_window_p, 3);
 extern void mark_window_cursors_off (struct window *);
 extern int window_internal_height (struct window *);
+extern int window_body_cols (struct window *w);
 EXFUN (Frecenter, 1);
 extern void temp_output_buffer_show (Lisp_Object);
 extern void replace_buffer_in_all_windows (Lisp_Object);
@@ -867,6 +934,4 @@
 extern void syms_of_window (void);
 extern void keys_of_window (void);
 
-extern int window_body_cols (struct window *w);
-
 #endif /* not WINDOW_H_INCLUDED */


reply via email to

[Prev in Thread] Current Thread [Next in Thread]