aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1993-03-01 08:59:36 +0000
committerRichard M. Stallman1993-03-01 08:59:36 +0000
commit7651e1f53fcfd40574ff1c23cb99b4579021e8cc (patch)
tree6b27a2dc61c7d7196e23ed0cc76b4376e8e182f6 /src
parent748ef62fff3b51dd4e61b59efb2fbc29e40bf33a (diff)
downloademacs-7651e1f53fcfd40574ff1c23cb99b4579021e8cc.tar.gz
emacs-7651e1f53fcfd40574ff1c23cb99b4579021e8cc.zip
(print--string case):
Any non-null interval means print intervals. Get rid of var obj1; just use obj. (print): Never declare OBJ arg as `register'. Special handling for strings with intervals. (print_intervals): New function.
Diffstat (limited to 'src')
-rw-r--r--src/print.c59
1 files changed, 48 insertions, 11 deletions
diff --git a/src/print.c b/src/print.c
index e9bfbcf2fcb..573b5d3f7d3 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1,5 +1,5 @@
1/* Lisp object printing and output streams. 1/* Lisp object printing and output streams.
2 Copyright (C) 1985, 1986, 1988, 1992 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1988, 1993 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
@@ -32,6 +32,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
32#include "termchar.h" 32#include "termchar.h"
33#endif /* not standalone */ 33#endif /* not standalone */
34 34
35#ifdef USE_TEXT_PROPERTIES
36#include "intervals.h"
37#endif
38
35Lisp_Object Vstandard_output, Qstandard_output; 39Lisp_Object Vstandard_output, Qstandard_output;
36 40
37#ifdef LISP_FLOAT_TYPE 41#ifdef LISP_FLOAT_TYPE
@@ -69,6 +73,8 @@ extern int noninteractive_need_newline;
69static int print_chars; 73static int print_chars;
70static int max_print; 74static int max_print;
71#endif /* MAX_PRINT_CHARS */ 75#endif /* MAX_PRINT_CHARS */
76
77void print_interval ();
72 78
73#if 0 79#if 0
74/* Convert between chars and GLYPHs */ 80/* Convert between chars and GLYPHs */
@@ -663,11 +669,7 @@ float_to_string (buf, data)
663 669
664static void 670static void
665print (obj, printcharfun, escapeflag) 671print (obj, printcharfun, escapeflag)
666#ifndef RTPC_REGISTER_BUG
667 register Lisp_Object obj;
668#else
669 Lisp_Object obj; 672 Lisp_Object obj;
670#endif
671 register Lisp_Object printcharfun; 673 register Lisp_Object printcharfun;
672 int escapeflag; 674 int escapeflag;
673{ 675{
@@ -744,14 +746,17 @@ print (obj, printcharfun, escapeflag)
744 { 746 {
745 register int i; 747 register int i;
746 register unsigned char c; 748 register unsigned char c;
747 Lisp_Object obj1;
748 struct gcpro gcpro1; 749 struct gcpro gcpro1;
749 750
750 /* You can't gcpro register variables, so copy obj to a 751 GCPRO1 (obj);
751 non-register variable so we can gcpro it without 752
752 making it non-register. */ 753#ifdef USE_TEXT_PROPERTIES
753 obj1 = obj; 754 if (!NULL_INTERVAL_P (XSTRING (obj)->intervals))
754 GCPRO1 (obj1); 755 {
756 PRINTCHAR ('#');
757 PRINTCHAR ('(');
758 }
759#endif
755 760
756 PRINTCHAR ('\"'); 761 PRINTCHAR ('\"');
757 for (i = 0; i < XSTRING (obj)->size; i++) 762 for (i = 0; i < XSTRING (obj)->size; i++)
@@ -771,6 +776,17 @@ print (obj, printcharfun, escapeflag)
771 } 776 }
772 } 777 }
773 PRINTCHAR ('\"'); 778 PRINTCHAR ('\"');
779
780#ifdef USE_TEXT_PROPERTIES
781 if (!NULL_INTERVAL_P (XSTRING (obj)->intervals))
782 {
783 PRINTCHAR (' ');
784 traverse_intervals (XSTRING (obj)->intervals,
785 0, 0, print_interval, printcharfun);
786 PRINTCHAR (')');
787 }
788#endif
789
774 UNGCPRO; 790 UNGCPRO;
775 } 791 }
776 break; 792 break;
@@ -944,6 +960,27 @@ print (obj, printcharfun, escapeflag)
944 print_depth--; 960 print_depth--;
945} 961}
946 962
963#ifdef USE_TEXT_PROPERTIES
964
965/* Print a description of INTERVAL using PRINTCHARFUN.
966 This is part of printing a string that has text properties. */
967
968void
969print_interval (interval, printcharfun)
970 INTERVAL interval;
971 Lisp_Object printcharfun;
972{
973 print (make_number (interval->position), printcharfun, 1);
974 PRINTCHAR (' ');
975 print (make_number (interval->position + LENGTH (interval)),
976 printcharfun, 1);
977 PRINTCHAR (' ');
978 print (interval->plist, printcharfun, 1);
979 PRINTCHAR (' ');
980}
981
982#endif /* USE_TEXT_PROPERTIES */
983
947void 984void
948syms_of_print () 985syms_of_print ()
949{ 986{