diff src/window.c @ 102:a145efe76779 r20-1b3

Import from CVS: tag r20-1b3
author cvs
date Mon, 13 Aug 2007 09:15:49 +0200
parents 0d2f883870bc
children fe104dbd9147
line wrap: on
line diff
--- a/src/window.c	Mon Aug 13 09:15:13 2007 +0200
+++ b/src/window.c	Mon Aug 13 09:15:49 2007 +0200
@@ -77,7 +77,7 @@
 extern void energize_window_deselected_hook ();
 extern Lisp_Object desired_psheet_buffer ();
 extern void make_psheets_desired ();
-#endif
+#endif /* ENERGIZE */
 
 /* Thickness of shadow border around 3d modelines. */
 Lisp_Object Vmodeline_shadow_thickness;
@@ -102,7 +102,7 @@
 /* Non-nil means this is the buffer whose window C-M-v should scroll.  */
 Lisp_Object Vother_window_scroll_buffer;
 
-/* Non-nil means it's function to call to display temp buffers.  */
+/* Non-nil means it's the function to call to display temp buffers.  */
 Lisp_Object Vtemp_buffer_show_function;
 
 Lisp_Object Vtemp_buffer_show_hook;
@@ -144,9 +144,9 @@
                                mark_window, print_window, finalize_window,
 			       0, 0, struct window);
 
-#define MARK_DISP_VARIABLE(field)			\
-  ((markobj) (window->field[CURRENT_DISP]));		\
-  ((markobj) (window->field[DESIRED_DISP]));		\
+#define MARK_DISP_VARIABLE(field)		\
+  ((markobj) (window->field[CURRENT_DISP]));	\
+  ((markobj) (window->field[DESIRED_DISP]));	\
   ((markobj) (window->field[CMOTION_DISP]));
 
 static Lisp_Object
@@ -179,7 +179,7 @@
   ((markobj) (window->scrollbar_width));
   ((markobj) (window->scrollbar_height));
   ((markobj) (window->scrollbar_pointer));
-#endif
+#endif /* HAVE_SCROLLBARS */
   ((markobj) (window->left_margin_width));
   ((markobj) (window->right_margin_width));
 #ifdef HAVE_TOOLBARS
@@ -200,14 +200,14 @@
   ((markobj) (window->default_toolbar_height));
   ((markobj) (window->default_toolbar_width));
   ((markobj) (window->default_toolbar_visible_p));
-#endif
+#endif /* HAVE_TOOLBARS */
   ((markobj) (window->minimum_line_ascent));
   ((markobj) (window->minimum_line_descent));
   ((markobj) (window->use_left_overflow));
   ((markobj) (window->use_right_overflow));
 #ifdef HAVE_MENUBARS
   ((markobj) (window->menubar_visible_p));
-#endif
+#endif /* HAVE_MENUBARS */
   ((markobj) (window->text_cursor_visible_p));
   /* End cached specifiers. */
   ((markobj) (window->dedicated));
@@ -376,7 +376,7 @@
  * the display structures.
  */
 
-/* Create a new mindow mirror structure and associated redisplay
+/* Create a new window mirror structure and associated redisplay
    structs. */
 static struct window_mirror *
 new_window_mirror (struct frame *f)
@@ -420,7 +420,7 @@
     if (!mir)
       mir = new_window_mirror (XFRAME (XWINDOW (win)->frame));
 
-  mir->next = update_mirror_internal (XWINDOW (win)->next, mir->next);
+  mir->next   = update_mirror_internal (XWINDOW (win)->next,   mir->next);
   mir->hchild = update_mirror_internal (XWINDOW (win)->hchild, mir->hchild);
   mir->vchild = update_mirror_internal (XWINDOW (win)->vchild, mir->vchild);
 
@@ -650,7 +650,7 @@
 }
 
 
-/* Determining a windows position based solely on its pixel
+/* Determining a window's position based solely on its pixel
    positioning doesn't work.  Instead, we do it the intelligent way,
    by checking its positioning in the window hierarchy. */
 int
@@ -804,7 +804,7 @@
     return 0;
 #else
   return (!window_is_leftmost (w));
-#endif
+#endif /* HAVE_SCROLLBARS */
 }
 
 int
@@ -820,7 +820,7 @@
   return XINT (w->scrollbar_width);
 #else
   return 0;
-#endif
+#endif /* HAVE_SCROLLBARS */
 }
 
 /* Horizontal scrollbars are only active on windows with truncation
@@ -838,7 +838,7 @@
   return XINT (w->scrollbar_height);
 #else
   return 0;
-#endif
+#endif /* HAVE_SCROLLBARS */
 }
 
 int
@@ -1174,8 +1174,7 @@
 */
        (window))
 {
-  struct window *w = decode_window (window);
-  return (MINI_WINDOW_P (w) ? Qt : Qnil);
+  return (MINI_WINDOW_P (decode_window (window)) ? Qt : Qnil);
 }
 
 DEFUN ("window-first-hchild", Fwindow_first_hchild, 1, 1, 0, /*
@@ -1183,8 +1182,7 @@
 */
        (window))
 {
-  struct window *w = decode_window (window);
-  return w->hchild;
+  return decode_window (window)->hchild;
 }
 
 DEFUN ("window-first-vchild", Fwindow_first_vchild, 1, 1, 0, /*
@@ -1192,8 +1190,7 @@
 */
        (window))
 {
-  struct window *w = decode_window (window);
-  return w->vchild;
+  return decode_window (window)->vchild;
 }
 
 DEFUN ("window-next-child", Fwindow_next_child, 1, 1, 0, /*
@@ -1201,8 +1198,7 @@
 */
        (window))
 {
-  struct window *w = decode_window (window);
-  return w->next;
+  return decode_window (window)->next;
 }
 
 DEFUN ("window-previous-child", Fwindow_previous_child, 1, 1, 0, /*
@@ -1210,8 +1206,7 @@
 */
        (window))
 {
-  struct window *w = decode_window (window);
-  return w->prev;
+  return decode_window (window)->prev;
 }
 
 DEFUN ("window-parent", Fwindow_parent, 1, 1, 0, /*
@@ -1219,8 +1214,7 @@
 */
        (window))
 {
-  struct window *w = decode_window (window);
-  return w->parent;
+  return decode_window (window)->parent;
 }
 
 DEFUN ("window-lowest-p", Fwindow_lowest_p, 1, 1, 0, /*
@@ -1228,8 +1222,7 @@
 */
        (window))
 {
-  struct window *w = decode_window (window);
-  return window_is_lowest (w) ? Qt : Qnil;
+  return window_is_lowest (decode_window (window)) ? Qt : Qnil;
 }
 
 DEFUN ("window-highest-p", Fwindow_highest_p, 1, 1, 0, /*
@@ -1237,8 +1230,7 @@
 */
        (window))
 {
-  struct window *w = decode_window (window);
-  return window_is_highest (w) ? Qt : Qnil;
+  return window_is_highest (decode_window (window)) ? Qt : Qnil;
 }
 
 DEFUN ("window-leftmost-p", Fwindow_leftmost_p, 1, 1, 0, /*
@@ -1246,8 +1238,7 @@
 */
        (window))
 {
-  struct window *w = decode_window (window);
-  return window_is_leftmost (w) ? Qt : Qnil;
+  return window_is_leftmost (decode_window (window)) ? Qt : Qnil;
 }
 
 DEFUN ("window-rightmost-p", Fwindow_rightmost_p, 1, 1, 0, /*
@@ -1255,8 +1246,7 @@
 */
        (window))
 {
-  struct window *w = decode_window (window);
-  return window_is_rightmost (w) ? Qt : Qnil;
+  return window_is_rightmost (decode_window (window)) ? Qt : Qnil;
 }
 
 DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p, 0, 2, 0, /*
@@ -1266,12 +1256,11 @@
 */
        (pos, window))
 {
-  struct window *w;
+  struct window *w = decode_window (window);
   Bufpos top;
   Bufpos posint;
   struct buffer *buf;
 
-  w = decode_window (window);
   top = marker_position (w->start[CURRENT_DISP]);
 
   buf = XBUFFER (w->buffer);
@@ -1368,8 +1357,7 @@
 */
        (window))
 {
-  struct window *w = decode_window (window);
-  return (make_int (window_char_width (w, 0)));
+  return (make_int (window_char_width (decode_window (window), 0)));
 }
 
 DEFUN ("window-pixel-width", Fwindow_pixel_width, 0, 1, 0, /*
@@ -1409,34 +1397,26 @@
 
 #if 0 /* bogus RMS crock */
 
-xxDEFUN ("window-redisplay-end-trigger", Fwindow_redisplay_end_trigger,
-       Swindow_redisplay_end_trigger, 0, 1, 0 /*
+xxDEFUN ("window-redisplay-end-trigger", Fwindow_redisplay_end_trigger, 0, 1, 0 /*
 Return WINDOW's redisplay end trigger value.
 See `set-window-redisplay-end-trigger' for more information.
-*/ )
-  (window)
-     Lisp_Object window;
+*/
+	 (window))
 {
   return decode_window (window)->redisplay_end_trigger;
 }
 
-xxDEFUN ("set-window-redisplay-end-trigger", Fset_window_redisplay_end_trigger,
-       Sset_window_redisplay_end_trigger, 2, 2, 0 /*
+xxDEFUN ("set-window-redisplay-end-trigger", Fset_window_redisplay_end_trigger, 2, 2, 0 /*
 Set WINDOW's redisplay end trigger value to VALUE.
 VALUE should be a buffer position (typically a marker) or nil.
 If it is a buffer position, then if redisplay in WINDOW reaches a position
 beyond VALUE, the functions in `redisplay-end-trigger-functions' are called
 with two arguments: WINDOW, and the end trigger value.
 Afterwards the end-trigger value is reset to nil.
-*/ )
-  (window, value)
-     register Lisp_Object window, value;
+*/ 
+	 (window, value))
 {
-  register struct window *w;
-
-  w = decode_window (window);
-  w->redisplay_end_trigger = value;
-  return value;
+  return (decode_window (window)->redisplay_end_trigger = value);
 }
 
 #endif /* 0 */
@@ -2177,7 +2157,6 @@
 	    window = tem;
 	}
     }
-  /* "acceptable" is the correct spelling. */
   /* Which windows are acceptable?
      Exit the loop and accept this window if
      this isn't a minibuffer window,