Mercurial > hg > xemacs-beta
comparison src/doprnt.c @ 4394:cacc942c0d0f
Avoid clearing print-gensym-alist inappropriately when printing hash tables.
2008-01-15 Aidan Kehoe <kehoea@parhasard.net>
* automated/lisp-tests.el (thing):
Check that printing a hash table literal doesn't clear
print-gensym-alist.
2008-01-15 Aidan Kehoe <kehoea@parhasard.net>
* print.c (prin1_to_string): New.
The guts of Fprin1_to_string, without resetting
Vprint_gensym_alist.
(Fprin1_to_string):
Call prin1_to_string, wrapped with RESET_PRINT_GENSYM calls.
* doprnt.c (emacs_doprnt_1):
Call prin1_to_string, not Fprin1_to_string (dos veces). Avoids an
inappropriate reset of print-gensym-alist.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Tue, 15 Jan 2008 21:35:01 +0100 |
parents | 3483b381b0a9 |
children | b5e1d4f6b66f |
comparison
equal
deleted
inserted
replaced
4391:cbf129b005df | 4394:cacc942c0d0f |
---|---|
556 | 556 |
557 if (ch == 'S') | 557 if (ch == 'S') |
558 { | 558 { |
559 /* For `S', prin1 the argument and then treat like | 559 /* For `S', prin1 the argument and then treat like |
560 a string. */ | 560 a string. */ |
561 ls = Fprin1_to_string (obj, Qnil); | 561 ls = prin1_to_string (obj, 0); |
562 } | 562 } |
563 else if (STRINGP (obj)) | 563 else if (STRINGP (obj)) |
564 ls = obj; | 564 ls = obj; |
565 else if (SYMBOLP (obj)) | 565 else if (SYMBOLP (obj)) |
566 ls = XSYMBOL (obj)->name; | 566 ls = XSYMBOL (obj)->name; |
567 else | 567 else |
568 { | 568 { |
569 /* convert to string using princ. */ | 569 /* convert to string using princ. */ |
570 ls = Fprin1_to_string (obj, Qt); | 570 ls = prin1_to_string (obj, 1); |
571 } | 571 } |
572 string = XSTRING_DATA (ls); | 572 string = XSTRING_DATA (ls); |
573 string_len = XSTRING_LENGTH (ls); | 573 string_len = XSTRING_LENGTH (ls); |
574 } | 574 } |
575 | 575 |