summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-04-18 19:12:24 +0000
committerRichard M. Stallman <rms@gnu.org>1997-04-18 19:12:24 +0000
commitd27497e33a7a90c593a4ece376151988547dc0ee (patch)
tree330bacf1d92f420f2d0268854fefba40bc2a96a0
parentfc24e7fbc8b3cca6e1bf09e26a72a218f38c225e (diff)
downloademacs-d27497e33a7a90c593a4ece376151988547dc0ee.tar.gz
(print): Symbols like e2 and 2e are not confusing.
-rw-r--r--src/print.c12
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)
if (p != end && (*p == '-' || *p == '+')) p++;
if (p == end)
confusing = 0;
- else
+ /* If symbol name begins with a digit, and ends with a digit,
+ and contains nothing but digits and `e', it could be treated
+ as a number. So set CONFUSING.
+
+ Symbols that contain periods could also be taken as numbers,
+ but periods are always escaped, so we don't have to worry
+ about them here. */
+ else if (*p >= '0' && *p <= '9'
+ && end[-1] >= '0' && end[-1] <= '9')
{
while (p != end && ((*p >= '0' && *p <= '9')
/* Needed for \2e10. */
@@ -1024,6 +1032,8 @@ print (obj, printcharfun, escapeflag)
p++;
confusing = (end == p);
}
+ else
+ confusing = 0;
/* If we print an uninterned symbol as part of a complex object and
the flag print-gensym is non-nil, prefix it with #n= to read the