diff options
| author | Richard M. Stallman | 1997-04-18 19:12:24 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-04-18 19:12:24 +0000 |
| commit | d27497e33a7a90c593a4ece376151988547dc0ee (patch) | |
| tree | 330bacf1d92f420f2d0268854fefba40bc2a96a0 | |
| parent | fc24e7fbc8b3cca6e1bf09e26a72a218f38c225e (diff) | |
| download | emacs-d27497e33a7a90c593a4ece376151988547dc0ee.tar.gz emacs-d27497e33a7a90c593a4ece376151988547dc0ee.zip | |
(print): Symbols like e2 and 2e are not confusing.
| -rw-r--r-- | src/print.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/print.c b/src/print.c index 8a218e88105..933544467ca 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -1016,7 +1016,15 @@ print (obj, printcharfun, escapeflag) | |||
| 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. */ |
| @@ -1024,6 +1032,8 @@ print (obj, printcharfun, escapeflag) | |||
| 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 |