comparison src/window.c @ 274:ca9a9ec9c1c1 r21-0b35

Import from CVS: tag r21-0b35
author cvs
date Mon, 13 Aug 2007 10:29:42 +0200
parents c5d627a313b1
children 6330739388db
comparison
equal deleted inserted replaced
273:411aac7253ef 274:ca9a9ec9c1c1
82 the selected window. */ 82 the selected window. */
83 Lisp_Object minibuf_window; 83 Lisp_Object minibuf_window;
84 84
85 /* Non-nil means it is the window for C-M-v to scroll 85 /* Non-nil means it is the window for C-M-v to scroll
86 when the minibuffer is selected. */ 86 when the minibuffer is selected. */
87 Lisp_Object Vminibuf_scroll_window; 87 Lisp_Object Vminibuffer_scroll_window;
88 88
89 /* Non-nil means this is the buffer whose window C-M-v should scroll. */ 89 /* Non-nil means this is the buffer whose window C-M-v should scroll. */
90 Lisp_Object Vother_window_scroll_buffer; 90 Lisp_Object Vother_window_scroll_buffer;
91 91
92 /* Non-nil means it's the function to call to display temp buffers. */ 92 /* Non-nil means it's the function to call to display temp buffers. */
3175 window = display_buffer (buf, Qnil, same_frame); 3175 window = display_buffer (buf, Qnil, same_frame);
3176 3176
3177 if (!EQ (XWINDOW (window)->frame, Fselected_frame (Qnil))) 3177 if (!EQ (XWINDOW (window)->frame, Fselected_frame (Qnil)))
3178 Fmake_frame_visible (WINDOW_FRAME (XWINDOW (window))); 3178 Fmake_frame_visible (WINDOW_FRAME (XWINDOW (window)));
3179 3179
3180 Vminibuf_scroll_window = window; 3180 Vminibuffer_scroll_window = window;
3181 w = XWINDOW (window); 3181 w = XWINDOW (window);
3182 w->hscroll = 0; 3182 w->hscroll = 0;
3183 w->modeline_hscroll = 0; 3183 w->modeline_hscroll = 0;
3184 set_marker_restricted (w->start[CURRENT_DISP], make_int (1), buf); 3184 set_marker_restricted (w->start[CURRENT_DISP], make_int (1), buf);
3185 set_marker_restricted (w->pointm[CURRENT_DISP], make_int (1), buf); 3185 set_marker_restricted (w->pointm[CURRENT_DISP], make_int (1), buf);
4082 { 4082 {
4083 Lisp_Object window; 4083 Lisp_Object window;
4084 Lisp_Object selected_window = Fselected_window (Qnil); 4084 Lisp_Object selected_window = Fselected_window (Qnil);
4085 4085
4086 if (MINI_WINDOW_P (XWINDOW (selected_window)) 4086 if (MINI_WINDOW_P (XWINDOW (selected_window))
4087 && !NILP (Vminibuf_scroll_window)) 4087 && !NILP (Vminibuffer_scroll_window))
4088 window = Vminibuf_scroll_window; 4088 window = Vminibuffer_scroll_window;
4089 /* If buffer is specified, scroll that buffer. */ 4089 /* If buffer is specified, scroll that buffer. */
4090 else if (!NILP (Vother_window_scroll_buffer)) 4090 else if (!NILP (Vother_window_scroll_buffer))
4091 { 4091 {
4092 window = Fget_buffer_window (Vother_window_scroll_buffer, Qnil, Qnil); 4092 window = Fget_buffer_window (Vother_window_scroll_buffer, Qnil, Qnil);
4093 if (NILP (window)) 4093 if (NILP (window))
4120 Scroll next window upward ARG lines; or near full frame if no ARG. 4120 Scroll next window upward ARG lines; or near full frame if no ARG.
4121 The next window is the one below the current one; or the one at the top 4121 The next window is the one below the current one; or the one at the top
4122 if the current one is at the bottom. Negative ARG means scroll downward. 4122 if the current one is at the bottom. Negative ARG means scroll downward.
4123 When calling from a program, supply a number as argument or nil. 4123 When calling from a program, supply a number as argument or nil.
4124 4124
4125 If in the minibuffer, `minibuf-scroll-window' if non-nil 4125 If in the minibuffer, `minibuffer-scroll-window' if non-nil
4126 specifies the window to scroll. 4126 specifies the window to scroll.
4127 If `other-window-scroll-buffer' is non-nil, scroll the window 4127 If `other-window-scroll-buffer' is non-nil, scroll the window
4128 showing that buffer, popping the buffer up if necessary. 4128 showing that buffer, popping the buffer up if necessary.
4129 */ 4129 */
4130 (n)) 4130 (n))
4570 #if 0 /* FSFmacs */ 4570 #if 0 /* FSFmacs */
4571 Lisp_Object selected_frame; 4571 Lisp_Object selected_frame;
4572 #endif 4572 #endif
4573 Lisp_Object current_window; 4573 Lisp_Object current_window;
4574 Lisp_Object current_buffer; 4574 Lisp_Object current_buffer;
4575 Lisp_Object minibuf_scroll_window; 4575 Lisp_Object minibuffer_scroll_window;
4576 Lisp_Object root_window; 4576 Lisp_Object root_window;
4577 /* Record the values of window-min-width and window-min-height 4577 /* Record the values of window-min-width and window-min-height
4578 so that window sizes remain consistent with them. */ 4578 so that window sizes remain consistent with them. */
4579 int min_width, min_height; 4579 int min_width, min_height;
4580 int saved_windows_count; 4580 int saved_windows_count;
4594 { 4594 {
4595 struct window_config *config = XWINDOW_CONFIGURATION (obj); 4595 struct window_config *config = XWINDOW_CONFIGURATION (obj);
4596 int i; 4596 int i;
4597 ((markobj) (config->current_window)); 4597 ((markobj) (config->current_window));
4598 ((markobj) (config->current_buffer)); 4598 ((markobj) (config->current_buffer));
4599 ((markobj) (config->minibuf_scroll_window)); 4599 ((markobj) (config->minibuffer_scroll_window));
4600 ((markobj) (config->root_window)); 4600 ((markobj) (config->root_window));
4601 4601
4602 for (i = 0; i < config->saved_windows_count; i++) 4602 for (i = 0; i < config->saved_windows_count; i++)
4603 { 4603 {
4604 struct saved_window *s = SAVED_WINDOW_N (config, i); 4604 struct saved_window *s = SAVED_WINDOW_N (config, i);
4729 4729
4730 fig1 = XWINDOW_CONFIGURATION (conf1); 4730 fig1 = XWINDOW_CONFIGURATION (conf1);
4731 fig2 = XWINDOW_CONFIGURATION (conf2); 4731 fig2 = XWINDOW_CONFIGURATION (conf2);
4732 4732
4733 if (!((fig1->saved_windows_count == fig2->saved_windows_count) && 4733 if (!((fig1->saved_windows_count == fig2->saved_windows_count) &&
4734 EQ (fig1->current_window, fig2->current_window) && 4734 EQ (fig1->current_window, fig2->current_window) &&
4735 EQ (fig1->current_buffer, fig2->current_buffer) && 4735 EQ (fig1->current_buffer, fig2->current_buffer) &&
4736 EQ (fig1->root_window, fig2->root_window) && 4736 EQ (fig1->root_window, fig2->root_window) &&
4737 EQ (fig1->minibuf_scroll_window, fig2->minibuf_scroll_window) && 4737 EQ (fig1->minibuffer_scroll_window, fig2->minibuffer_scroll_window) &&
4738 fig1->frame_width == fig2->frame_width && 4738 fig1->frame_width == fig2->frame_width &&
4739 fig1->frame_height == fig2->frame_height)) 4739 fig1->frame_height == fig2->frame_height))
4740 return 0; 4740 return 0;
4741 4741
4742 for (i = 0; i < fig1->saved_windows_count; i++) 4742 for (i = 0; i < fig1->saved_windows_count; i++)
5153 selected window. */ 5153 selected window. */
5154 if (FRAME_LIVE_P (XFRAME (config->selected_frame))) 5154 if (FRAME_LIVE_P (XFRAME (config->selected_frame)))
5155 do_switch_frame (config->selected_frame, Qnil, 0); 5155 do_switch_frame (config->selected_frame, Qnil, 0);
5156 #endif 5156 #endif
5157 5157
5158 Vminibuf_scroll_window = config->minibuf_scroll_window; 5158 Vminibuffer_scroll_window = config->minibuffer_scroll_window;
5159 5159
5160 if (FRAME_LIVE_P (f)) 5160 if (FRAME_LIVE_P (f))
5161 { 5161 {
5162 /* Do this before calling recompute_all_cached_specifiers_in_window() 5162 /* Do this before calling recompute_all_cached_specifiers_in_window()
5163 so that things like redisplay_redraw_cursor() won't abort due 5163 so that things like redisplay_redraw_cursor() won't abort due
5373 5373
5374 config->frame_width = FRAME_WIDTH (f); 5374 config->frame_width = FRAME_WIDTH (f);
5375 config->frame_height = FRAME_HEIGHT (f); 5375 config->frame_height = FRAME_HEIGHT (f);
5376 config->current_window = FRAME_SELECTED_WINDOW (f); 5376 config->current_window = FRAME_SELECTED_WINDOW (f);
5377 XSETBUFFER (config->current_buffer, current_buffer); 5377 XSETBUFFER (config->current_buffer, current_buffer);
5378 config->minibuf_scroll_window = Vminibuf_scroll_window; 5378 config->minibuffer_scroll_window = Vminibuffer_scroll_window;
5379 config->root_window = FRAME_ROOT_WINDOW (f); 5379 config->root_window = FRAME_ROOT_WINDOW (f);
5380 config->min_height = window_min_height; 5380 config->min_height = window_min_height;
5381 config->min_width = window_min_width; 5381 config->min_width = window_min_width;
5382 config->saved_windows_count = n_windows; 5382 config->saved_windows_count = n_windows;
5383 save_window_save (FRAME_ROOT_WINDOW (f), config, 0); 5383 save_window_save (FRAME_ROOT_WINDOW (f), config, 0);
5580 If this function is used, then it must do the entire job of showing 5580 If this function is used, then it must do the entire job of showing
5581 the buffer; `temp-buffer-show-hook' is not run unless this function runs it. 5581 the buffer; `temp-buffer-show-hook' is not run unless this function runs it.
5582 */ ); 5582 */ );
5583 Vtemp_buffer_show_function = Qnil; 5583 Vtemp_buffer_show_function = Qnil;
5584 5584
5585 DEFVAR_LISP ("minibuffer-scroll-window", &Vminibuf_scroll_window /* 5585 DEFVAR_LISP ("minibuffer-scroll-window", &Vminibuffer_scroll_window /*
5586 Non-nil means it is the window that \\<minibuffer-local-map>\\[scroll-other-window] in minibuffer should scroll. 5586 Non-nil means it is the window that \\<minibuffer-local-map>\\[scroll-other-window] in minibuffer should scroll.
5587 */ ); 5587 */ );
5588 Vminibuf_scroll_window = Qnil; 5588 Vminibuffer_scroll_window = Qnil;
5589 5589
5590 DEFVAR_LISP ("other-window-scroll-buffer", &Vother_window_scroll_buffer /* 5590 DEFVAR_LISP ("other-window-scroll-buffer", &Vother_window_scroll_buffer /*
5591 If non-nil, this is a buffer and \\[scroll-other-window] should scroll its window. 5591 If non-nil, this is a buffer and \\[scroll-other-window] should scroll its window.
5592 */ ); 5592 */ );
5593 Vother_window_scroll_buffer = Qnil; 5593 Vother_window_scroll_buffer = Qnil;