diff options
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 |