comparison src/xdisp.c @ 10667:bacef13bc2ca

(Vwindow_size_change_functions): New variable. (prepare_menu_bars): Call those functions. Add gcproing. (syms_of_xdisp): Set up Lisp variable.
author Richard M. Stallman <rms@gnu.org>
date Sun, 05 Feb 1995 08:52:52 +0000
parents 88afc23d1474
children 340ceb6ae024
comparison
equal deleted inserted replaced
10666:e1dfb47b664e 10667:bacef13bc2ca
104 /* Like mode-line-format, but for the titlebar on a visible frame. */ 104 /* Like mode-line-format, but for the titlebar on a visible frame. */
105 Lisp_Object Vframe_title_format; 105 Lisp_Object Vframe_title_format;
106 106
107 /* Like mode-line-format, but for the titlebar on an iconified frame. */ 107 /* Like mode-line-format, but for the titlebar on an iconified frame. */
108 Lisp_Object Vicon_title_format; 108 Lisp_Object Vicon_title_format;
109
110 /* List of functions to call when a window's size changes. These
111 functions get one arg, a frame on which one or more windows' sizes
112 have changed. */
113 static Lisp_Object Vwindow_size_change_functions;
109 114
110 /* Values of those variables at last redisplay. */ 115 /* Values of those variables at last redisplay. */
111 static Lisp_Object last_arrow_position, last_arrow_string; 116 static Lisp_Object last_arrow_position, last_arrow_string;
112 117
113 Lisp_Object Qmenu_bar_update_hook; 118 Lisp_Object Qmenu_bar_update_hook;
557 void 562 void
558 prepare_menu_bars () 563 prepare_menu_bars ()
559 { 564 {
560 register struct window *w = XWINDOW (selected_window); 565 register struct window *w = XWINDOW (selected_window);
561 int all_windows; 566 int all_windows;
567 struct gcpro gcpro1, gcpro2;
562 568
563 if (noninteractive) 569 if (noninteractive)
564 return; 570 return;
565 571
566 /* Set the visible flags for all frames. 572 /* Set the visible flags for all frames.
604 if (all_windows) 610 if (all_windows)
605 { 611 {
606 Lisp_Object tail, frame; 612 Lisp_Object tail, frame;
607 613
608 FOR_EACH_FRAME (tail, frame) 614 FOR_EACH_FRAME (tail, frame)
609 update_menu_bar (XFRAME (frame)); 615 {
616 /* If a window on this frame changed size,
617 report that to the user and clear the size-change flag. */
618 if (FRAME_WINDOW_SIZES_CHANGED (XFRAME (frame)))
619 {
620 Lisp_Object functions;
621 functions = Vwindow_size_change_functions;
622 GCPRO2 (tail, functions);
623 while (CONSP (functions))
624 {
625 call1 (XCONS (functions)->car, frame);
626 functions = XCONS (functions)->cdr;
627 }
628 UNGCPRO;
629 FRAME_WINDOW_SIZES_CHANGED (XFRAME (frame)) = 0;
630 }
631 GCPRO1 (tail);
632 update_menu_bar (XFRAME (frame));
633 UNGCPRO;
634 }
610 } 635 }
611 else 636 else
612 update_menu_bar (selected_frame); 637 update_menu_bar (selected_frame);
613 } 638 }
614 639
3767 DEFVAR_LISP ("message-log-max", &Vmessage_log_max, 3792 DEFVAR_LISP ("message-log-max", &Vmessage_log_max,
3768 "Maximum number of lines to keep in the message log buffer.\n\ 3793 "Maximum number of lines to keep in the message log buffer.\n\
3769 If nil, disable message logging. If t, log messages but don't truncate\n\ 3794 If nil, disable message logging. If t, log messages but don't truncate\n\
3770 the buffer when it becomes large."); 3795 the buffer when it becomes large.");
3771 XSETFASTINT (Vmessage_log_max, 50); 3796 XSETFASTINT (Vmessage_log_max, 50);
3797
3798 DEFVAR_LISP ("window-size-change-functions", &Vwindow_size_change_functions,
3799 "Functions called before redisplay, if window sizes have changed.\n\
3800 The value should be a list of functions that take one argument.\n\
3801 Just before redisplay, for each frame, if any of its windows have changed\n\
3802 size since the last redisplay, or have been split or deleted,\n\
3803 all the functions in the list are called, with the frame as argument.");
3804 Vwindow_size_change_functions = Qnil;
3772 } 3805 }
3773 3806
3774 /* initialize the window system */ 3807 /* initialize the window system */
3775 init_xdisp () 3808 init_xdisp ()
3776 { 3809 {