Mercurial > emacs
comparison src/print.c @ 27727:9400865ec7cf
Remove `LISP_FLOAT_TYPE' and `standalone'.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Thu, 17 Feb 2000 09:45:46 +0000 |
parents | b633c8e0fee1 |
children | 869387703a36 |
comparison
equal
deleted
inserted
replaced
27726:9627810a3fed | 27727:9400865ec7cf |
---|---|
38 Lisp_Object Qtemp_buffer_setup_hook; | 38 Lisp_Object Qtemp_buffer_setup_hook; |
39 | 39 |
40 /* These are used to print like we read. */ | 40 /* These are used to print like we read. */ |
41 extern Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction; | 41 extern Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction; |
42 | 42 |
43 #ifdef LISP_FLOAT_TYPE | |
44 Lisp_Object Vfloat_output_format, Qfloat_output_format; | 43 Lisp_Object Vfloat_output_format, Qfloat_output_format; |
45 | 44 |
46 /* Work around a problem that happens because math.h on hpux 7 | 45 /* Work around a problem that happens because math.h on hpux 7 |
47 defines two static variables--which, in Emacs, are not really static, | 46 defines two static variables--which, in Emacs, are not really static, |
48 because `static' is defined as nothing. The problem is that they are | 47 because `static' is defined as nothing. The problem is that they are |
86 #if FLT_RADIX == 2 && DBL_MANT_DIG == 53 | 85 #if FLT_RADIX == 2 && DBL_MANT_DIG == 53 |
87 #define DOUBLE_DIGITS_BOUND 17 /* IEEE floating point */ | 86 #define DOUBLE_DIGITS_BOUND 17 /* IEEE floating point */ |
88 #else | 87 #else |
89 #define DOUBLE_DIGITS_BOUND ((int) ceil (log10 (pow (FLT_RADIX, DBL_MANT_DIG)))) | 88 #define DOUBLE_DIGITS_BOUND ((int) ceil (log10 (pow (FLT_RADIX, DBL_MANT_DIG)))) |
90 #endif | 89 #endif |
91 | |
92 #endif /* LISP_FLOAT_TYPE */ | |
93 | 90 |
94 /* Avoid actual stack overflow in print. */ | 91 /* Avoid actual stack overflow in print. */ |
95 int print_depth; | 92 int print_depth; |
96 | 93 |
97 /* Detect most circularities to print finite output. */ | 94 /* Detect most circularities to print finite output. */ |
912 Fprin1 (Fcar (tail), stream); | 909 Fprin1 (Fcar (tail), stream); |
913 } | 910 } |
914 UNGCPRO; | 911 UNGCPRO; |
915 } | 912 } |
916 | 913 |
917 #ifdef LISP_FLOAT_TYPE | |
918 | 914 |
919 /* | 915 /* |
920 * The buffer should be at least as large as the max string size of the | 916 * The buffer should be at least as large as the max string size of the |
921 * largest float, printed in the biggest notation. This is undoubtedly | 917 * largest float, printed in the biggest notation. This is undoubtedly |
922 * 20d float_output_format, with the negative of the C-constant "HUGE" | 918 * 20d float_output_format, with the negative of the C-constant "HUGE" |
1051 *cp++ = '0'; | 1047 *cp++ = '0'; |
1052 *cp++ = 0; | 1048 *cp++ = 0; |
1053 } | 1049 } |
1054 } | 1050 } |
1055 } | 1051 } |
1056 #endif /* LISP_FLOAT_TYPE */ | 1052 |
1057 | 1053 |
1058 static void | 1054 static void |
1059 print (obj, printcharfun, escapeflag) | 1055 print (obj, printcharfun, escapeflag) |
1060 Lisp_Object obj; | 1056 Lisp_Object obj; |
1061 register Lisp_Object printcharfun; | 1057 register Lisp_Object printcharfun; |
1267 else | 1263 else |
1268 abort (); | 1264 abort (); |
1269 strout (buf, -1, -1, printcharfun, 0); | 1265 strout (buf, -1, -1, printcharfun, 0); |
1270 break; | 1266 break; |
1271 | 1267 |
1272 #ifdef LISP_FLOAT_TYPE | |
1273 case Lisp_Float: | 1268 case Lisp_Float: |
1274 { | 1269 { |
1275 char pigbuf[350]; /* see comments in float_to_string */ | 1270 char pigbuf[350]; /* see comments in float_to_string */ |
1276 | 1271 |
1277 float_to_string (pigbuf, XFLOAT_DATA (obj)); | 1272 float_to_string (pigbuf, XFLOAT_DATA (obj)); |
1278 strout (pigbuf, -1, -1, printcharfun, 0); | 1273 strout (pigbuf, -1, -1, printcharfun, 0); |
1279 } | 1274 } |
1280 break; | 1275 break; |
1281 #endif | |
1282 | 1276 |
1283 case Lisp_String: | 1277 case Lisp_String: |
1284 if (!escapeflag) | 1278 if (!escapeflag) |
1285 print_string (obj, printcharfun); | 1279 print_string (obj, printcharfun); |
1286 else | 1280 else |
1884 or the symbol t (output appears in the echo area)."); | 1878 or the symbol t (output appears in the echo area)."); |
1885 Vstandard_output = Qt; | 1879 Vstandard_output = Qt; |
1886 Qstandard_output = intern ("standard-output"); | 1880 Qstandard_output = intern ("standard-output"); |
1887 staticpro (&Qstandard_output); | 1881 staticpro (&Qstandard_output); |
1888 | 1882 |
1889 #ifdef LISP_FLOAT_TYPE | |
1890 DEFVAR_LISP ("float-output-format", &Vfloat_output_format, | 1883 DEFVAR_LISP ("float-output-format", &Vfloat_output_format, |
1891 "The format descriptor string used to print floats.\n\ | 1884 "The format descriptor string used to print floats.\n\ |
1892 This is a %-spec like those accepted by `printf' in C,\n\ | 1885 This is a %-spec like those accepted by `printf' in C,\n\ |
1893 but with some restrictions. It must start with the two characters `%.'.\n\ | 1886 but with some restrictions. It must start with the two characters `%.'.\n\ |
1894 After that comes an integer precision specification,\n\ | 1887 After that comes an integer precision specification,\n\ |
1903 A value of nil means to use the shortest notation\n\ | 1896 A value of nil means to use the shortest notation\n\ |
1904 that represents the number without losing information."); | 1897 that represents the number without losing information."); |
1905 Vfloat_output_format = Qnil; | 1898 Vfloat_output_format = Qnil; |
1906 Qfloat_output_format = intern ("float-output-format"); | 1899 Qfloat_output_format = intern ("float-output-format"); |
1907 staticpro (&Qfloat_output_format); | 1900 staticpro (&Qfloat_output_format); |
1908 #endif /* LISP_FLOAT_TYPE */ | |
1909 | 1901 |
1910 DEFVAR_LISP ("print-length", &Vprint_length, | 1902 DEFVAR_LISP ("print-length", &Vprint_length, |
1911 "Maximum length of list to print before abbreviating.\n\ | 1903 "Maximum length of list to print before abbreviating.\n\ |
1912 A value of nil means no limit."); | 1904 A value of nil means no limit."); |
1913 Vprint_length = Qnil; | 1905 Vprint_length = Qnil; |