diff options
author | Ludovic Courtès <ludo@gnu.org> | 2009-09-09 22:32:02 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2009-09-09 22:39:49 +0200 |
commit | 6dc797eee9041498eec7053d32d8721c3660fb51 (patch) | |
tree | 27da6956712e6391c2209045e3ed69e027b63656 /libguile/print.c | |
parent | d66b74dce74c2824726746e82a8a413463cb80fd (diff) | |
parent | e354d7689aca1f6482bd90a2c367617222052265 (diff) | |
download | guile-6dc797eee9041498eec7053d32d8721c3660fb51.tar.gz |
Merge branch 'master' into boehm-demers-weiser-gc
Conflicts:
libguile/gc_os_dep.c
Diffstat (limited to 'libguile/print.c')
-rw-r--r-- | libguile/print.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/libguile/print.c b/libguile/print.c index 3bb6cb167..1dc97c244 100644 --- a/libguile/print.c +++ b/libguile/print.c @@ -463,13 +463,26 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate) /* Print the character if is graphic character. */ { scm_t_wchar *wbuf; - SCM wstr = scm_i_make_wide_string (1, &wbuf); + SCM wstr; char *buf; size_t len; const char *enc; enc = scm_i_get_port_encoding (port); - wbuf[0] = i; + if (uc_combining_class (i) == UC_CCC_NR) + { + wstr = scm_i_make_wide_string (1, &wbuf); + wbuf[0] = i; + } + else + { + /* Character is a combining character: print it connected + to a dotted circle instead of connecting it to the + backslash in '#\' */ + wstr = scm_i_make_wide_string (2, &wbuf); + wbuf[0] = SCM_CODEPOINT_DOTTED_CIRCLE; + wbuf[1] = i; + } if (enc == NULL) { if (i <= 0xFF) @@ -1220,8 +1233,8 @@ SCM_DEFINE (scm_write_char, "write-char", 1, 1, 0, SCM_VALIDATE_CHAR (1, chr); SCM_VALIDATE_OPORT_VALUE (2, port); - - scm_putc ((int) SCM_CHAR (chr), SCM_COERCE_OUTPORT (port)); + + scm_i_charprint (SCM_CHAR (chr), SCM_COERCE_OUTPORT (port)); #if 0 #ifdef HAVE_PIPE # ifdef EPIPE |