summaryrefslogtreecommitdiff
path: root/src/print.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-01-07 13:50:23 +0000
committerRichard M. Stallman <rms@gnu.org>1994-01-07 13:50:23 +0000
commitb8b1b8fd99cd0b6f5fbceb6de8238aefdc64969c (patch)
tree72b5a20176dbafcfe412a9c8fcb03bfe26cdbdf3 /src/print.c
parentdd0d2cf36b50880f604e0af83dbaaea0ad4cd54c (diff)
downloademacs-b8b1b8fd99cd0b6f5fbceb6de8238aefdc64969c.tar.gz
(strout, printchar): Use proper frame for minibuffer.
Diffstat (limited to 'src/print.c')
-rw-r--r--src/print.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/print.c b/src/print.c
index cb8418461de..1ea6d8573ef 100644
--- a/src/print.c
+++ b/src/print.c
@@ -169,7 +169,7 @@ glyph_to_str_cpy (glyphs, str)
#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 @@ printchar (ch, fun)
if (EQ (fun, Qt))
{
+ struct frame *mini_frame
+ = XFRAME (WINDOW_FRAME (XWINDOW (minibuf_window)));
+
if (noninteractive)
{
putchar (ch);
@@ -200,18 +203,18 @@ printchar (ch, fun)
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 @@ strout (ptr, size, printcharfun)
}
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 @@ strout (ptr, size, printcharfun)
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;
}