aboutsummaryrefslogtreecommitdiffstats
path: root/src/print.c
diff options
context:
space:
mode:
authorKarl Heuer1994-09-27 01:58:12 +0000
committerKarl Heuer1994-09-27 01:58:12 +0000
commitd4ae1f7e0540b7cce1fcad26ff33bef26c84b35d (patch)
tree3c3abff154bb5d22db084255a85f48962c73c3a6 /src/print.c
parent3bda169e6d48b433ddf56844844f02e92b521271 (diff)
downloademacs-d4ae1f7e0540b7cce1fcad26ff33bef26c84b35d.tar.gz
emacs-d4ae1f7e0540b7cce1fcad26ff33bef26c84b35d.zip
(PRINTPREPARE, PRINTFINISH, float_to_string, print): Use type test macros.
Diffstat (limited to 'src/print.c')
-rw-r--r--src/print.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/print.c b/src/print.c
index f9572d69744..ea9e00f9ccd 100644
--- a/src/print.c
+++ b/src/print.c
@@ -144,11 +144,11 @@ glyph_to_str_cpy (glyphs, str)
144#define PRINTPREPARE \ 144#define PRINTPREPARE \
145 original = printcharfun; \ 145 original = printcharfun; \
146 if (NILP (printcharfun)) printcharfun = Qt; \ 146 if (NILP (printcharfun)) printcharfun = Qt; \
147 if (XTYPE (printcharfun) == Lisp_Buffer) \ 147 if (BUFFERP (printcharfun)) \
148 { if (XBUFFER (printcharfun) != current_buffer) \ 148 { if (XBUFFER (printcharfun) != current_buffer) \
149 Fset_buffer (printcharfun); \ 149 Fset_buffer (printcharfun); \
150 printcharfun = Qnil;} \ 150 printcharfun = Qnil;} \
151 if (XTYPE (printcharfun) == Lisp_Marker) \ 151 if (MARKERP (printcharfun)) \
152 { if (!(XMARKER (original)->buffer)) \ 152 { if (!(XMARKER (original)->buffer)) \
153 error ("Marker does not point anywhere"); \ 153 error ("Marker does not point anywhere"); \
154 if (XMARKER (original)->buffer != current_buffer) \ 154 if (XMARKER (original)->buffer != current_buffer) \
@@ -159,7 +159,7 @@ glyph_to_str_cpy (glyphs, str)
159 printcharfun = Qnil;} 159 printcharfun = Qnil;}
160 160
161#define PRINTFINISH \ 161#define PRINTFINISH \
162 if (XTYPE (original) == Lisp_Marker) \ 162 if (MARKERP (original)) \
163 Fset_marker (original, make_number (point), Qnil); \ 163 Fset_marker (original, make_number (point), Qnil); \
164 if (old_point >= 0) \ 164 if (old_point >= 0) \
165 SET_PT (old_point + (old_point >= start_point \ 165 SET_PT (old_point + (old_point >= start_point \
@@ -638,7 +638,7 @@ float_to_string (buf, data)
638 int width; 638 int width;
639 639
640 if (NILP (Vfloat_output_format) 640 if (NILP (Vfloat_output_format)
641 || XTYPE (Vfloat_output_format) != Lisp_String) 641 || !STRINGP (Vfloat_output_format))
642 lose: 642 lose:
643 { 643 {
644 sprintf (buf, "%.17g", data); 644 sprintf (buf, "%.17g", data);
@@ -719,8 +719,7 @@ print (obj, printcharfun, escapeflag)
719#if 1 /* I'm not sure this is really worth doing. */ 719#if 1 /* I'm not sure this is really worth doing. */
720 /* Detect circularities and truncate them. 720 /* Detect circularities and truncate them.
721 No need to offer any alternative--this is better than an error. */ 721 No need to offer any alternative--this is better than an error. */
722 if (XTYPE (obj) == Lisp_Cons || XTYPE (obj) == Lisp_Vector 722 if (CONSP (obj) || VECTORP (obj) || COMPILEDP (obj))
723 || XTYPE (obj) == Lisp_Compiled)
724 { 723 {
725 int i; 724 int i;
726 for (i = 0; i < print_depth; i++) 725 for (i = 0; i < print_depth; i++)
@@ -870,7 +869,7 @@ print (obj, printcharfun, escapeflag)
870 869
871 case Lisp_Cons: 870 case Lisp_Cons:
872 /* If deeper than spec'd depth, print placeholder. */ 871 /* If deeper than spec'd depth, print placeholder. */
873 if (XTYPE (Vprint_level) == Lisp_Int 872 if (INTEGERP (Vprint_level)
874 && print_depth > XINT (Vprint_level)) 873 && print_depth > XINT (Vprint_level))
875 { 874 {
876 strout ("...", -1, printcharfun); 875 strout ("...", -1, printcharfun);
@@ -882,7 +881,7 @@ print (obj, printcharfun, escapeflag)
882 register int i = 0; 881 register int i = 0;
883 register int max = 0; 882 register int max = 0;
884 883
885 if (XTYPE (Vprint_length) == Lisp_Int) 884 if (INTEGERP (Vprint_length))
886 max = XINT (Vprint_length); 885 max = XINT (Vprint_length);
887 /* Could recognize circularities in cdrs here, 886 /* Could recognize circularities in cdrs here,
888 but that would make printing of long lists quadratic. 887 but that would make printing of long lists quadratic.