diff options
| author | Richard M. Stallman | 1994-01-07 13:50:23 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-01-07 13:50:23 +0000 |
| commit | b8b1b8fd99cd0b6f5fbceb6de8238aefdc64969c (patch) | |
| tree | 72b5a20176dbafcfe412a9c8fcb03bfe26cdbdf3 /src/print.c | |
| parent | dd0d2cf36b50880f604e0af83dbaaea0ad4cd54c (diff) | |
| download | emacs-b8b1b8fd99cd0b6f5fbceb6de8238aefdc64969c.tar.gz emacs-b8b1b8fd99cd0b6f5fbceb6de8238aefdc64969c.zip | |
(strout, printchar): Use proper frame for minibuffer.
Diffstat (limited to 'src/print.c')
| -rw-r--r-- | src/print.c | 30 |
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) | |||
| 169 | 169 | ||
| 170 | #define PRINTCHAR(ch) printchar (ch, printcharfun) | 170 | #define PRINTCHAR(ch) printchar (ch, printcharfun) |
| 171 | 171 | ||
| 172 | /* Index of first unused element of FRAME_MESSAGE_BUF(selected_frame). */ | 172 | /* Index of first unused element of FRAME_MESSAGE_BUF(mini_frame). */ |
| 173 | static int printbufidx; | 173 | static int printbufidx; |
| 174 | 174 | ||
| 175 | static void | 175 | static void |
| @@ -193,6 +193,9 @@ printchar (ch, fun) | |||
| 193 | 193 | ||
| 194 | if (EQ (fun, Qt)) | 194 | if (EQ (fun, Qt)) |
| 195 | { | 195 | { |
| 196 | struct frame *mini_frame | ||
| 197 | = XFRAME (WINDOW_FRAME (XWINDOW (minibuf_window))); | ||
| 198 | |||
| 196 | if (noninteractive) | 199 | if (noninteractive) |
| 197 | { | 200 | { |
| 198 | putchar (ch); | 201 | putchar (ch); |
| @@ -200,18 +203,18 @@ printchar (ch, fun) | |||
| 200 | return; | 203 | return; |
| 201 | } | 204 | } |
| 202 | 205 | ||
| 203 | if (echo_area_glyphs != FRAME_MESSAGE_BUF (selected_frame) | 206 | if (echo_area_glyphs != FRAME_MESSAGE_BUF (mini_frame) |
| 204 | || !message_buf_print) | 207 | || !message_buf_print) |
| 205 | { | 208 | { |
| 206 | echo_area_glyphs = FRAME_MESSAGE_BUF (selected_frame); | 209 | echo_area_glyphs = FRAME_MESSAGE_BUF (mini_frame); |
| 207 | printbufidx = 0; | 210 | printbufidx = 0; |
| 208 | echo_area_glyphs_length = 0; | 211 | echo_area_glyphs_length = 0; |
| 209 | message_buf_print = 1; | 212 | message_buf_print = 1; |
| 210 | } | 213 | } |
| 211 | 214 | ||
| 212 | if (printbufidx < FRAME_WIDTH (selected_frame) - 1) | 215 | if (printbufidx < FRAME_WIDTH (mini_frame) - 1) |
| 213 | FRAME_MESSAGE_BUF (selected_frame)[printbufidx++] = ch; | 216 | FRAME_MESSAGE_BUF (mini_frame)[printbufidx++] = ch; |
| 214 | FRAME_MESSAGE_BUF (selected_frame)[printbufidx] = 0; | 217 | FRAME_MESSAGE_BUF (mini_frame)[printbufidx] = 0; |
| 215 | echo_area_glyphs_length = printbufidx; | 218 | echo_area_glyphs_length = printbufidx; |
| 216 | 219 | ||
| 217 | return; | 220 | return; |
| @@ -241,6 +244,9 @@ strout (ptr, size, printcharfun) | |||
| 241 | } | 244 | } |
| 242 | if (EQ (printcharfun, Qt)) | 245 | if (EQ (printcharfun, Qt)) |
| 243 | { | 246 | { |
| 247 | struct frame *mini_frame | ||
| 248 | = XFRAME (WINDOW_FRAME (XWINDOW (minibuf_window))); | ||
| 249 | |||
| 244 | i = size >= 0 ? size : strlen (ptr); | 250 | i = size >= 0 ? size : strlen (ptr); |
| 245 | #ifdef MAX_PRINT_CHARS | 251 | #ifdef MAX_PRINT_CHARS |
| 246 | if (max_print) | 252 | if (max_print) |
| @@ -254,21 +260,21 @@ strout (ptr, size, printcharfun) | |||
| 254 | return; | 260 | return; |
| 255 | } | 261 | } |
| 256 | 262 | ||
| 257 | if (echo_area_glyphs != FRAME_MESSAGE_BUF (selected_frame) | 263 | if (echo_area_glyphs != FRAME_MESSAGE_BUF (mini_frame) |
| 258 | || !message_buf_print) | 264 | || !message_buf_print) |
| 259 | { | 265 | { |
| 260 | echo_area_glyphs = FRAME_MESSAGE_BUF (selected_frame); | 266 | echo_area_glyphs = FRAME_MESSAGE_BUF (mini_frame); |
| 261 | printbufidx = 0; | 267 | printbufidx = 0; |
| 262 | echo_area_glyphs_length = 0; | 268 | echo_area_glyphs_length = 0; |
| 263 | message_buf_print = 1; | 269 | message_buf_print = 1; |
| 264 | } | 270 | } |
| 265 | 271 | ||
| 266 | if (i > FRAME_WIDTH (selected_frame) - printbufidx - 1) | 272 | if (i > FRAME_WIDTH (mini_frame) - printbufidx - 1) |
| 267 | i = FRAME_WIDTH (selected_frame) - printbufidx - 1; | 273 | i = FRAME_WIDTH (mini_frame) - printbufidx - 1; |
| 268 | bcopy (ptr, &FRAME_MESSAGE_BUF (selected_frame) [printbufidx], i); | 274 | bcopy (ptr, &FRAME_MESSAGE_BUF (mini_frame) [printbufidx], i); |
| 269 | printbufidx += i; | 275 | printbufidx += i; |
| 270 | echo_area_glyphs_length = printbufidx; | 276 | echo_area_glyphs_length = printbufidx; |
| 271 | FRAME_MESSAGE_BUF (selected_frame) [printbufidx] = 0; | 277 | FRAME_MESSAGE_BUF (mini_frame) [printbufidx] = 0; |
| 272 | 278 | ||
| 273 | return; | 279 | return; |
| 274 | } | 280 | } |