diff options
author | Kenichi Handa <handa@m17n.org> | 1998-12-22 06:06:48 +0000 |
---|---|---|
committer | Kenichi Handa <handa@m17n.org> | 1998-12-22 06:06:48 +0000 |
commit | 9a4d01d85c90edb9b0e6360a34558b0ae1d6e21b (patch) | |
tree | 880bf9dab2a191860af8495c7287b2bb0ed66cd0 /src/print.c | |
parent | 51c6067d9b84d32e0ef3b572600c0c9576f497d7 (diff) | |
download | emacs-9a4d01d85c90edb9b0e6360a34558b0ae1d6e21b.tar.gz |
(printchar): Fix previous change.
Diffstat (limited to 'src/print.c')
-rw-r--r-- | src/print.c | 54 |
1 files changed, 34 insertions, 20 deletions
diff --git a/src/print.c b/src/print.c index 9b24f989830..7087096fb20 100644 --- a/src/print.c +++ b/src/print.c @@ -413,34 +413,48 @@ printchar (ch, fun) } } + if (len == 1 + && ! NILP (current_buffer->enable_multibyte_characters) + && ! CHAR_HEAD_P (*str)) + { + /* Convert the unibyte character to multibyte. */ + unsigned char c = *str; + + len = count_size_as_multibyte (&c, 1); + copy_text (&c, work, 1, 0, 1); + str = work; + } + message_dolog (str, len, 0, len > 1); - /* Convert message to multibyte if we are now adding multibyte text. */ if (! NILP (current_buffer->enable_multibyte_characters) - && ! message_enable_multibyte - && printbufidx > 0) + && ! message_enable_multibyte) { - int size = count_size_as_multibyte (FRAME_MESSAGE_BUF (mini_frame), - printbufidx); - unsigned char *tembuf = (unsigned char *) alloca (size + 1); - copy_text (FRAME_MESSAGE_BUF (mini_frame), tembuf, printbufidx, - 0, 1); - printbufidx = size; - if (printbufidx > FRAME_MESSAGE_BUF_SIZE (mini_frame)) + /* Record that the message buffer is multibyte. */ + message_enable_multibyte = 1; + + /* If we have already had some message text in the messsage + buffer, we convert it to multibyte. */ + if (printbufidx > 0) { - printbufidx = FRAME_MESSAGE_BUF_SIZE (mini_frame); - /* Rewind incomplete multi-byte form. */ - while (printbufidx > 0 && tembuf[printbufidx] >= 0xA0) - printbufidx--; + int size + = count_size_as_multibyte (FRAME_MESSAGE_BUF (mini_frame), + printbufidx); + unsigned char *tembuf = (unsigned char *) alloca (size + 1); + copy_text (FRAME_MESSAGE_BUF (mini_frame), tembuf, printbufidx, + 0, 1); + printbufidx = size; + if (printbufidx > FRAME_MESSAGE_BUF_SIZE (mini_frame)) + { + printbufidx = FRAME_MESSAGE_BUF_SIZE (mini_frame); + /* Rewind incomplete multi-byte form. */ + while (printbufidx > 0 && tembuf[printbufidx] >= 0xA0) + printbufidx--; + } + bcopy (tembuf, FRAME_MESSAGE_BUF (mini_frame), printbufidx); } - bcopy (tembuf, FRAME_MESSAGE_BUF (mini_frame), printbufidx); } - /* Record whether the message buffer is multibyte. - (If at any point some multibyte characters are added, then it is.) */ - if (len > 0 && ! NILP (current_buffer->enable_multibyte_characters)) - message_enable_multibyte = 1; - if (printbufidx < FRAME_MESSAGE_BUF_SIZE (mini_frame) - len) { bcopy (str, &FRAME_MESSAGE_BUF (mini_frame)[printbufidx], len); |