# HG changeset patch # User Richard M. Stallman # Date 887260739 0 # Node ID 98172ad9f511eac8c309260a81a5005de4be43c2 # Parent bb0f5fde5973bbfb98ffbbee1a192ac21223a801 (printchar): When outputting to echo area, update message_enable_multibyte, and convert previous text from unibyte to multibyte if necessary. diff -r bb0f5fde5973 -r 98172ad9f511 src/print.c --- a/src/print.c Thu Feb 12 03:10:53 1998 +0000 +++ b/src/print.c Thu Feb 12 05:18:59 1998 +0000 @@ -384,6 +384,25 @@ } 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) + { + 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); + bcopy (tembuf, FRAME_MESSAGE_BUF (mini_frame), printbufidx); + } + message_enable_multibyte + = ! NILP (current_buffer->enable_multibyte_characters); + if (printbufidx < FRAME_MESSAGE_BUF_SIZE (mini_frame) - len) bcopy (str, &FRAME_MESSAGE_BUF (mini_frame)[printbufidx], len), printbufidx += len;