diff options
author | Richard M. Stallman <rms@gnu.org> | 1998-02-12 05:18:59 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1998-02-12 05:18:59 +0000 |
commit | 62b93feaeb8d2a620e62c34be9f49874b98ca531 (patch) | |
tree | c7b1793077d54e3441418abc57c85863b22e1d36 | |
parent | c59b05471804046fdd152a64acc518bd6a18fdbc (diff) | |
download | emacs-62b93feaeb8d2a620e62c34be9f49874b98ca531.tar.gz |
(printchar): When outputting to echo area,
update message_enable_multibyte, and convert previous text
from unibyte to multibyte if necessary.
-rw-r--r-- | src/print.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/print.c b/src/print.c index f4b10c49770..6760af3298f 100644 --- a/src/print.c +++ b/src/print.c @@ -384,6 +384,25 @@ printchar (ch, fun) } 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; |