Mercurial > hg > xemacs-beta
comparison src/print.c @ 217:d44af0c54775 r20-4b7
Import from CVS: tag r20-4b7
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:08:34 +0200 |
parents | 78478c60bfcd |
children | 262b8bb4a523 |
comparison
equal
deleted
inserted
replaced
216:43306a74e31c | 217:d44af0c54775 |
---|---|
531 second argument NOESCAPE is non-nil. | 531 second argument NOESCAPE is non-nil. |
532 */ | 532 */ |
533 (object, noescape)) | 533 (object, noescape)) |
534 { | 534 { |
535 /* This function can GC */ | 535 /* This function can GC */ |
536 Lisp_Object old = Fcurrent_buffer (); | |
537 struct buffer *out = XBUFFER (Vprin1_to_string_buffer); | 536 struct buffer *out = XBUFFER (Vprin1_to_string_buffer); |
538 Lisp_Object stream = Qnil; | 537 Lisp_Object stream = Qnil; |
539 struct gcpro gcpro1, gcpro2, gcpro3; | 538 struct gcpro gcpro1, gcpro2; |
540 | 539 |
541 GCPRO3 (object, old, stream); | 540 GCPRO2 (object, stream); |
542 stream = print_prepare (Vprin1_to_string_buffer); | 541 stream = print_prepare (Vprin1_to_string_buffer); |
543 set_buffer_internal (out); | 542 Ferase_buffer (Vprin1_to_string_buffer); |
544 Ferase_buffer (Fcurrent_buffer ()); | |
545 print_depth = 0; | 543 print_depth = 0; |
546 print_internal (object, stream, NILP (noescape)); | 544 print_internal (object, stream, NILP (noescape)); |
547 print_finish (stream); | 545 print_finish (stream); |
548 stream = Qnil; /* No GC surprises! */ | 546 stream = Qnil; /* No GC surprises! */ |
549 object = make_string_from_buffer (out, | 547 object = make_string_from_buffer (out, |
550 BUF_BEG (out), | 548 BUF_BEG (out), |
551 BUF_Z (out) - 1); | 549 BUF_Z (out) - 1); |
552 Ferase_buffer (Fcurrent_buffer ()); | 550 Ferase_buffer (Vprin1_to_string_buffer); |
553 Fset_buffer (old); | |
554 UNGCPRO; | 551 UNGCPRO; |
555 return object; | 552 return object; |
556 } | 553 } |
557 | 554 |
558 DEFUN ("princ", Fprinc, 1, 2, 0, /* | 555 DEFUN ("princ", Fprinc, 1, 2, 0, /* |