[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 15/19: Merge commit '5943a62042432b86d757200ef595d7aebb5
From: |
Andy Wingo |
Subject: |
[Guile-commits] 15/19: Merge commit '5943a62042432b86d757200ef595d7aebb5c9bac' |
Date: |
Thu, 22 Jan 2015 13:54:49 +0000 |
wingo pushed a commit to branch master
in repository guile.
commit 1cd779140dd74ddfaa62032882cb4745c2302cee
Merge: baa74d3 5943a62
Author: Andy Wingo <address@hidden>
Date: Thu Jan 22 14:38:00 2015 +0100
Merge commit '5943a62042432b86d757200ef595d7aebb5c9bac'
libguile/print.c | 76 ++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 51 insertions(+), 25 deletions(-)
diff --cc libguile/print.c
index 0a2067f,86e0a03..d950511
--- a/libguile/print.c
+++ b/libguile/print.c
@@@ -701,27 -636,20 +704,23 @@@ iprin1 (SCM exp, SCM port, scm_print_st
break;
}
break;
+ case scm_tc7_stringbuf:
+ scm_i_print_stringbuf (exp, port, pstate);
+ break;
case scm_tc7_string:
- if (SCM_WRITINGP (pstate))
- {
- size_t len, i;
-
- display_character ('"', port, iconveh_question_mark);
- len = scm_i_string_length (exp);
- for (i = 0; i < len; ++i)
- write_character (scm_i_string_ref (exp, i), port, 1);
-
- display_character ('"', port, iconveh_question_mark);
- scm_remember_upto_here_1 (exp);
- }
- else
- {
- size_t len, printed;
+ {
+ size_t len, printed;
- len = scm_i_string_length (exp);
+ len = scm_i_string_length (exp);
+ if (SCM_WRITINGP (pstate))
+ {
+ printed = write_string (scm_i_string_data (exp),
+ scm_i_is_narrow_string (exp),
+ len, port,
+ PORT_CONVERSION_HANDLER (port));
+ len += 2; /* account for the quotes */
+ }
+ else
printed = display_string (scm_i_string_data (exp),
scm_i_is_narrow_string (exp),
len, port,
@@@ -1143,14 -1068,13 +1141,14 @@@ display_string (const void *str, int na
if (pti->encoding_mode == SCM_PORT_ENCODING_MODE_UTF8)
return display_string_as_utf8 (str, narrow_p, len, port);
+ else if (pti->encoding_mode == SCM_PORT_ENCODING_MODE_LATIN1)
+ return display_string_as_latin1 (str, narrow_p, len, port, strategy);
else
- return display_string_using_iconv (str, narrow_p, len,
- port, strategy);
+ return display_string_using_iconv (str, narrow_p, len, port, strategy);
}
- /* Attempt to display CH to PORT according to STRATEGY. Return non-zero
- if CH was successfully displayed, zero otherwise (e.g., if it was not
+ /* Attempt to display CH to PORT according to STRATEGY. Return one if
+ CH was successfully displayed, zero otherwise (e.g., if it was not
representable in PORT's encoding.) */
static int
display_character (scm_t_wchar ch, SCM port,
- [Guile-commits] 03/19: Add allocate-struct, struct-ref, struct-set! instructions, (continued)
- [Guile-commits] 03/19: Add allocate-struct, struct-ref, struct-set! instructions, Andy Wingo, 2015/01/22
- [Guile-commits] 06/19: Merge commit 'fdd319e9bd4121d844662d3d8ccc69b462b60840', Andy Wingo, 2015/01/22
- [Guile-commits] 07/19: Merge commit '81d2c84674f03f9028f26474ab19d3d3f353881a', Andy Wingo, 2015/01/22
- [Guile-commits] 04/19: Keywords have a tc7, Andy Wingo, 2015/01/22
- [Guile-commits] 09/19: Merge commit '5fac1a7ada362d78f13143acbc0ceca7f2f101de', Andy Wingo, 2015/01/22
- [Guile-commits] 08/19: Merge commit '8cf2a7ba7432d68b9a055d29f18117be70375af9', Andy Wingo, 2015/01/22
- [Guile-commits] 10/19: Merge commit '7c433cbbce83bc9f2f9967afba00bbb68e312657', Andy Wingo, 2015/01/22
- [Guile-commits] 11/19: Merge commit '47ca15c7dffd14a82e75c1a0aeeaf2e77f3fa5b4', Andy Wingo, 2015/01/22
- [Guile-commits] 13/19: Merge commit 'cdcba5b2f6270de808e51b3b933374170611b91d', Andy Wingo, 2015/01/22
- [Guile-commits] 14/19: Merge commit '37b1453032488de582175270d1b3a1653ea81457', Andy Wingo, 2015/01/22
- [Guile-commits] 15/19: Merge commit '5943a62042432b86d757200ef595d7aebb5c9bac',
Andy Wingo <=
- [Guile-commits] 18/19: Merge commit 'ed72201a795ac1c8d6c0288b6bb710f2bd0ebd9c', Andy Wingo, 2015/01/22
- [Guile-commits] 16/19: Merge commit '894d0b894daae001495c748b3352cd79918d3789', Andy Wingo, 2015/01/22
- [Guile-commits] 17/19: Merge commit '01a301d1b606b84d986b735049e7155d2f4cd6aa', Andy Wingo, 2015/01/22
- [Guile-commits] 12/19: Merge commit '5d971db802eaa8038db17e1aa5b4c69452739744', Andy Wingo, 2015/01/22
- [Guile-commits] 19/19: Merge commit '5b7632331e7551ac202bbaba37c572b96a791c6e', Andy Wingo, 2015/01/22