Mercurial > emacs
comparison src/print.c @ 14084:8765a56417ac
(Fwrite_char, Fprin1, Fprin1_to_string, Fprinc, Fprint): Harmonize
arguments with documentation.
author | Erik Naggum <erik@naggum.no> |
---|---|
date | Tue, 09 Jan 1996 00:33:28 +0000 |
parents | 621a575db6f7 |
children | ee40177f6c68 |
comparison
equal
deleted
inserted
replaced
14083:3ac9d27214e4 | 14084:8765a56417ac |
---|---|
323 UNGCPRO; | 323 UNGCPRO; |
324 } | 324 } |
325 } | 325 } |
326 | 326 |
327 DEFUN ("write-char", Fwrite_char, Swrite_char, 1, 2, 0, | 327 DEFUN ("write-char", Fwrite_char, Swrite_char, 1, 2, 0, |
328 "Output character CHAR to stream PRINTCHARFUN.\n\ | 328 "Output character CHARACTER to stream PRINTCHARFUN.\n\ |
329 PRINTCHARFUN defaults to the value of `standard-output' (which see).") | 329 PRINTCHARFUN defaults to the value of `standard-output' (which see).") |
330 (ch, printcharfun) | 330 (character, printcharfun) |
331 Lisp_Object ch, printcharfun; | 331 Lisp_Object character, printcharfun; |
332 { | 332 { |
333 struct buffer *old = current_buffer; | 333 struct buffer *old = current_buffer; |
334 int old_point = -1; | 334 int old_point = -1; |
335 int start_point; | 335 int start_point; |
336 Lisp_Object original; | 336 Lisp_Object original; |
337 | 337 |
338 if (NILP (printcharfun)) | 338 if (NILP (printcharfun)) |
339 printcharfun = Vstandard_output; | 339 printcharfun = Vstandard_output; |
340 CHECK_NUMBER (ch, 0); | 340 CHECK_NUMBER (character, 0); |
341 PRINTPREPARE; | 341 PRINTPREPARE; |
342 PRINTCHAR (XINT (ch)); | 342 PRINTCHAR (XINT (character)); |
343 PRINTFINISH; | 343 PRINTFINISH; |
344 return ch; | 344 return character; |
345 } | 345 } |
346 | 346 |
347 /* Used from outside of print.c to print a block of SIZE chars at DATA | 347 /* Used from outside of print.c to print a block of SIZE chars at DATA |
348 on the default output stream. | 348 on the default output stream. |
349 Do not use this on the contents of a Lisp string. */ | 349 Do not use this on the contents of a Lisp string. */ |
489 DEFUN ("prin1", Fprin1, Sprin1, 1, 2, 0, | 489 DEFUN ("prin1", Fprin1, Sprin1, 1, 2, 0, |
490 "Output the printed representation of OBJECT, any Lisp object.\n\ | 490 "Output the printed representation of OBJECT, any Lisp object.\n\ |
491 Quoting characters are printed when needed to make output that `read'\n\ | 491 Quoting characters are printed when needed to make output that `read'\n\ |
492 can handle, whenever this is possible.\n\ | 492 can handle, whenever this is possible.\n\ |
493 Output stream is PRINTCHARFUN, or value of `standard-output' (which see).") | 493 Output stream is PRINTCHARFUN, or value of `standard-output' (which see).") |
494 (obj, printcharfun) | 494 (object, printcharfun) |
495 Lisp_Object obj, printcharfun; | 495 Lisp_Object object, printcharfun; |
496 { | 496 { |
497 struct buffer *old = current_buffer; | 497 struct buffer *old = current_buffer; |
498 int old_point = -1; | 498 int old_point = -1; |
499 int start_point; | 499 int start_point; |
500 Lisp_Object original; | 500 Lisp_Object original; |
504 #endif /* MAX_PRINT_CHARS */ | 504 #endif /* MAX_PRINT_CHARS */ |
505 if (NILP (printcharfun)) | 505 if (NILP (printcharfun)) |
506 printcharfun = Vstandard_output; | 506 printcharfun = Vstandard_output; |
507 PRINTPREPARE; | 507 PRINTPREPARE; |
508 print_depth = 0; | 508 print_depth = 0; |
509 print (obj, printcharfun, 1); | 509 print (object, printcharfun, 1); |
510 PRINTFINISH; | 510 PRINTFINISH; |
511 return obj; | 511 return object; |
512 } | 512 } |
513 | 513 |
514 /* a buffer which is used to hold output being built by prin1-to-string */ | 514 /* a buffer which is used to hold output being built by prin1-to-string */ |
515 Lisp_Object Vprin1_to_string_buffer; | 515 Lisp_Object Vprin1_to_string_buffer; |
516 | 516 |
517 DEFUN ("prin1-to-string", Fprin1_to_string, Sprin1_to_string, 1, 2, 0, | 517 DEFUN ("prin1-to-string", Fprin1_to_string, Sprin1_to_string, 1, 2, 0, |
518 "Return a string containing the printed representation of OBJECT,\n\ | 518 "Return a string containing the printed representation of OBJECT,\n\ |
519 any Lisp object. Quoting characters are used when needed to make output\n\ | 519 any Lisp object. Quoting characters are used when needed to make output\n\ |
520 that `read' can handle, whenever this is possible, unless the optional\n\ | 520 that `read' can handle, whenever this is possible, unless the optional\n\ |
521 second argument NOESCAPE is non-nil.") | 521 second argument NOESCAPE is non-nil.") |
522 (obj, noescape) | 522 (object, noescape) |
523 Lisp_Object obj, noescape; | 523 Lisp_Object object, noescape; |
524 { | 524 { |
525 struct buffer *old = current_buffer; | 525 struct buffer *old = current_buffer; |
526 int old_point = -1; | 526 int old_point = -1; |
527 int start_point; | 527 int start_point; |
528 Lisp_Object original, printcharfun; | 528 Lisp_Object original, printcharfun; |
529 struct gcpro gcpro1; | 529 struct gcpro gcpro1; |
530 | 530 |
531 printcharfun = Vprin1_to_string_buffer; | 531 printcharfun = Vprin1_to_string_buffer; |
532 PRINTPREPARE; | 532 PRINTPREPARE; |
533 print_depth = 0; | 533 print_depth = 0; |
534 print (obj, printcharfun, NILP (noescape)); | 534 print (object, printcharfun, NILP (noescape)); |
535 /* Make Vprin1_to_string_buffer be the default buffer after PRINTFINSH */ | 535 /* Make Vprin1_to_string_buffer be the default buffer after PRINTFINSH */ |
536 PRINTFINISH; | 536 PRINTFINISH; |
537 set_buffer_internal (XBUFFER (Vprin1_to_string_buffer)); | 537 set_buffer_internal (XBUFFER (Vprin1_to_string_buffer)); |
538 obj = Fbuffer_string (); | 538 object = Fbuffer_string (); |
539 | 539 |
540 GCPRO1 (obj); | 540 GCPRO1 (object); |
541 Ferase_buffer (); | 541 Ferase_buffer (); |
542 set_buffer_internal (old); | 542 set_buffer_internal (old); |
543 UNGCPRO; | 543 UNGCPRO; |
544 | 544 |
545 return obj; | 545 return object; |
546 } | 546 } |
547 | 547 |
548 DEFUN ("princ", Fprinc, Sprinc, 1, 2, 0, | 548 DEFUN ("princ", Fprinc, Sprinc, 1, 2, 0, |
549 "Output the printed representation of OBJECT, any Lisp object.\n\ | 549 "Output the printed representation of OBJECT, any Lisp object.\n\ |
550 No quoting characters are used; no delimiters are printed around\n\ | 550 No quoting characters are used; no delimiters are printed around\n\ |
551 the contents of strings.\n\ | 551 the contents of strings.\n\ |
552 Output stream is PRINTCHARFUN, or value of standard-output (which see).") | 552 Output stream is PRINTCHARFUN, or value of standard-output (which see).") |
553 (obj, printcharfun) | 553 (object, printcharfun) |
554 Lisp_Object obj, printcharfun; | 554 Lisp_Object object, printcharfun; |
555 { | 555 { |
556 struct buffer *old = current_buffer; | 556 struct buffer *old = current_buffer; |
557 int old_point = -1; | 557 int old_point = -1; |
558 int start_point; | 558 int start_point; |
559 Lisp_Object original; | 559 Lisp_Object original; |
560 | 560 |
561 if (NILP (printcharfun)) | 561 if (NILP (printcharfun)) |
562 printcharfun = Vstandard_output; | 562 printcharfun = Vstandard_output; |
563 PRINTPREPARE; | 563 PRINTPREPARE; |
564 print_depth = 0; | 564 print_depth = 0; |
565 print (obj, printcharfun, 0); | 565 print (object, printcharfun, 0); |
566 PRINTFINISH; | 566 PRINTFINISH; |
567 return obj; | 567 return object; |
568 } | 568 } |
569 | 569 |
570 DEFUN ("print", Fprint, Sprint, 1, 2, 0, | 570 DEFUN ("print", Fprint, Sprint, 1, 2, 0, |
571 "Output the printed representation of OBJECT, with newlines around it.\n\ | 571 "Output the printed representation of OBJECT, with newlines around it.\n\ |
572 Quoting characters are printed when needed to make output that `read'\n\ | 572 Quoting characters are printed when needed to make output that `read'\n\ |
573 can handle, whenever this is possible.\n\ | 573 can handle, whenever this is possible.\n\ |
574 Output stream is PRINTCHARFUN, or value of `standard-output' (which see).") | 574 Output stream is PRINTCHARFUN, or value of `standard-output' (which see).") |
575 (obj, printcharfun) | 575 (object, printcharfun) |
576 Lisp_Object obj, printcharfun; | 576 Lisp_Object object, printcharfun; |
577 { | 577 { |
578 struct buffer *old = current_buffer; | 578 struct buffer *old = current_buffer; |
579 int old_point = -1; | 579 int old_point = -1; |
580 int start_point; | 580 int start_point; |
581 Lisp_Object original; | 581 Lisp_Object original; |
585 print_chars = 0; | 585 print_chars = 0; |
586 max_print = MAX_PRINT_CHARS; | 586 max_print = MAX_PRINT_CHARS; |
587 #endif /* MAX_PRINT_CHARS */ | 587 #endif /* MAX_PRINT_CHARS */ |
588 if (NILP (printcharfun)) | 588 if (NILP (printcharfun)) |
589 printcharfun = Vstandard_output; | 589 printcharfun = Vstandard_output; |
590 GCPRO1 (obj); | 590 GCPRO1 (object); |
591 PRINTPREPARE; | 591 PRINTPREPARE; |
592 print_depth = 0; | 592 print_depth = 0; |
593 PRINTCHAR ('\n'); | 593 PRINTCHAR ('\n'); |
594 print (obj, printcharfun, 1); | 594 print (object, printcharfun, 1); |
595 PRINTCHAR ('\n'); | 595 PRINTCHAR ('\n'); |
596 PRINTFINISH; | 596 PRINTFINISH; |
597 #ifdef MAX_PRINT_CHARS | 597 #ifdef MAX_PRINT_CHARS |
598 max_print = 0; | 598 max_print = 0; |
599 print_chars = 0; | 599 print_chars = 0; |
600 #endif /* MAX_PRINT_CHARS */ | 600 #endif /* MAX_PRINT_CHARS */ |
601 UNGCPRO; | 601 UNGCPRO; |
602 return obj; | 602 return object; |
603 } | 603 } |
604 | 604 |
605 /* The subroutine object for external-debugging-output is kept here | 605 /* The subroutine object for external-debugging-output is kept here |
606 for the convenience of the debugger. */ | 606 for the convenience of the debugger. */ |
607 Lisp_Object Qexternal_debugging_output; | 607 Lisp_Object Qexternal_debugging_output; |