aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann1999-09-13 11:13:59 +0000
committerGerd Moellmann1999-09-13 11:13:59 +0000
commit886bd6f2115ee32aae4b0c797d39db18a09c9fc0 (patch)
tree5f97eb8f52c7af7fdbb327b048838f0321d40be6 /src
parent1ae1a37dc5c50b07d4ba68a48b693d844ff47f2c (diff)
downloademacs-886bd6f2115ee32aae4b0c797d39db18a09c9fc0.tar.gz
emacs-886bd6f2115ee32aae4b0c797d39db18a09c9fc0.zip
(QCfile): Move here from xfns.c.
(syms_of_xdisp): Initialize it. (message2_nolog): Change for Lisp_Object selected_frame. (message3_nolog, message_with_string, message, setup_echo_area_for_printing, truncate_echo_area, prepare_menu_bars, redisplay_internal, Fdump_tool_bar_row): Ditto.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c92
1 files changed, 52 insertions, 40 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index ab3547dc338..e5ae821e811 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -219,7 +219,7 @@ Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map;
219Lisp_Object Qwindow_scroll_functions, Vwindow_scroll_functions; 219Lisp_Object Qwindow_scroll_functions, Vwindow_scroll_functions;
220Lisp_Object Qredisplay_end_trigger_functions; 220Lisp_Object Qredisplay_end_trigger_functions;
221Lisp_Object Qinhibit_point_motion_hooks; 221Lisp_Object Qinhibit_point_motion_hooks;
222Lisp_Object QCeval, Qwhen; 222Lisp_Object QCeval, Qwhen, QCfile;
223Lisp_Object Qfontified; 223Lisp_Object Qfontified;
224 224
225/* Functions called to fontify regions of text. */ 225/* Functions called to fontify regions of text. */
@@ -4808,6 +4808,7 @@ message2_nolog (m, len, multibyte)
4808 char *m; 4808 char *m;
4809 int len; 4809 int len;
4810{ 4810{
4811 struct frame *sf = SELECTED_FRAME ();
4811 message_enable_multibyte = multibyte; 4812 message_enable_multibyte = multibyte;
4812 4813
4813 if (noninteractive) 4814 if (noninteractive)
@@ -4825,19 +4826,19 @@ message2_nolog (m, len, multibyte)
4825 initialized yet. Error messages get reported properly by 4826 initialized yet. Error messages get reported properly by
4826 cmd_error, so this must be just an informative message; toss it. */ 4827 cmd_error, so this must be just an informative message; toss it. */
4827 else if (INTERACTIVE 4828 else if (INTERACTIVE
4828 && selected_frame->glyphs_initialized_p 4829 && sf->glyphs_initialized_p
4829 && FRAME_MESSAGE_BUF (selected_frame)) 4830 && FRAME_MESSAGE_BUF (sf))
4830 { 4831 {
4831 Lisp_Object mini_window; 4832 Lisp_Object mini_window;
4832 struct frame *f; 4833 struct frame *f;
4833 4834
4834 /* Get the frame containing the mini-buffer 4835 /* Get the frame containing the mini-buffer
4835 that the selected frame is using. */ 4836 that the selected frame is using. */
4836 mini_window = FRAME_MINIBUF_WINDOW (selected_frame); 4837 mini_window = FRAME_MINIBUF_WINDOW (sf);
4837 f = XFRAME (WINDOW_FRAME (XWINDOW (mini_window))); 4838 f = XFRAME (WINDOW_FRAME (XWINDOW (mini_window)));
4838 4839
4839 FRAME_SAMPLE_VISIBILITY (f); 4840 FRAME_SAMPLE_VISIBILITY (f);
4840 if (FRAME_VISIBLE_P (selected_frame) 4841 if (FRAME_VISIBLE_P (sf)
4841 && ! FRAME_VISIBLE_P (f)) 4842 && ! FRAME_VISIBLE_P (f))
4842 Fmake_frame_visible (WINDOW_FRAME (XWINDOW (mini_window))); 4843 Fmake_frame_visible (WINDOW_FRAME (XWINDOW (mini_window)));
4843 4844
@@ -4891,6 +4892,7 @@ message3_nolog (m, nbytes, multibyte)
4891 Lisp_Object m; 4892 Lisp_Object m;
4892 int nbytes, multibyte; 4893 int nbytes, multibyte;
4893{ 4894{
4895 struct frame *sf = SELECTED_FRAME ();
4894 message_enable_multibyte = multibyte; 4896 message_enable_multibyte = multibyte;
4895 4897
4896 if (noninteractive) 4898 if (noninteractive)
@@ -4908,8 +4910,8 @@ message3_nolog (m, nbytes, multibyte)
4908 initialized yet. Error messages get reported properly by 4910 initialized yet. Error messages get reported properly by
4909 cmd_error, so this must be just an informative message; toss it. */ 4911 cmd_error, so this must be just an informative message; toss it. */
4910 else if (INTERACTIVE 4912 else if (INTERACTIVE
4911 && selected_frame->glyphs_initialized_p 4913 && sf->glyphs_initialized_p
4912 && FRAME_MESSAGE_BUF (selected_frame)) 4914 && FRAME_MESSAGE_BUF (sf))
4913 { 4915 {
4914 Lisp_Object mini_window; 4916 Lisp_Object mini_window;
4915 Lisp_Object frame; 4917 Lisp_Object frame;
@@ -4917,12 +4919,12 @@ message3_nolog (m, nbytes, multibyte)
4917 4919
4918 /* Get the frame containing the mini-buffer 4920 /* Get the frame containing the mini-buffer
4919 that the selected frame is using. */ 4921 that the selected frame is using. */
4920 mini_window = FRAME_MINIBUF_WINDOW (selected_frame); 4922 mini_window = FRAME_MINIBUF_WINDOW (sf);
4921 frame = XWINDOW (mini_window)->frame; 4923 frame = XWINDOW (mini_window)->frame;
4922 f = XFRAME (frame); 4924 f = XFRAME (frame);
4923 4925
4924 FRAME_SAMPLE_VISIBILITY (f); 4926 FRAME_SAMPLE_VISIBILITY (f);
4925 if (FRAME_VISIBLE_P (selected_frame) 4927 if (FRAME_VISIBLE_P (sf)
4926 && !FRAME_VISIBLE_P (f)) 4928 && !FRAME_VISIBLE_P (f))
4927 Fmake_frame_visible (frame); 4929 Fmake_frame_visible (frame);
4928 4930
@@ -4997,11 +4999,11 @@ message_with_string (m, string, log)
4997 It may be larger than the selected frame, so we need 4999 It may be larger than the selected frame, so we need
4998 to use its buffer, not the selected frame's buffer. */ 5000 to use its buffer, not the selected frame's buffer. */
4999 Lisp_Object mini_window; 5001 Lisp_Object mini_window;
5000 FRAME_PTR f; 5002 struct frame *f, *sf = SELECTED_FRAME ();
5001 5003
5002 /* Get the frame containing the minibuffer 5004 /* Get the frame containing the minibuffer
5003 that the selected frame is using. */ 5005 that the selected frame is using. */
5004 mini_window = FRAME_MINIBUF_WINDOW (selected_frame); 5006 mini_window = FRAME_MINIBUF_WINDOW (sf);
5005 f = XFRAME (WINDOW_FRAME (XWINDOW (mini_window))); 5007 f = XFRAME (WINDOW_FRAME (XWINDOW (mini_window)));
5006 5008
5007 /* A null message buffer means that the frame hasn't really been 5009 /* A null message buffer means that the frame hasn't really been
@@ -5059,11 +5061,11 @@ message (m, a1, a2, a3)
5059 on. It may be larger than the selected frame, so we need to 5061 on. It may be larger than the selected frame, so we need to
5060 use its buffer, not the selected frame's buffer. */ 5062 use its buffer, not the selected frame's buffer. */
5061 Lisp_Object mini_window; 5063 Lisp_Object mini_window;
5062 struct frame *f; 5064 struct frame *f, *sf = SELECTED_FRAME ();
5063 5065
5064 /* Get the frame containing the mini-buffer 5066 /* Get the frame containing the mini-buffer
5065 that the selected frame is using. */ 5067 that the selected frame is using. */
5066 mini_window = FRAME_MINIBUF_WINDOW (selected_frame); 5068 mini_window = FRAME_MINIBUF_WINDOW (sf);
5067 f = XFRAME (WINDOW_FRAME (XWINDOW (mini_window))); 5069 f = XFRAME (WINDOW_FRAME (XWINDOW (mini_window)));
5068 5070
5069 /* A null message buffer means that the frame hasn't really been 5071 /* A null message buffer means that the frame hasn't really been
@@ -5344,8 +5346,9 @@ setup_echo_area_for_printing (multibyte_p)
5344 /* Raise the frame containing the echo area. */ 5346 /* Raise the frame containing the echo area. */
5345 if (minibuffer_auto_raise) 5347 if (minibuffer_auto_raise)
5346 { 5348 {
5349 struct frame *sf = SELECTED_FRAME ();
5347 Lisp_Object mini_window; 5350 Lisp_Object mini_window;
5348 mini_window = FRAME_MINIBUF_WINDOW (selected_frame); 5351 mini_window = FRAME_MINIBUF_WINDOW (sf);
5349 Fraise_frame (WINDOW_FRAME (XWINDOW (mini_window))); 5352 Fraise_frame (WINDOW_FRAME (XWINDOW (mini_window)));
5350 } 5353 }
5351 5354
@@ -5619,9 +5622,12 @@ truncate_echo_area (nchars)
5619 cmd_error, so this must be just an informative message; toss it. */ 5622 cmd_error, so this must be just an informative message; toss it. */
5620 else if (!noninteractive 5623 else if (!noninteractive
5621 && INTERACTIVE 5624 && INTERACTIVE
5622 && FRAME_MESSAGE_BUF (selected_frame)
5623 && !NILP (echo_area_buffer[0])) 5625 && !NILP (echo_area_buffer[0]))
5624 with_echo_area_buffer (0, 0, (int (*) ()) truncate_message_1, nchars); 5626 {
5627 struct frame *sf = SELECTED_FRAME ();
5628 if (FRAME_MESSAGE_BUF (sf))
5629 with_echo_area_buffer (0, 0, (int (*) ()) truncate_message_1, nchars);
5630 }
5625} 5631}
5626 5632
5627 5633
@@ -5794,8 +5800,8 @@ clear_garbaged_frames ()
5794} 5800}
5795 5801
5796 5802
5797/* Redisplay the echo area of selected_frame. If UPDATE_FRAME_P is 5803/* Redisplay the echo area of the selected frame. If UPDATE_FRAME_P
5798 non-zero update selected_frame. Value is non-zero if the 5804 is non-zero update selected_frame. Value is non-zero if the
5799 mini-windows height has been changed. */ 5805 mini-windows height has been changed. */
5800 5806
5801static int 5807static int
@@ -5806,8 +5812,9 @@ echo_area_display (update_frame_p)
5806 struct window *w; 5812 struct window *w;
5807 struct frame *f; 5813 struct frame *f;
5808 int window_height_changed_p = 0; 5814 int window_height_changed_p = 0;
5815 struct frame *sf = SELECTED_FRAME ();
5809 5816
5810 mini_window = FRAME_MINIBUF_WINDOW (selected_frame); 5817 mini_window = FRAME_MINIBUF_WINDOW (sf);
5811 w = XWINDOW (mini_window); 5818 w = XWINDOW (mini_window);
5812 f = XFRAME (WINDOW_FRAME (w)); 5819 f = XFRAME (WINDOW_FRAME (w));
5813 5820
@@ -5819,7 +5826,7 @@ echo_area_display (update_frame_p)
5819 frame, even if we run under a window system. If we let this 5826 frame, even if we run under a window system. If we let this
5820 through, a message would be displayed on the terminal. */ 5827 through, a message would be displayed on the terminal. */
5821#ifdef HAVE_WINDOW_SYSTEM 5828#ifdef HAVE_WINDOW_SYSTEM
5822 if (!inhibit_window_system && !FRAME_WINDOW_P (selected_frame)) 5829 if (!inhibit_window_system && !FRAME_WINDOW_P (sf))
5823 return 0; 5830 return 0;
5824#endif /* HAVE_WINDOW_SYSTEM */ 5831#endif /* HAVE_WINDOW_SYSTEM */
5825 5832
@@ -6107,9 +6114,10 @@ prepare_menu_bars ()
6107 } 6114 }
6108 else 6115 else
6109 { 6116 {
6110 update_menu_bar (selected_frame, 1); 6117 struct frame *sf = SELECTED_FRAME ();
6118 update_menu_bar (sf, 1);
6111#ifdef HAVE_WINDOW_SYSTEM 6119#ifdef HAVE_WINDOW_SYSTEM
6112 update_tool_bar (selected_frame, 1); 6120 update_tool_bar (sf, 1);
6113#endif 6121#endif
6114 } 6122 }
6115 6123
@@ -6933,6 +6941,7 @@ redisplay_internal (preserve_echo_area)
6933 struct text_pos tlbufpos, tlendpos; 6941 struct text_pos tlbufpos, tlendpos;
6934 int number_of_visible_frames; 6942 int number_of_visible_frames;
6935 int count; 6943 int count;
6944 struct frame *sf = SELECTED_FRAME ();
6936 6945
6937 /* Non-zero means redisplay has to consider all windows on all 6946 /* Non-zero means redisplay has to consider all windows on all
6938 frames. Zero means, only selected_window is considered. */ 6947 frames. Zero means, only selected_window is considered. */
@@ -6986,17 +6995,17 @@ redisplay_internal (preserve_echo_area)
6986 fonts_changed_p = 0; 6995 fonts_changed_p = 0;
6987 } 6996 }
6988 6997
6989 if (! FRAME_WINDOW_P (selected_frame) 6998 if (! FRAME_WINDOW_P (sf)
6990 && previous_terminal_frame != selected_frame) 6999 && previous_terminal_frame != sf)
6991 { 7000 {
6992 /* Since frames on an ASCII terminal share the same display 7001 /* Since frames on an ASCII terminal share the same display
6993 area, displaying a different frame means redisplay the whole 7002 area, displaying a different frame means redisplay the whole
6994 thing. */ 7003 thing. */
6995 windows_or_buffers_changed++; 7004 windows_or_buffers_changed++;
6996 SET_FRAME_GARBAGED (selected_frame); 7005 SET_FRAME_GARBAGED (sf);
6997 XSETFRAME (Vterminal_frame, selected_frame); 7006 XSETFRAME (Vterminal_frame, sf);
6998 } 7007 }
6999 previous_terminal_frame = selected_frame; 7008 previous_terminal_frame = sf;
7000 7009
7001 /* Set the visible flags for all frames. Do this before checking 7010 /* Set the visible flags for all frames. Do this before checking
7002 for resized or garbaged frames; they want to know if their frames 7011 for resized or garbaged frames; they want to know if their frames
@@ -7350,7 +7359,7 @@ redisplay_internal (preserve_echo_area)
7350 FOR_EACH_FRAME (tail, frame) 7359 FOR_EACH_FRAME (tail, frame)
7351 { 7360 {
7352 struct frame *f = XFRAME (frame); 7361 struct frame *f = XFRAME (frame);
7353 if (FRAME_WINDOW_P (f) || f == selected_frame) 7362 if (FRAME_WINDOW_P (f) || f == sf)
7354 { 7363 {
7355 /* Mark all the scroll bars to be removed; we'll redeem 7364 /* Mark all the scroll bars to be removed; we'll redeem
7356 the ones we want when we redisplay their windows. */ 7365 the ones we want when we redisplay their windows. */
@@ -7367,8 +7376,8 @@ redisplay_internal (preserve_echo_area)
7367 } 7376 }
7368 } 7377 }
7369 } 7378 }
7370 else if (FRAME_VISIBLE_P (selected_frame) 7379 else if (FRAME_VISIBLE_P (sf)
7371 && !FRAME_OBSCURED_P (selected_frame)) 7380 && !FRAME_OBSCURED_P (sf))
7372 redisplay_window (selected_window, 1); 7381 redisplay_window (selected_window, 1);
7373 7382
7374 7383
@@ -7403,7 +7412,7 @@ update:
7403 f = XFRAME (XCAR (tail)); 7412 f = XFRAME (XCAR (tail));
7404 7413
7405 if ((FRAME_WINDOW_P (f) 7414 if ((FRAME_WINDOW_P (f)
7406 || f == selected_frame) 7415 || f == sf)
7407 && FRAME_VISIBLE_P (f) 7416 && FRAME_VISIBLE_P (f)
7408 && !FRAME_OBSCURED_P (f) 7417 && !FRAME_OBSCURED_P (f)
7409 && hscroll_windows (f->root_window)) 7418 && hscroll_windows (f->root_window))
@@ -7420,7 +7429,7 @@ update:
7420 7429
7421 f = XFRAME (XCAR (tail)); 7430 f = XFRAME (XCAR (tail));
7422 7431
7423 if ((FRAME_WINDOW_P (f) || f == selected_frame) 7432 if ((FRAME_WINDOW_P (f) || f == sf)
7424 && FRAME_VISIBLE_P (f) && !FRAME_OBSCURED_P (f)) 7433 && FRAME_VISIBLE_P (f) && !FRAME_OBSCURED_P (f))
7425 { 7434 {
7426 /* Mark all windows as to be updated. */ 7435 /* Mark all windows as to be updated. */
@@ -7437,14 +7446,14 @@ update:
7437 } 7446 }
7438 else 7447 else
7439 { 7448 {
7440 if (FRAME_VISIBLE_P (selected_frame) 7449 if (FRAME_VISIBLE_P (sf)
7441 && !FRAME_OBSCURED_P (selected_frame)) 7450 && !FRAME_OBSCURED_P (sf))
7442 { 7451 {
7443 if (hscroll_windows (selected_window)) 7452 if (hscroll_windows (selected_window))
7444 goto retry; 7453 goto retry;
7445 7454
7446 XWINDOW (selected_window)->must_be_updated_p = 1; 7455 XWINDOW (selected_window)->must_be_updated_p = 1;
7447 pause = update_frame (selected_frame, 0, 0); 7456 pause = update_frame (sf, 0, 0);
7448 } 7457 }
7449 else 7458 else
7450 pause = 0; 7459 pause = 0;
@@ -7458,10 +7467,10 @@ update:
7458 Lisp_Object mini_window; 7467 Lisp_Object mini_window;
7459 struct frame *mini_frame; 7468 struct frame *mini_frame;
7460 7469
7461 mini_window = FRAME_MINIBUF_WINDOW (selected_frame); 7470 mini_window = FRAME_MINIBUF_WINDOW (sf);
7462 mini_frame = XFRAME (WINDOW_FRAME (XWINDOW (mini_window))); 7471 mini_frame = XFRAME (WINDOW_FRAME (XWINDOW (mini_window)));
7463 7472
7464 if (mini_frame != selected_frame && FRAME_WINDOW_P (mini_frame)) 7473 if (mini_frame != sf && FRAME_WINDOW_P (mini_frame))
7465 { 7474 {
7466 XWINDOW (mini_window)->must_be_updated_p = 1; 7475 XWINDOW (mini_window)->must_be_updated_p = 1;
7467 pause |= update_frame (mini_frame, 0, 0); 7476 pause |= update_frame (mini_frame, 0, 0);
@@ -7506,7 +7515,7 @@ update:
7506 BUF_END_UNCHANGED (b) = BUF_Z (b) - BUF_GPT (b); 7515 BUF_END_UNCHANGED (b) = BUF_Z (b) - BUF_GPT (b);
7507 7516
7508 if (consider_all_windows_p) 7517 if (consider_all_windows_p)
7509 mark_window_display_accurate (FRAME_ROOT_WINDOW (selected_frame), 1); 7518 mark_window_display_accurate (FRAME_ROOT_WINDOW (sf), 1);
7510 else 7519 else
7511 { 7520 {
7512 XSETFASTINT (w->last_point, BUF_PT (b)); 7521 XSETFASTINT (w->last_point, BUF_PT (b));
@@ -7535,7 +7544,7 @@ update:
7535 last_arrow_position = COERCE_MARKER (Voverlay_arrow_position); 7544 last_arrow_position = COERCE_MARKER (Voverlay_arrow_position);
7536 last_arrow_string = Voverlay_arrow_string; 7545 last_arrow_string = Voverlay_arrow_string;
7537 if (frame_up_to_date_hook != 0) 7546 if (frame_up_to_date_hook != 0)
7538 (*frame_up_to_date_hook) (selected_frame); 7547 (*frame_up_to_date_hook) (sf);
7539 7548
7540 w->current_matrix->buffer = b; 7549 w->current_matrix->buffer = b;
7541 w->current_matrix->begv = BUF_BEGV (b); 7550 w->current_matrix->begv = BUF_BEGV (b);
@@ -10437,7 +10446,8 @@ DEFUN ("dump-tool-bar-row", Fdump_tool_bar_row, Sdump_tool_bar_row,
10437 0, 0, "", "") 10446 0, 0, "", "")
10438 () 10447 ()
10439{ 10448{
10440 struct glyph_matrix *m = (XWINDOW (selected_frame->tool_bar_window) 10449 struct frame *sf = SELECTED_FRAME ();
10450 struct glyph_matrix *m = (XWINDOW (sf->tool_bar_window)
10441 ->current_matrix); 10451 ->current_matrix);
10442 dump_glyph_row (m, 0, 1); 10452 dump_glyph_row (m, 0, 1);
10443 return Qnil; 10453 return Qnil;
@@ -12615,6 +12625,8 @@ syms_of_xdisp ()
12615 QCeval = intern (":eval"); 12625 QCeval = intern (":eval");
12616 staticpro (&QCeval); 12626 staticpro (&QCeval);
12617 Qwhen = intern ("when"); 12627 Qwhen = intern ("when");
12628 QCfile = intern (":file");
12629 staticpro (&QCfile);
12618 staticpro (&Qwhen); 12630 staticpro (&Qwhen);
12619 Qfontified = intern ("fontified"); 12631 Qfontified = intern ("fontified");
12620 staticpro (&Qfontified); 12632 staticpro (&Qfontified);