comparison src/window.c @ 380:8626e4521993 r21-2-5

Import from CVS: tag r21-2-5
author cvs
date Mon, 13 Aug 2007 11:07:10 +0200
parents a300bb07d72d
children bbff43aa5eb7
comparison
equal deleted inserted replaced
379:76b7d63099ad 380:8626e4521993
34 #include "frame.h" 34 #include "frame.h"
35 #include "objects.h" 35 #include "objects.h"
36 #include "glyphs.h" 36 #include "glyphs.h"
37 #include "redisplay.h" 37 #include "redisplay.h"
38 #include "window.h" 38 #include "window.h"
39 #include "commands.h"
40 39
41 Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_configurationp; 40 Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_configurationp;
42 Lisp_Object Qscroll_up, Qscroll_down, Qdisplay_buffer; 41 Lisp_Object Qscroll_up, Qscroll_down, Qdisplay_buffer;
43 42
44 #ifdef MEMORY_USAGE_STATS 43 #ifdef MEMORY_USAGE_STATS
134 (w)->last_facechange[CMOTION_DISP] = Qzero; \ 133 (w)->last_facechange[CMOTION_DISP] = Qzero; \
135 } while (0) 134 } while (0)
136 135
137 136
138 #define MARK_DISP_VARIABLE(field) \ 137 #define MARK_DISP_VARIABLE(field) \
139 ((markobj) (window->field[CURRENT_DISP])); \ 138 markobj (window->field[CURRENT_DISP]); \
140 ((markobj) (window->field[DESIRED_DISP])); \ 139 markobj (window->field[DESIRED_DISP]); \
141 ((markobj) (window->field[CMOTION_DISP])); 140 markobj (window->field[CMOTION_DISP]);
142 141
143 static Lisp_Object 142 static Lisp_Object
144 mark_window (Lisp_Object obj, void (*markobj) (Lisp_Object)) 143 mark_window (Lisp_Object obj, void (*markobj) (Lisp_Object))
145 { 144 {
146 struct window *window = XWINDOW (obj); 145 struct window *window = XWINDOW (obj);
147 ((markobj) (window->frame)); 146 markobj (window->frame);
148 ((markobj) (window->mini_p)); 147 markobj (window->mini_p);
149 ((markobj) (window->next)); 148 markobj (window->next);
150 ((markobj) (window->prev)); 149 markobj (window->prev);
151 ((markobj) (window->hchild)); 150 markobj (window->hchild);
152 ((markobj) (window->vchild)); 151 markobj (window->vchild);
153 ((markobj) (window->parent)); 152 markobj (window->parent);
154 ((markobj) (window->buffer)); 153 markobj (window->buffer);
155 MARK_DISP_VARIABLE (start); 154 MARK_DISP_VARIABLE (start);
156 MARK_DISP_VARIABLE (pointm); 155 MARK_DISP_VARIABLE (pointm);
157 ((markobj) (window->sb_point)); /* #### move to scrollbar.c? */ 156 markobj (window->sb_point); /* #### move to scrollbar.c? */
158 ((markobj) (window->use_time)); 157 markobj (window->use_time);
159 MARK_DISP_VARIABLE (last_modified); 158 MARK_DISP_VARIABLE (last_modified);
160 MARK_DISP_VARIABLE (last_point); 159 MARK_DISP_VARIABLE (last_point);
161 MARK_DISP_VARIABLE (last_start); 160 MARK_DISP_VARIABLE (last_start);
162 MARK_DISP_VARIABLE (last_facechange); 161 MARK_DISP_VARIABLE (last_facechange);
163 ((markobj) (window->line_cache_last_updated)); 162 markobj (window->line_cache_last_updated);
164 ((markobj) (window->redisplay_end_trigger)); 163 markobj (window->redisplay_end_trigger);
165 mark_face_cachels (window->face_cachels, markobj); 164 mark_face_cachels (window->face_cachels, markobj);
166 mark_glyph_cachels (window->glyph_cachels, markobj); 165 mark_glyph_cachels (window->glyph_cachels, markobj);
167 166
168 #define WINDOW_SLOT(slot, compare) ((markobj) (window->slot)) 167 #define WINDOW_SLOT(slot, compare) ((void) (markobj (window->slot)))
169 #include "winslots.h" 168 #include "winslots.h"
170 169
171 return Qnil; 170 return Qnil;
172 } 171 }
173 172
383 redisplay structures for. */ 382 redisplay structures for. */
384 static Lisp_Object 383 static Lisp_Object
385 real_window_internal (Lisp_Object win, struct window_mirror *rmir, 384 real_window_internal (Lisp_Object win, struct window_mirror *rmir,
386 struct window_mirror *mir) 385 struct window_mirror *mir)
387 { 386 {
388 Lisp_Object retval;
389
390 for (; !NILP (win) && rmir ; win = XWINDOW (win)->next, rmir = rmir->next) 387 for (; !NILP (win) && rmir ; win = XWINDOW (win)->next, rmir = rmir->next)
391 { 388 {
392 if (mir == rmir) 389 if (mir == rmir)
393 return win; 390 return win;
394 if (!NILP (XWINDOW (win)->vchild)) 391 if (!NILP (XWINDOW (win)->vchild))
395 { 392 {
396 retval = real_window_internal (XWINDOW (win)->vchild, rmir->vchild, 393 Lisp_Object retval =
397 mir); 394 real_window_internal (XWINDOW (win)->vchild, rmir->vchild, mir);
398 if (!NILP (retval)) 395 if (!NILP (retval))
399 return retval; 396 return retval;
400 } 397 }
401 if (!NILP (XWINDOW (win)->hchild)) 398 if (!NILP (XWINDOW (win)->hchild))
402 { 399 {
403 retval = real_window_internal (XWINDOW (win)->hchild, rmir->hchild, 400 Lisp_Object retval =
404 mir); 401 real_window_internal (XWINDOW (win)->hchild, rmir->hchild, mir);
405 if (!NILP (retval)) 402 if (!NILP (retval))
406 return retval; 403 return retval;
407 } 404 }
408 } 405 }
409 406
744 /* Always if draggable */ 741 /* Always if draggable */
745 if (!NILP (w->vertical_divider_always_visible_p)) 742 if (!NILP (w->vertical_divider_always_visible_p))
746 return 1; 743 return 1;
747 744
748 #ifdef HAVE_SCROLLBARS 745 #ifdef HAVE_SCROLLBARS
749 /* Our right scrollabr is enough to separate us at the right */ 746 /* Our right scrollbar is enough to separate us at the right */
750 if (NILP (w->scrollbar_on_left_p) 747 if (NILP (w->scrollbar_on_left_p)
751 && !NILP (w->vertical_scrollbar_visible_p) 748 && !NILP (w->vertical_scrollbar_visible_p)
752 && !ZEROP (w->scrollbar_width)) 749 && !ZEROP (w->scrollbar_width))
753 return 0; 750 return 0;
754 #endif 751 #endif
783 } 780 }
784 781
785 /* Calculate width of vertical divider, including its shadows 782 /* Calculate width of vertical divider, including its shadows
786 and spacing. The returned value is effectively the distance 783 and spacing. The returned value is effectively the distance
787 between adjacent window edges. This function does not check 784 between adjacent window edges. This function does not check
788 whether a windows needs vertival divider, so the returned 785 whether a window needs a vertical divider, so the returned
789 value is a "theoretical" one */ 786 value is a "theoretical" one */
790 int 787 int
791 window_divider_width (struct window *w) 788 window_divider_width (struct window *w)
792 { 789 {
793 /* the shadow thickness can be negative. This means that the divider 790 /* the shadow thickness can be negative. This means that the divider
794 will have a depressed look */ 791 will have a depressed look */
795 792
796 if (FRAME_WIN_P (XFRAME (WINDOW_FRAME (w)))) 793 if (FRAME_WIN_P (XFRAME (WINDOW_FRAME (w))))
797 return 794 return
798 XINT (w->vertical_divider_line_width) 795 XINT (w->vertical_divider_line_width)
799 + 2 * XINT (w->vertical_divider_spacing) 796 + 2 * XINT (w->vertical_divider_spacing)
800 + 2 * abs (XINT (w->vertical_divider_shadow_thickness)); 797 + 2 * abs (XINT (w->vertical_divider_shadow_thickness));
801 else 798 else
802 return XINT (w->vertical_divider_line_width) == 0 ? 0 : 1; 799 return XINT (w->vertical_divider_line_width) == 0 ? 0 : 1;
891 Dynarr_atp (dla, 0)->descent); 888 Dynarr_atp (dla, 0)->descent);
892 else 889 else
893 /* This should be an abort except I'm not yet 100% 890 /* This should be an abort except I'm not yet 100%
894 confident that it won't ever get hit (though I 891 confident that it won't ever get hit (though I
895 haven't been able to trigger it). It is extremely 892 haven't been able to trigger it). It is extremely
896 unlikely to cause any noticable problem and even if 893 unlikely to cause any noticeable problem and even if
897 it does it will be a minor display glitch. */ 894 it does it will be a minor display glitch. */
898 /* #### Bullshit alert. It does get hit and it causes 895 /* #### Bullshit alert. It does get hit and it causes
899 noticeable glitches. real_current_modeline_height 896 noticeable glitches. real_current_modeline_height
900 is a kludge to fix this for 19.14. */ 897 is a kludge to fix this for 19.14. */
901 modeline_height = real_current_modeline_height (w); 898 modeline_height = real_current_modeline_height (w);
1049 1046
1050 int 1047 int
1051 window_left_gutter_width (struct window *w, int modeline) 1048 window_left_gutter_width (struct window *w, int modeline)
1052 { 1049 {
1053 int gutter = window_left_toolbar_width (w); 1050 int gutter = window_left_toolbar_width (w);
1054 1051
1055 if (!NILP (w->hchild) || !NILP (w->vchild)) 1052 if (!NILP (w->hchild) || !NILP (w->vchild))
1056 return 0; 1053 return 0;
1057 1054
1058 1055
1059 #ifdef HAVE_SCROLLBARS 1056 #ifdef HAVE_SCROLLBARS
1065 } 1062 }
1066 1063
1067 int 1064 int
1068 window_right_gutter_width (struct window *w, int modeline) 1065 window_right_gutter_width (struct window *w, int modeline)
1069 { 1066 {
1070 int gutter = window_left_toolbar_width (w); 1067 int gutter = window_right_toolbar_width (w);
1071 1068
1072 if (!NILP (w->hchild) || !NILP (w->vchild)) 1069 if (!NILP (w->hchild) || !NILP (w->vchild))
1073 return 0; 1070 return 0;
1074 1071
1075 #ifdef HAVE_SCROLLBARS 1072 #ifdef HAVE_SCROLLBARS
1076 if (!modeline && NILP (w->scrollbar_on_left_p)) 1073 if (!modeline && NILP (w->scrollbar_on_left_p))
1402 1399
1403 DEFUN ("window-text-area-pixel-width", 1400 DEFUN ("window-text-area-pixel-width",
1404 Fwindow_text_area_pixel_width, 0, 1, 0, /* 1401 Fwindow_text_area_pixel_width, 0, 1, 0, /*
1405 Return the width in pixels of the text-displaying portion of WINDOW. 1402 Return the width in pixels of the text-displaying portion of WINDOW.
1406 Unlike `window-pixel-width', the space occupied by the vertical 1403 Unlike `window-pixel-width', the space occupied by the vertical
1407 scrollbar or divider, if any, is not counted. 1404 scrollbar or divider, if any, is not counted.
1408 */ 1405 */
1409 (window)) 1406 (window))
1410 { 1407 {
1411 struct window *w = decode_window (window); 1408 struct window *w = decode_window (window);
1412 1409
3166 make_int (XBUFFER (buffer)->last_window_start), 3163 make_int (XBUFFER (buffer)->last_window_start),
3167 buffer); 3164 buffer);
3168 Fset_marker (w->sb_point, w->start[CURRENT_DISP], buffer); 3165 Fset_marker (w->sb_point, w->start[CURRENT_DISP], buffer);
3169 /* set start_at_line_beg correctly. GE */ 3166 /* set start_at_line_beg correctly. GE */
3170 w->start_at_line_beg = beginning_of_line_p (XBUFFER (buffer), 3167 w->start_at_line_beg = beginning_of_line_p (XBUFFER (buffer),
3171 marker_position (w->start[CURRENT_DISP])); 3168 marker_position (w->start[CURRENT_DISP]));
3172 w->force_start = 0; /* Lucid fix */ 3169 w->force_start = 0; /* Lucid fix */
3173 SET_LAST_MODIFIED (w, 1); 3170 SET_LAST_MODIFIED (w, 1);
3174 SET_LAST_FACECHANGE (w); 3171 SET_LAST_FACECHANGE (w);
3175 MARK_WINDOWS_CHANGED (w); 3172 MARK_WINDOWS_CHANGED (w);
3176 recompute_all_cached_specifiers_in_window (w); 3173 recompute_all_cached_specifiers_in_window (w);
3482 return new; 3479 return new;
3483 } 3480 }
3484 3481
3485 3482
3486 DEFUN ("enlarge-window", Fenlarge_window, 1, 3, "_p", /* 3483 DEFUN ("enlarge-window", Fenlarge_window, 1, 3, "_p", /*
3487 Make the selected window ARG lines bigger. 3484 Make the selected window N lines bigger.
3488 From program, optional second arg non-nil means grow sideways ARG columns, 3485 From program, optional second arg SIDE non-nil means grow sideways N columns,
3489 and optional third ARG specifies the window to change instead of the 3486 and optional third arg WINDOW specifies the window to change instead of the
3490 selected window. 3487 selected window.
3491 */ 3488 */
3492 (n, side, window)) 3489 (n, side, window))
3493 { 3490 {
3494 struct window *w = decode_window (window); 3491 struct window *w = decode_window (window);
3496 change_window_height (w, XINT (n), !NILP (side), /* inpixels */ 0); 3493 change_window_height (w, XINT (n), !NILP (side), /* inpixels */ 0);
3497 return Qnil; 3494 return Qnil;
3498 } 3495 }
3499 3496
3500 DEFUN ("enlarge-window-pixels", Fenlarge_window_pixels, 1, 3, "_p", /* 3497 DEFUN ("enlarge-window-pixels", Fenlarge_window_pixels, 1, 3, "_p", /*
3501 Make the selected window ARG pixels bigger. 3498 Make the selected window N pixels bigger.
3502 From program, optional second arg non-nil means grow sideways ARG pixels, 3499 From program, optional second arg SIDE non-nil means grow sideways N pixels,
3503 and optional third ARG specifies the window to change instead of the 3500 and optional third arg WINDOW specifies the window to change instead of the
3504 selected window. 3501 selected window.
3505 */ 3502 */
3506 (n, side, window)) 3503 (n, side, window))
3507 { 3504 {
3508 struct window *w = decode_window (window); 3505 struct window *w = decode_window (window);
3510 change_window_height (w, XINT (n), !NILP (side), /* inpixels */ 1); 3507 change_window_height (w, XINT (n), !NILP (side), /* inpixels */ 1);
3511 return Qnil; 3508 return Qnil;
3512 } 3509 }
3513 3510
3514 DEFUN ("shrink-window", Fshrink_window, 1, 3, "_p", /* 3511 DEFUN ("shrink-window", Fshrink_window, 1, 3, "_p", /*
3515 Make the selected window ARG lines smaller. 3512 Make the selected window N lines smaller.
3516 From program, optional second arg non-nil means shrink sideways ARG columns, 3513 From program, optional second arg SIDE non-nil means shrink sideways N columns,
3517 and optional third ARG specifies the window to change instead of the 3514 and optional third arg WINDOW specifies the window to change instead of the
3518 selected window. 3515 selected window.
3519 */ 3516 */
3520 (n, side, window)) 3517 (n, side, window))
3521 { 3518 {
3522 CHECK_INT (n); 3519 CHECK_INT (n);
3524 /* inpixels */ 0); 3521 /* inpixels */ 0);
3525 return Qnil; 3522 return Qnil;
3526 } 3523 }
3527 3524
3528 DEFUN ("shrink-window-pixels", Fshrink_window_pixels, 1, 3, "_p", /* 3525 DEFUN ("shrink-window-pixels", Fshrink_window_pixels, 1, 3, "_p", /*
3529 Make the selected window ARG pixels smaller. 3526 Make the selected window N pixels smaller.
3530 From program, optional second arg non-nil means shrink sideways ARG pixels, 3527 From program, optional second arg SIDE non-nil means shrink sideways N pixels,
3531 and optional third ARG specifies the window to change instead of the 3528 and optional third arg WINDOW specifies the window to change instead of the
3532 selected window. 3529 selected window.
3533 */ 3530 */
3534 (n, side, window)) 3531 (n, side, window))
3535 { 3532 {
3536 CHECK_INT (n); 3533 CHECK_INT (n);
3910 keeping things consistent while not affecting siblings. */ 3907 keeping things consistent while not affecting siblings. */
3911 CURSIZE (XWINDOW (parent)) = opht + delta1; 3908 CURSIZE (XWINDOW (parent)) = opht + delta1;
3912 (*setsizefun) (window, *sizep + delta1, 0); 3909 (*setsizefun) (window, *sizep + delta1, 0);
3913 3910
3914 /* Squeeze out delta1 lines or columns from our parent, 3911 /* Squeeze out delta1 lines or columns from our parent,
3915 shriking this window and siblings proportionately. 3912 shrinking this window and siblings proportionately.
3916 This brings parent back to correct size. 3913 This brings parent back to correct size.
3917 Delta1 was calculated so this makes this window the desired size, 3914 Delta1 was calculated so this makes this window the desired size,
3918 taking it all out of the siblings. */ 3915 taking it all out of the siblings. */
3919 (*setsizefun) (parent, opht, 0); 3916 (*setsizefun) (parent, opht, 0);
3920 } 3917 }
3955 3952
3956 point = make_int (pos); 3953 point = make_int (pos);
3957 } 3954 }
3958 3955
3959 /* Always set force_start so that redisplay_window will run 3956 /* Always set force_start so that redisplay_window will run
3960 thw window-scroll-functions. */ 3957 the window-scroll-functions. */
3961 w->force_start = 1; 3958 w->force_start = 1;
3962 3959
3963 /* #### When the fuck does this happen? I'm so glad that history has 3960 /* #### When the fuck does this happen? I'm so glad that history has
3964 completely documented the behavior of the scrolling functions under 3961 completely documented the behavior of the scrolling functions under
3965 all circumstances. */ 3962 all circumstances. */
4128 } 4125 }
4129 4126
4130 } 4127 }
4131 4128
4132 DEFUN ("scroll-up", Fscroll_up, 0, 1, "_P", /* 4129 DEFUN ("scroll-up", Fscroll_up, 0, 1, "_P", /*
4133 Scroll text of current window upward ARG lines; or near full screen if no ARG. 4130 Scroll text of current window upward N lines; or near full screen if no arg.
4134 A near full screen is `next-screen-context-lines' less than a full screen. 4131 A near full screen is `next-screen-context-lines' less than a full screen.
4135 Negative ARG means scroll downward. 4132 Negative N means scroll downward.
4136 When calling from a program, supply a number as argument or nil. 4133 When calling from a program, supply an integer as argument or nil.
4137 On attempt to scroll past end of buffer, `end-of-buffer' is signaled. 4134 On attempt to scroll past end of buffer, `end-of-buffer' is signaled.
4138 On attempt to scroll past beginning of buffer, `beginning-of-buffer' is 4135 On attempt to scroll past beginning of buffer, `beginning-of-buffer' is
4139 signaled. 4136 signaled.
4140 */ 4137 */
4141 (n)) 4138 (n))
4143 window_scroll (Fselected_window (Qnil), n, 1, ERROR_ME); 4140 window_scroll (Fselected_window (Qnil), n, 1, ERROR_ME);
4144 return Qnil; 4141 return Qnil;
4145 } 4142 }
4146 4143
4147 DEFUN ("scroll-down", Fscroll_down, 0, 1, "_P", /* 4144 DEFUN ("scroll-down", Fscroll_down, 0, 1, "_P", /*
4148 Scroll text of current window downward ARG lines; or near full screen if no ARG. 4145 Scroll text of current window downward N lines; or near full screen if no arg.
4149 A near full screen is `next-screen-context-lines' less than a full screen. 4146 A near full screen is `next-screen-context-lines' less than a full screen.
4150 Negative ARG means scroll upward. 4147 Negative N means scroll upward.
4151 When calling from a program, supply a number as argument or nil. 4148 When calling from a program, supply a number as argument or nil.
4152 On attempt to scroll past end of buffer, `end-of-buffer' is signaled. 4149 On attempt to scroll past end of buffer, `end-of-buffer' is signaled.
4153 On attempt to scroll past beginning of buffer, `beginning-of-buffer' is 4150 On attempt to scroll past beginning of buffer, `beginning-of-buffer' is
4154 signaled. 4151 signaled.
4155 */ 4152 */
4203 4200
4204 return window; 4201 return window;
4205 } 4202 }
4206 4203
4207 DEFUN ("scroll-other-window", Fscroll_other_window, 0, 1, "_P", /* 4204 DEFUN ("scroll-other-window", Fscroll_other_window, 0, 1, "_P", /*
4208 Scroll next window upward ARG lines; or near full frame if no ARG. 4205 Scroll next window upward N lines; or near full frame if no arg.
4209 The next window is the one below the current one; or the one at the top 4206 The next window is the one below the current one; or the one at the top
4210 if the current one is at the bottom. Negative ARG means scroll downward. 4207 if the current one is at the bottom. Negative N means scroll downward.
4211 When calling from a program, supply a number as argument or nil. 4208 When calling from a program, supply a number as argument or nil.
4212 4209
4213 If in the minibuffer, `minibuffer-scroll-window' if non-nil 4210 If in the minibuffer, `minibuffer-scroll-window' if non-nil
4214 specifies the window to scroll. 4211 specifies the window to scroll.
4215 If `other-window-scroll-buffer' is non-nil, scroll the window 4212 If `other-window-scroll-buffer' is non-nil, scroll the window
4220 window_scroll (Fother_window_for_scrolling (), n, 1, ERROR_ME); 4217 window_scroll (Fother_window_for_scrolling (), n, 1, ERROR_ME);
4221 return Qnil; 4218 return Qnil;
4222 } 4219 }
4223 4220
4224 DEFUN ("scroll-left", Fscroll_left, 0, 1, "_P", /* 4221 DEFUN ("scroll-left", Fscroll_left, 0, 1, "_P", /*
4225 Scroll selected window display ARG columns left. 4222 Scroll selected window display N columns left.
4226 Default for ARG is window width minus 2. 4223 Default for N is window width minus 2.
4227 */ 4224 */
4228 (arg)) 4225 (n))
4229 { 4226 {
4230 Lisp_Object window = Fselected_window (Qnil); 4227 Lisp_Object window = Fselected_window (Qnil);
4231 struct window *w = XWINDOW (window); 4228 struct window *w = XWINDOW (window);
4232 4229 int count = (NILP (n) ?
4233 if (NILP (arg)) 4230 window_char_width (w, 0) - 2 :
4234 arg = make_int (window_char_width (w, 0) - 2); 4231 XINT (Fprefix_numeric_value (n)));
4235 else 4232
4236 arg = Fprefix_numeric_value (arg); 4233 return Fset_window_hscroll (window, make_int (w->hscroll + count));
4237
4238 return Fset_window_hscroll (window, make_int (w->hscroll + XINT (arg)));
4239 } 4234 }
4240 4235
4241 DEFUN ("scroll-right", Fscroll_right, 0, 1, "_P", /* 4236 DEFUN ("scroll-right", Fscroll_right, 0, 1, "_P", /*
4242 Scroll selected window display ARG columns right. 4237 Scroll selected window display N columns right.
4243 Default for ARG is window width minus 2. 4238 Default for N is window width minus 2.
4244 */ 4239 */
4245 (arg)) 4240 (n))
4246 { 4241 {
4247 Lisp_Object window = Fselected_window (Qnil); 4242 Lisp_Object window = Fselected_window (Qnil);
4248 struct window *w = XWINDOW (window); 4243 struct window *w = XWINDOW (window);
4249 4244 int count = (NILP (n) ?
4250 if (NILP (arg)) 4245 window_char_width (w, 0) - 2 :
4251 arg = make_int (window_char_width (w, 0) - 2); 4246 XINT (Fprefix_numeric_value (n)));
4252 else 4247
4253 arg = Fprefix_numeric_value (arg); 4248 return Fset_window_hscroll (window, make_int (w->hscroll - count));
4254
4255 return Fset_window_hscroll (window, make_int (w->hscroll - XINT (arg)));
4256 } 4249 }
4257 4250
4258 DEFUN ("center-to-window-line", Fcenter_to_window_line, 0, 2, "_P", /* 4251 DEFUN ("center-to-window-line", Fcenter_to_window_line, 0, 2, "_P", /*
4259 Center point in WINDOW. With N, put point on line N. 4252 Center point in WINDOW. With N, put point on line N.
4260 The desired position of point is always relative to the window. 4253 The desired position of point is always relative to the window.
4429 /* Map MAPFUN over the windows in F. CLOSURE is passed to each 4422 /* Map MAPFUN over the windows in F. CLOSURE is passed to each
4430 invocation of MAPFUN. If any invocation of MAPFUN returns 4423 invocation of MAPFUN. If any invocation of MAPFUN returns
4431 non-zero, the mapping is halted. Otherwise, map_windows() maps 4424 non-zero, the mapping is halted. Otherwise, map_windows() maps
4432 over all windows in F. 4425 over all windows in F.
4433 4426
4434 If MAPFUN creates or deletes windows, the behaviour is undefined. */ 4427 If MAPFUN creates or deletes windows, the behavior is undefined. */
4435 4428
4436 int 4429 int
4437 map_windows (struct frame *f, int (*mapfun) (struct window *w, void *closure), 4430 map_windows (struct frame *f, int (*mapfun) (struct window *w, void *closure),
4438 void *closure) 4431 void *closure)
4439 { 4432 {
4445 4438
4446 FRAME_LOOP_NO_BREAK(frmcons, devcons, concons) 4439 FRAME_LOOP_NO_BREAK(frmcons, devcons, concons)
4447 { 4440 {
4448 int v = map_windows_1 (FRAME_ROOT_WINDOW (XFRAME (XCAR (frmcons))), 4441 int v = map_windows_1 (FRAME_ROOT_WINDOW (XFRAME (XCAR (frmcons))),
4449 mapfun, closure); 4442 mapfun, closure);
4450 if (v) 4443 if (v)
4451 return v; 4444 return v;
4452 } 4445 }
4453 } 4446 }
4454 4447
4455 return 0; 4448 return 0;
4463 w->shadow_thickness_changed = 1; 4456 w->shadow_thickness_changed = 1;
4464 MARK_WINDOWS_CHANGED (w); 4457 MARK_WINDOWS_CHANGED (w);
4465 } 4458 }
4466 4459
4467 static void 4460 static void
4468 vertical_divider_changed_in_window (Lisp_Object specifier, 4461 vertical_divider_changed_in_window (Lisp_Object specifier,
4469 struct window *w, 4462 struct window *w,
4470 Lisp_Object oldval) 4463 Lisp_Object oldval)
4471 { 4464 {
4472 MARK_WINDOWS_CHANGED (w); 4465 MARK_WINDOWS_CHANGED (w);
4473 MARK_FRAME_WINDOWS_STRUCTURE_CHANGED (XFRAME (WINDOW_FRAME (w))); 4466 MARK_FRAME_WINDOWS_STRUCTURE_CHANGED (XFRAME (WINDOW_FRAME (w)));
4474 } 4467 }
4648 static Lisp_Object 4641 static Lisp_Object
4649 mark_window_config (Lisp_Object obj, void (*markobj) (Lisp_Object)) 4642 mark_window_config (Lisp_Object obj, void (*markobj) (Lisp_Object))
4650 { 4643 {
4651 struct window_config *config = XWINDOW_CONFIGURATION (obj); 4644 struct window_config *config = XWINDOW_CONFIGURATION (obj);
4652 int i; 4645 int i;
4653 ((markobj) (config->current_window)); 4646 markobj (config->current_window);
4654 ((markobj) (config->current_buffer)); 4647 markobj (config->current_buffer);
4655 ((markobj) (config->minibuffer_scroll_window)); 4648 markobj (config->minibuffer_scroll_window);
4656 ((markobj) (config->root_window)); 4649 markobj (config->root_window);
4657 4650
4658 for (i = 0; i < config->saved_windows_count; i++) 4651 for (i = 0; i < config->saved_windows_count; i++)
4659 { 4652 {
4660 struct saved_window *s = SAVED_WINDOW_N (config, i); 4653 struct saved_window *s = SAVED_WINDOW_N (config, i);
4661 ((markobj) (s->window)); 4654 markobj (s->window);
4662 ((markobj) (s->buffer)); 4655 markobj (s->buffer);
4663 ((markobj) (s->start)); 4656 markobj (s->start);
4664 ((markobj) (s->pointm)); 4657 markobj (s->pointm);
4665 ((markobj) (s->sb_point)); 4658 markobj (s->sb_point);
4666 ((markobj) (s->mark)); 4659 markobj (s->mark);
4667 #if 0 4660 #if 0
4668 /* #### This looked like this. I do not see why specifier cached 4661 /* #### This looked like this. I do not see why specifier cached
4669 values should not be marked, as such specifiers as toolbars 4662 values should not be marked, as such specifiers as toolbars
4670 might have GC-able instances. Freed configs are not marked, 4663 might have GC-able instances. Freed configs are not marked,
4671 aren't they? -- kkm */ 4664 aren't they? -- kkm */
4672 ((markobj) (s->dedicated)); 4665 markobj (s->dedicated);
4673 #else 4666 #else
4674 #define WINDOW_SLOT(slot, compare) ((markobj) (s->slot)) 4667 #define WINDOW_SLOT(slot, compare) ((void) (markobj (s->slot)))
4675 #include "winslots.h" 4668 #include "winslots.h"
4676 #endif 4669 #endif
4677 } 4670 }
4678 return Qnil; 4671 return Qnil;
4679 } 4672 }
5603 set_specifier_caching (Vmodeline_shadow_thickness, 5596 set_specifier_caching (Vmodeline_shadow_thickness,
5604 slot_offset (struct window, 5597 slot_offset (struct window,
5605 modeline_shadow_thickness), 5598 modeline_shadow_thickness),
5606 modeline_shadow_thickness_changed, 5599 modeline_shadow_thickness_changed,
5607 0, 0); 5600 0, 0);
5608 5601
5609 DEFVAR_SPECIFIER ("has-modeline-p", &Vhas_modeline_p /* 5602 DEFVAR_SPECIFIER ("has-modeline-p", &Vhas_modeline_p /*
5610 *Whether the modeline should be displayed. 5603 *Whether the modeline should be displayed.
5611 This is a specifier; use `set-specifier' to change it. 5604 This is a specifier; use `set-specifier' to change it.
5612 */ ); 5605 */ );
5613 Vhas_modeline_p = Fmake_specifier (Qboolean); 5606 Vhas_modeline_p = Fmake_specifier (Qboolean);
5641 vertical_divider_always_visible_p), 5634 vertical_divider_always_visible_p),
5642 vertical_divider_changed_in_window, 5635 vertical_divider_changed_in_window,
5643 0, 0); 5636 0, 0);
5644 5637
5645 DEFVAR_SPECIFIER ("vertical-divider-shadow-thickness", &Vvertical_divider_shadow_thickness /* 5638 DEFVAR_SPECIFIER ("vertical-divider-shadow-thickness", &Vvertical_divider_shadow_thickness /*
5646 *How thick to draw 3D shadows around vertical dividers. 5639 *How thick to draw 3D shadows around vertical dividers.
5647 This is a specifier; use `set-specifier' to change it. 5640 This is a specifier; use `set-specifier' to change it.
5648 */ ); 5641 */ );
5649 Vvertical_divider_shadow_thickness = Fmake_specifier (Qinteger); 5642 Vvertical_divider_shadow_thickness = Fmake_specifier (Qinteger);
5650 set_specifier_fallback (Vvertical_divider_shadow_thickness, 5643 set_specifier_fallback (Vvertical_divider_shadow_thickness,
5651 list1 (Fcons (Qnil, Qzero))); 5644 list1 (Fcons (Qnil, Qzero)));