Mercurial > hg > xemacs-beta
comparison src/print.c @ 5677:febc025c4e0c
Adopt GNU's ## syntax for the interned symbol with name "".
src/ChangeLog addition:
2012-08-06 Aidan Kehoe <kehoea@parhasard.net>
* lread.c (read1):
* print.c (print_symbol):
Adopt GNU's ## syntax for the interned symbol with the zero-length
name.
man/ChangeLog addition:
2012-08-06 Aidan Kehoe <kehoea@parhasard.net>
* lispref/symbols.texi (Symbol Components):
Document the new syntax of ## for the symbol with name "" interned
in obarray.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Mon, 06 Aug 2012 13:07:55 +0100 |
parents | 56144c8593a8 |
children | cd4f5f1f1f4c |
comparison
equal
deleted
inserted
replaced
5676:dede3f658f8e | 5677:febc025c4e0c |
---|---|
2373 | 2373 |
2374 void | 2374 void |
2375 print_symbol (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) | 2375 print_symbol (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) |
2376 { | 2376 { |
2377 /* This function can GC */ | 2377 /* This function can GC */ |
2378 /* #### Bug!! (intern "") isn't printed in some distinguished way */ | |
2379 /* #### (the reader also loses on it) */ | |
2380 Lisp_Object name = symbol_name (XSYMBOL (obj)); | 2378 Lisp_Object name = symbol_name (XSYMBOL (obj)); |
2381 Bytecount size = XSTRING_LENGTH (name); | 2379 Bytecount size = XSTRING_LENGTH (name); |
2382 struct gcpro gcpro1, gcpro2; | 2380 struct gcpro gcpro1, gcpro2; |
2383 | 2381 |
2384 if (!escapeflag) | 2382 if (!escapeflag) |
2388 return; | 2386 return; |
2389 } | 2387 } |
2390 | 2388 |
2391 GCPRO2 (obj, printcharfun); | 2389 GCPRO2 (obj, printcharfun); |
2392 | 2390 |
2393 if (print_gensym) | 2391 if (print_gensym && !IN_OBARRAY (obj)) |
2394 { | 2392 { |
2395 if (!IN_OBARRAY (obj)) | 2393 write_ascstring (printcharfun, "#:"); |
2396 { | 2394 } |
2397 write_ascstring (printcharfun, "#:"); | 2395 else if (0 == size) |
2398 } | 2396 { |
2397 /* Compatible with GNU, but not with Common Lisp, where the syntax for | |
2398 this symbol is ||. */ | |
2399 write_ascstring (printcharfun, "##"); | |
2399 } | 2400 } |
2400 | 2401 |
2401 /* Does it look like an integer or a float? */ | 2402 /* Does it look like an integer or a float? */ |
2402 { | 2403 { |
2403 Ibyte *data = XSTRING_DATA (name); | 2404 Ibyte *data = XSTRING_DATA (name); |