Mercurial > emacs
comparison src/print.c @ 5487:58a9bb23c3ea
(strout, printchar): Use proper frame for minibuffer.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 07 Jan 1994 13:50:23 +0000 |
parents | 83e771f33251 |
children | f2e341b1f908 |
comparison
equal
deleted
inserted
replaced
5486:c87d1cd3f62a | 5487:58a9bb23c3ea |
---|---|
167 if (old != current_buffer) \ | 167 if (old != current_buffer) \ |
168 set_buffer_internal (old) | 168 set_buffer_internal (old) |
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 |
176 printchar (ch, fun) | 176 printchar (ch, fun) |
177 unsigned char ch; | 177 unsigned char ch; |
191 return; | 191 return; |
192 } | 192 } |
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); |
199 noninteractive_need_newline = 1; | 202 noninteractive_need_newline = 1; |
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; |
218 } | 221 } |
219 #endif /* not standalone */ | 222 #endif /* not standalone */ |
239 #endif /* MAX_PRINT_CHARS */ | 242 #endif /* MAX_PRINT_CHARS */ |
240 return; | 243 return; |
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) |
247 print_chars += i; | 253 print_chars += i; |
248 #endif /* MAX_PRINT_CHARS */ | 254 #endif /* MAX_PRINT_CHARS */ |
252 fwrite (ptr, 1, i, stdout); | 258 fwrite (ptr, 1, i, stdout); |
253 noninteractive_need_newline = 1; | 259 noninteractive_need_newline = 1; |
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 } |
275 | 281 |
276 if (size >= 0) | 282 if (size >= 0) |