aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1998-02-12 05:18:59 +0000
committerRichard M. Stallman1998-02-12 05:18:59 +0000
commit1134b8547c41ce376bba631ddf644bf7d142e59b (patch)
tree7428bfcb76496815cd23a9b526a55662ad47d03f /src
parentbfaef6dca8d60fd79cc546a78571876610008185 (diff)
downloademacs-1134b8547c41ce376bba631ddf644bf7d142e59b.tar.gz
emacs-1134b8547c41ce376bba631ddf644bf7d142e59b.zip
(printchar): When outputting to echo area,
update message_enable_multibyte, and convert previous text from unibyte to multibyte if necessary.
Diffstat (limited to 'src')
-rw-r--r--src/print.c19
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)
384 } 384 }
385 385
386 message_dolog (str, len, 0, len > 1); 386 message_dolog (str, len, 0, len > 1);
387
388 /* Convert message to multibyte if we are now adding multibyte text. */
389 if (! NILP (current_buffer->enable_multibyte_characters)
390 && ! message_enable_multibyte
391 && printbufidx > 0)
392 {
393 int size = count_size_as_multibyte (FRAME_MESSAGE_BUF (mini_frame),
394 printbufidx);
395 unsigned char *tembuf = (unsigned char *) alloca (size + 1);
396 copy_text (FRAME_MESSAGE_BUF (mini_frame), tembuf, printbufidx,
397 0, 1);
398 printbufidx = size;
399 if (printbufidx > FRAME_MESSAGE_BUF_SIZE (mini_frame))
400 printbufidx = FRAME_MESSAGE_BUF_SIZE (mini_frame);
401 bcopy (tembuf, FRAME_MESSAGE_BUF (mini_frame), printbufidx);
402 }
403 message_enable_multibyte
404 = ! NILP (current_buffer->enable_multibyte_characters);
405
387 if (printbufidx < FRAME_MESSAGE_BUF_SIZE (mini_frame) - len) 406 if (printbufidx < FRAME_MESSAGE_BUF_SIZE (mini_frame) - len)
388 bcopy (str, &FRAME_MESSAGE_BUF (mini_frame)[printbufidx], len), 407 bcopy (str, &FRAME_MESSAGE_BUF (mini_frame)[printbufidx], len),
389 printbufidx += len; 408 printbufidx += len;