comparison src/print.c @ 766:b9e81bfc7ad9

entered into RCS
author Jim Blandy <jimb@redhat.com>
date Mon, 13 Jul 1992 20:56:17 +0000
parents a8d94735277e
children 5d58b9e933ee
comparison
equal deleted inserted replaced
765:e4093444f9f8 766:b9e81bfc7ad9
23 #undef NULL 23 #undef NULL
24 #include "lisp.h" 24 #include "lisp.h"
25 25
26 #ifndef standalone 26 #ifndef standalone
27 #include "buffer.h" 27 #include "buffer.h"
28 #include "screen.h" 28 #include "frame.h"
29 #include "window.h" 29 #include "window.h"
30 #include "process.h" 30 #include "process.h"
31 #include "dispextern.h" 31 #include "dispextern.h"
32 #include "termchar.h" 32 #include "termchar.h"
33 #endif /* not standalone */ 33 #endif /* not standalone */
157 if (old != current_buffer) \ 157 if (old != current_buffer) \
158 set_buffer_internal (old) 158 set_buffer_internal (old)
159 159
160 #define PRINTCHAR(ch) printchar (ch, printcharfun) 160 #define PRINTCHAR(ch) printchar (ch, printcharfun)
161 161
162 /* Index of first unused element of SCREEN_MESSAGE_BUF(selected_screen). */ 162 /* Index of first unused element of FRAME_MESSAGE_BUF(selected_frame). */
163 static int printbufidx; 163 static int printbufidx;
164 164
165 static void 165 static void
166 printchar (ch, fun) 166 printchar (ch, fun)
167 unsigned char ch; 167 unsigned char ch;
188 putchar (ch); 188 putchar (ch);
189 noninteractive_need_newline = 1; 189 noninteractive_need_newline = 1;
190 return; 190 return;
191 } 191 }
192 192
193 if (echo_area_glyphs != SCREEN_MESSAGE_BUF (selected_screen) 193 if (echo_area_glyphs != FRAME_MESSAGE_BUF (selected_frame)
194 || !message_buf_print) 194 || !message_buf_print)
195 { 195 {
196 echo_area_glyphs = SCREEN_MESSAGE_BUF (selected_screen); 196 echo_area_glyphs = FRAME_MESSAGE_BUF (selected_frame);
197 printbufidx = 0; 197 printbufidx = 0;
198 message_buf_print = 1; 198 message_buf_print = 1;
199 } 199 }
200 200
201 if (printbufidx < SCREEN_WIDTH (selected_screen) - 1) 201 if (printbufidx < FRAME_WIDTH (selected_frame) - 1)
202 SCREEN_MESSAGE_BUF (selected_screen)[printbufidx++] = ch; 202 FRAME_MESSAGE_BUF (selected_frame)[printbufidx++] = ch;
203 SCREEN_MESSAGE_BUF (selected_screen)[printbufidx] = 0; 203 FRAME_MESSAGE_BUF (selected_frame)[printbufidx] = 0;
204 204
205 return; 205 return;
206 } 206 }
207 #endif /* not standalone */ 207 #endif /* not standalone */
208 208
240 fwrite (ptr, 1, i, stdout); 240 fwrite (ptr, 1, i, stdout);
241 noninteractive_need_newline = 1; 241 noninteractive_need_newline = 1;
242 return; 242 return;
243 } 243 }
244 244
245 if (echo_area_glyphs != SCREEN_MESSAGE_BUF (selected_screen) 245 if (echo_area_glyphs != FRAME_MESSAGE_BUF (selected_frame)
246 || !message_buf_print) 246 || !message_buf_print)
247 { 247 {
248 echo_area_glyphs = SCREEN_MESSAGE_BUF (selected_screen); 248 echo_area_glyphs = FRAME_MESSAGE_BUF (selected_frame);
249 printbufidx = 0; 249 printbufidx = 0;
250 message_buf_print = 1; 250 message_buf_print = 1;
251 } 251 }
252 252
253 if (i > SCREEN_WIDTH (selected_screen) - printbufidx - 1) 253 if (i > FRAME_WIDTH (selected_frame) - printbufidx - 1)
254 i = SCREEN_WIDTH (selected_screen) - printbufidx - 1; 254 i = FRAME_WIDTH (selected_frame) - printbufidx - 1;
255 bcopy (ptr, &SCREEN_MESSAGE_BUF (selected_screen) [printbufidx], i); 255 bcopy (ptr, &FRAME_MESSAGE_BUF (selected_frame) [printbufidx], i);
256 printbufidx += i; 256 printbufidx += i;
257 SCREEN_MESSAGE_BUF (selected_screen) [printbufidx] = 0; 257 FRAME_MESSAGE_BUF (selected_frame) [printbufidx] = 0;
258 258
259 return; 259 return;
260 } 260 }
261 261
262 if (size >= 0) 262 if (size >= 0)
273 print_string (string, printcharfun) 273 print_string (string, printcharfun)
274 Lisp_Object string; 274 Lisp_Object string;
275 Lisp_Object printcharfun; 275 Lisp_Object printcharfun;
276 { 276 {
277 if (EQ (printcharfun, Qnil) || EQ (printcharfun, Qt)) 277 if (EQ (printcharfun, Qnil) || EQ (printcharfun, Qt))
278 /* In predictable cases, strout is safe: output to buffer or screen. */ 278 /* In predictable cases, strout is safe: output to buffer or frame. */
279 strout (XSTRING (string)->data, XSTRING (string)->size, printcharfun); 279 strout (XSTRING (string)->data, XSTRING (string)->size, printcharfun);
280 else 280 else
281 { 281 {
282 /* Otherwise, fetch the string address for each character. */ 282 /* Otherwise, fetch the string address for each character. */
283 int i; 283 int i;
885 885
886 case Lisp_Window_Configuration: 886 case Lisp_Window_Configuration:
887 strout ("#<window-configuration>", -1, printcharfun); 887 strout ("#<window-configuration>", -1, printcharfun);
888 break; 888 break;
889 889
890 #ifdef MULTI_SCREEN 890 #ifdef MULTI_FRAME
891 case Lisp_Screen: 891 case Lisp_Frame:
892 strout (((XSCREEN (obj)->display.nothing == 0) 892 strout ((FRAME_LIVE_P (XFRAME (obj))
893 ? "#<dead screen " : "#<screen "), 893 ? "#<frame " : "#<dead frame "),
894 -1, printcharfun); 894 -1, printcharfun);
895 print_string (XSCREEN (obj)->name, printcharfun); 895 print_string (XFRAME (obj)->name, printcharfun);
896 sprintf (buf, " 0x%x", XFASTINT (XSCREEN (obj))); 896 sprintf (buf, " 0x%x", XFASTINT (XFRAME (obj)));
897 strout (buf, -1, printcharfun); 897 strout (buf, -1, printcharfun);
898 strout (">", -1, printcharfun); 898 strout (">", -1, printcharfun);
899 break; 899 break;
900 #endif /* MULTI_SCREEN */ 900 #endif /* MULTI_FRAME */
901 901
902 case Lisp_Marker: 902 case Lisp_Marker:
903 strout ("#<marker ", -1, printcharfun); 903 strout ("#<marker ", -1, printcharfun);
904 if (!(XMARKER (obj)->buffer)) 904 if (!(XMARKER (obj)->buffer))
905 strout ("in no buffer", -1, printcharfun); 905 strout ("in no buffer", -1, printcharfun);