Mercurial > emacs
comparison src/print.c @ 17509:0c38918fbf13
(print): Symbols like e2 and 2e are not confusing.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 18 Apr 1997 19:12:24 +0000 |
parents | c19c552c486f |
children | 913d2cc5a6aa |
comparison
equal
deleted
inserted
replaced
17508:1c2392208ad9 | 17509:0c38918fbf13 |
---|---|
1014 int i; | 1014 int i; |
1015 | 1015 |
1016 if (p != end && (*p == '-' || *p == '+')) p++; | 1016 if (p != end && (*p == '-' || *p == '+')) p++; |
1017 if (p == end) | 1017 if (p == end) |
1018 confusing = 0; | 1018 confusing = 0; |
1019 else | 1019 /* If symbol name begins with a digit, and ends with a digit, |
1020 and contains nothing but digits and `e', it could be treated | |
1021 as a number. So set CONFUSING. | |
1022 | |
1023 Symbols that contain periods could also be taken as numbers, | |
1024 but periods are always escaped, so we don't have to worry | |
1025 about them here. */ | |
1026 else if (*p >= '0' && *p <= '9' | |
1027 && end[-1] >= '0' && end[-1] <= '9') | |
1020 { | 1028 { |
1021 while (p != end && ((*p >= '0' && *p <= '9') | 1029 while (p != end && ((*p >= '0' && *p <= '9') |
1022 /* Needed for \2e10. */ | 1030 /* Needed for \2e10. */ |
1023 || *p == 'e')) | 1031 || *p == 'e')) |
1024 p++; | 1032 p++; |
1025 confusing = (end == p); | 1033 confusing = (end == p); |
1026 } | 1034 } |
1035 else | |
1036 confusing = 0; | |
1027 | 1037 |
1028 /* If we print an uninterned symbol as part of a complex object and | 1038 /* If we print an uninterned symbol as part of a complex object and |
1029 the flag print-gensym is non-nil, prefix it with #n= to read the | 1039 the flag print-gensym is non-nil, prefix it with #n= to read the |
1030 object back with the #n# reader syntax later if needed. */ | 1040 object back with the #n# reader syntax later if needed. */ |
1031 if (print_gensym && NILP (XSYMBOL (obj)->obarray)) | 1041 if (print_gensym && NILP (XSYMBOL (obj)->obarray)) |