# HG changeset patch # User Richard M. Stallman # Date 757950623 0 # Node ID 58a9bb23c3eab2d510c5ae2ebcdd0870db1a647d # Parent c87d1cd3f62a7e690e6335d847f35e6675a48a7c (strout, printchar): Use proper frame for minibuffer. diff -r c87d1cd3f62a -r 58a9bb23c3ea src/print.c --- a/src/print.c Fri Jan 07 13:46:21 1994 +0000 +++ b/src/print.c Fri Jan 07 13:50:23 1994 +0000 @@ -169,7 +169,7 @@ #define PRINTCHAR(ch) printchar (ch, printcharfun) -/* Index of first unused element of FRAME_MESSAGE_BUF(selected_frame). */ +/* Index of first unused element of FRAME_MESSAGE_BUF(mini_frame). */ static int printbufidx; static void @@ -193,6 +193,9 @@ if (EQ (fun, Qt)) { + struct frame *mini_frame + = XFRAME (WINDOW_FRAME (XWINDOW (minibuf_window))); + if (noninteractive) { putchar (ch); @@ -200,18 +203,18 @@ return; } - if (echo_area_glyphs != FRAME_MESSAGE_BUF (selected_frame) + if (echo_area_glyphs != FRAME_MESSAGE_BUF (mini_frame) || !message_buf_print) { - echo_area_glyphs = FRAME_MESSAGE_BUF (selected_frame); + echo_area_glyphs = FRAME_MESSAGE_BUF (mini_frame); printbufidx = 0; echo_area_glyphs_length = 0; message_buf_print = 1; } - if (printbufidx < FRAME_WIDTH (selected_frame) - 1) - FRAME_MESSAGE_BUF (selected_frame)[printbufidx++] = ch; - FRAME_MESSAGE_BUF (selected_frame)[printbufidx] = 0; + if (printbufidx < FRAME_WIDTH (mini_frame) - 1) + FRAME_MESSAGE_BUF (mini_frame)[printbufidx++] = ch; + FRAME_MESSAGE_BUF (mini_frame)[printbufidx] = 0; echo_area_glyphs_length = printbufidx; return; @@ -241,6 +244,9 @@ } if (EQ (printcharfun, Qt)) { + struct frame *mini_frame + = XFRAME (WINDOW_FRAME (XWINDOW (minibuf_window))); + i = size >= 0 ? size : strlen (ptr); #ifdef MAX_PRINT_CHARS if (max_print) @@ -254,21 +260,21 @@ return; } - if (echo_area_glyphs != FRAME_MESSAGE_BUF (selected_frame) + if (echo_area_glyphs != FRAME_MESSAGE_BUF (mini_frame) || !message_buf_print) { - echo_area_glyphs = FRAME_MESSAGE_BUF (selected_frame); + echo_area_glyphs = FRAME_MESSAGE_BUF (mini_frame); printbufidx = 0; echo_area_glyphs_length = 0; message_buf_print = 1; } - if (i > FRAME_WIDTH (selected_frame) - printbufidx - 1) - i = FRAME_WIDTH (selected_frame) - printbufidx - 1; - bcopy (ptr, &FRAME_MESSAGE_BUF (selected_frame) [printbufidx], i); + if (i > FRAME_WIDTH (mini_frame) - printbufidx - 1) + i = FRAME_WIDTH (mini_frame) - printbufidx - 1; + bcopy (ptr, &FRAME_MESSAGE_BUF (mini_frame) [printbufidx], i); printbufidx += i; echo_area_glyphs_length = printbufidx; - FRAME_MESSAGE_BUF (selected_frame) [printbufidx] = 0; + FRAME_MESSAGE_BUF (mini_frame) [printbufidx] = 0; return; }