aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1995-07-21 07:49:19 +0000
committerRichard M. Stallman1995-07-21 07:49:19 +0000
commit73af359db68d77db724ed9f97cf5e759873a773d (patch)
treeff0167b33cf02f6a08c10c9f0d7010219036143b /src
parent93127526ed7cf1d78de49bff005908c4ecc64460 (diff)
downloademacs-73af359db68d77db724ed9f97cf5e759873a773d.tar.gz
emacs-73af359db68d77db724ed9f97cf5e759873a773d.zip
(echo_area_display): Use selected frame's minibuf window
but don't set the minibuf_window (don't call choose_minibuffer_frame). (message2_nolog, message): Likewise. (echo_area_window): New variable. (echo_area_display): Set echo_area_window. (redisplay_window): Distinguish minibuf_window and echo_area_window. (redisplay): Skip shortcuts if buffer's clip_changed is set. (redisplay_window): If buffer's clip_changed is set, update mode line.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c98
1 files changed, 55 insertions, 43 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index b2b338a7831..0c714f50775 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -187,6 +187,11 @@ char *echo_area_glyphs;
187/* This is the length of the message in echo_area_glyphs. */ 187/* This is the length of the message in echo_area_glyphs. */
188int echo_area_glyphs_length; 188int echo_area_glyphs_length;
189 189
190/* This is the window where the echo area message was displayed.
191 It is always a minibuffer window, but it may not be the
192 same window currently active as a minibuffer. */
193Lisp_Object echo_area_window;
194
190/* true iff we should redraw the mode lines on the next redisplay */ 195/* true iff we should redraw the mode lines on the next redisplay */
191int update_mode_lines; 196int update_mode_lines;
192 197
@@ -392,15 +397,19 @@ message2_nolog (m, len)
392 cmd_error, so this must be just an informative message; toss it. */ 397 cmd_error, so this must be just an informative message; toss it. */
393 else if (INTERACTIVE && FRAME_MESSAGE_BUF (selected_frame)) 398 else if (INTERACTIVE && FRAME_MESSAGE_BUF (selected_frame))
394 { 399 {
395#ifdef MULTI_FRAME 400 Lisp_Object mini_window;
396 Lisp_Object minibuf_frame; 401 FRAME_PTR f;
397 402
398 choose_minibuf_frame (); 403 /* Get the frame containing the minibuffer
399 minibuf_frame = WINDOW_FRAME (XWINDOW (minibuf_window)); 404 that the selected frame is using. */
400 FRAME_SAMPLE_VISIBILITY (XFRAME (minibuf_frame)); 405 mini_window = FRAME_MINIBUF_WINDOW (selected_frame);
406 f = XFRAME (WINDOW_FRAME (XWINDOW (mini_window)));
407
408#ifdef MULTI_FRAME
409 FRAME_SAMPLE_VISIBILITY (f);
401 if (FRAME_VISIBLE_P (selected_frame) 410 if (FRAME_VISIBLE_P (selected_frame)
402 && ! FRAME_VISIBLE_P (XFRAME (minibuf_frame))) 411 && ! FRAME_VISIBLE_P (f))
403 Fmake_frame_visible (WINDOW_FRAME (XWINDOW (minibuf_window))); 412 Fmake_frame_visible (WINDOW_FRAME (XWINDOW (mini_window)));
404#endif 413#endif
405 414
406 if (m) 415 if (m)
@@ -413,10 +422,10 @@ message2_nolog (m, len)
413 422
414 do_pending_window_change (); 423 do_pending_window_change ();
415 echo_area_display (); 424 echo_area_display ();
416 update_frame (XFRAME (XWINDOW (minibuf_window)->frame), 1, 1); 425 update_frame (f, 1, 1);
417 do_pending_window_change (); 426 do_pending_window_change ();
418 if (frame_up_to_date_hook != 0 && ! gc_in_progress) 427 if (frame_up_to_date_hook != 0 && ! gc_in_progress)
419 (*frame_up_to_date_hook) (XFRAME (XWINDOW (minibuf_window)->frame)); 428 (*frame_up_to_date_hook) (f);
420 } 429 }
421} 430}
422 431
@@ -478,18 +487,18 @@ message (m, a1, a2, a3)
478 /* The frame whose minibuffer we're going to display the message on. 487 /* The frame whose minibuffer we're going to display the message on.
479 It may be larger than the selected frame, so we need 488 It may be larger than the selected frame, so we need
480 to use its buffer, not the selected frame's buffer. */ 489 to use its buffer, not the selected frame's buffer. */
481 FRAME_PTR echo_frame; 490 Lisp_Object mini_window;
482#ifdef MULTI_FRAME 491 FRAME_PTR f;
483 choose_minibuf_frame (); 492
484 echo_frame = XFRAME (WINDOW_FRAME (XWINDOW (minibuf_window))); 493 /* Get the frame containing the minibuffer
485#else 494 that the selected frame is using. */
486 echo_frame = selected_frame; 495 mini_window = FRAME_MINIBUF_WINDOW (selected_frame);
487#endif 496 f = XFRAME (WINDOW_FRAME (XWINDOW (mini_window)));
488 497
489 /* A null message buffer means that the frame hasn't really been 498 /* A null message buffer means that the frame hasn't really been
490 initialized yet. Error messages get reported properly by 499 initialized yet. Error messages get reported properly by
491 cmd_error, so this must be just an informative message; toss it. */ 500 cmd_error, so this must be just an informative message; toss it. */
492 if (FRAME_MESSAGE_BUF (echo_frame)) 501 if (FRAME_MESSAGE_BUF (f))
493 { 502 {
494 if (m) 503 if (m)
495 { 504 {
@@ -500,14 +509,14 @@ message (m, a1, a2, a3)
500 a[1] = a2; 509 a[1] = a2;
501 a[2] = a3; 510 a[2] = a3;
502 511
503 len = doprnt (FRAME_MESSAGE_BUF (echo_frame), 512 len = doprnt (FRAME_MESSAGE_BUF (f),
504 FRAME_WIDTH (echo_frame), m, (char *)0, 3, a); 513 FRAME_WIDTH (f), m, (char *)0, 3, a);
505#else 514#else
506 len = doprnt (FRAME_MESSAGE_BUF (echo_frame), 515 len = doprnt (FRAME_MESSAGE_BUF (f),
507 FRAME_WIDTH (echo_frame), m, (char *)0, 3, &a1); 516 FRAME_WIDTH (f), m, (char *)0, 3, &a1);
508#endif /* NO_ARG_ARRAY */ 517#endif /* NO_ARG_ARRAY */
509 518
510 message2 (FRAME_MESSAGE_BUF (echo_frame), len); 519 message2 (FRAME_MESSAGE_BUF (f), len);
511 } 520 }
512 else 521 else
513 message1 (0); 522 message1 (0);
@@ -543,12 +552,13 @@ echo_area_display ()
543{ 552{
544 register int vpos; 553 register int vpos;
545 FRAME_PTR f; 554 FRAME_PTR f;
555 Lisp_Object mini_window;
546 556
547#ifdef MULTI_FRAME 557 /* Choose the minibuffer window for this display.
548 choose_minibuf_frame (); 558 It is the minibuffer window used by the selected frame. */
549#endif 559 mini_window = FRAME_MINIBUF_WINDOW (selected_frame);
550 560 /* This is the frame that window is in. */
551 f = XFRAME (WINDOW_FRAME (XWINDOW (minibuf_window))); 561 f = XFRAME (WINDOW_FRAME (XWINDOW (mini_window)));
552 562
553 if (! FRAME_VISIBLE_P (f)) 563 if (! FRAME_VISIBLE_P (f))
554 return; 564 return;
@@ -561,9 +571,11 @@ echo_area_display ()
561 571
562 if (echo_area_glyphs || minibuf_level == 0) 572 if (echo_area_glyphs || minibuf_level == 0)
563 { 573 {
564 vpos = XFASTINT (XWINDOW (minibuf_window)->top); 574 echo_area_window = mini_window;
575
576 vpos = XFASTINT (XWINDOW (mini_window)->top);
565 get_display_line (f, vpos, 0); 577 get_display_line (f, vpos, 0);
566 display_string (XWINDOW (minibuf_window), vpos, 578 display_string (XWINDOW (mini_window), vpos,
567 echo_area_glyphs ? echo_area_glyphs : "", 579 echo_area_glyphs ? echo_area_glyphs : "",
568 echo_area_glyphs ? echo_area_glyphs_length : -1, 580 echo_area_glyphs ? echo_area_glyphs_length : -1,
569 0, 0, 0, 0, FRAME_WIDTH (f)); 581 0, 0, 0, 0, FRAME_WIDTH (f));
@@ -581,18 +593,18 @@ echo_area_display ()
581 int i; 593 int i;
582 594
583 for (i = vpos + 1; 595 for (i = vpos + 1;
584 i < vpos + XFASTINT (XWINDOW (minibuf_window)->height); i++) 596 i < vpos + XFASTINT (XWINDOW (mini_window)->height); i++)
585 { 597 {
586 get_display_line (f, i, 0); 598 get_display_line (f, i, 0);
587 display_string (XWINDOW (minibuf_window), vpos, 599 display_string (XWINDOW (mini_window), vpos,
588 "", 0, 0, 0, 0, 0, FRAME_WIDTH (f)); 600 "", 0, 0, 0, 0, 0, FRAME_WIDTH (f));
589 } 601 }
590 } 602 }
591 } 603 }
592 else if (!EQ (minibuf_window, selected_window)) 604 else if (!EQ (mini_window, selected_window))
593 windows_or_buffers_changed++; 605 windows_or_buffers_changed++;
594 606
595 if (EQ (minibuf_window, selected_window)) 607 if (EQ (mini_window, selected_window))
596 this_line_bufpos = 0; 608 this_line_bufpos = 0;
597 609
598 previous_echo_glyphs = echo_area_glyphs; 610 previous_echo_glyphs = echo_area_glyphs;
@@ -861,6 +873,7 @@ redisplay ()
861 tlbufpos = this_line_bufpos; 873 tlbufpos = this_line_bufpos;
862 tlendpos = this_line_endpos; 874 tlendpos = this_line_endpos;
863 if (!all_windows && tlbufpos > 0 && NILP (w->update_mode_line) 875 if (!all_windows && tlbufpos > 0 && NILP (w->update_mode_line)
876 && !current_buffer->clip_changed
864 && FRAME_VISIBLE_P (XFRAME (w->frame)) 877 && FRAME_VISIBLE_P (XFRAME (w->frame))
865 /* Make sure recorded data applies to current buffer, etc */ 878 /* Make sure recorded data applies to current buffer, etc */
866 && this_line_buffer == current_buffer 879 && this_line_buffer == current_buffer
@@ -1355,20 +1368,19 @@ redisplay_window (window, just_this_one)
1355 1368
1356 height = window_internal_height (w); 1369 height = window_internal_height (w);
1357 update_mode_line = (!NILP (w->update_mode_line) || update_mode_lines); 1370 update_mode_line = (!NILP (w->update_mode_line) || update_mode_lines);
1371 if (XBUFFER (w->buffer)->clip_changed)
1372 update_mode_line = 1;
1358 1373
1359 if (MINI_WINDOW_P (w)) 1374 if (MINI_WINDOW_P (w))
1360 { 1375 {
1361 if (w == XWINDOW (minibuf_window)) 1376 if (w == XWINDOW (echo_area_window) && echo_area_glyphs)
1362 { 1377 /* We've already displayed the echo area glyphs in this window. */
1363 if (echo_area_glyphs) 1378 goto finish_scroll_bars;
1364 /* We've already displayed the echo area glyphs, if any. */ 1379 else if (w != XWINDOW (minibuf_window))
1365 goto finish_scroll_bars;
1366 }
1367 else
1368 { 1380 {
1369 /* This is a minibuffer, but it's not the currently active one, so 1381 /* This is a minibuffer, but it's not the currently active one,
1370 clear it. */ 1382 so clear it. */
1371 int vpos = XFASTINT (XWINDOW (FRAME_MINIBUF_WINDOW (f))->top); 1383 int vpos = XFASTINT (w->top);
1372 int i; 1384 int i;
1373 1385
1374 for (i = 0; i < height; i++) 1386 for (i = 0; i < height; i++)