aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa1998-12-15 04:35:38 +0000
committerKenichi Handa1998-12-15 04:35:38 +0000
commit02a08df0ab3cfbbba735993bd1bb94d02b1fd827 (patch)
treebc1ef9aa1b254ed1a4d1a2fcae48d403bfb2a45c /src
parentde7fbd0989386dc9de4feff5f0d87d078c5ae581 (diff)
downloademacs-02a08df0ab3cfbbba735993bd1bb94d02b1fd827.tar.gz
emacs-02a08df0ab3cfbbba735993bd1bb94d02b1fd827.zip
(printchar): When outputting a multibyte character to
echo area, always set message_enable_multibyte to 1.
Diffstat (limited to 'src')
-rw-r--r--src/print.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/src/print.c b/src/print.c
index 3723c79b6dd..b8be2771944 100644
--- a/src/print.c
+++ b/src/print.c
@@ -417,23 +417,29 @@ printchar (ch, fun)
417 417
418 /* Convert message to multibyte if we are now adding multibyte text. */ 418 /* Convert message to multibyte if we are now adding multibyte text. */
419 if (! NILP (current_buffer->enable_multibyte_characters) 419 if (! NILP (current_buffer->enable_multibyte_characters)
420 && ! message_enable_multibyte 420 && len > 1
421 && printbufidx > 0) 421 && ! message_enable_multibyte)
422 { 422 {
423 int size = count_size_as_multibyte (FRAME_MESSAGE_BUF (mini_frame), 423 /* If we have already had some message text in the messsage
424 printbufidx); 424 buffer, we must convert it to multibyte. */
425 unsigned char *tembuf = (unsigned char *) alloca (size + 1); 425 if (printbufidx > 0)
426 copy_text (FRAME_MESSAGE_BUF (mini_frame), tembuf, printbufidx,
427 0, 1);
428 printbufidx = size;
429 if (printbufidx > FRAME_MESSAGE_BUF_SIZE (mini_frame))
430 { 426 {
431 printbufidx = FRAME_MESSAGE_BUF_SIZE (mini_frame); 427 int size
432 /* Rewind incomplete multi-byte form. */ 428 = count_size_as_multibyte (FRAME_MESSAGE_BUF (mini_frame),
433 while (printbufidx > 0 && tembuf[printbufidx] >= 0xA0) 429 printbufidx);
434 printbufidx--; 430 unsigned char *tembuf = (unsigned char *) alloca (size + 1);
431 copy_text (FRAME_MESSAGE_BUF (mini_frame), tembuf, printbufidx,
432 0, 1);
433 printbufidx = size;
434 if (printbufidx > FRAME_MESSAGE_BUF_SIZE (mini_frame))
435 {
436 printbufidx = FRAME_MESSAGE_BUF_SIZE (mini_frame);
437 /* Rewind incomplete multi-byte form. */
438 while (printbufidx > 0 && tembuf[printbufidx] >= 0xA0)
439 printbufidx--;
440 }
441 bcopy (tembuf, FRAME_MESSAGE_BUF (mini_frame), printbufidx);
435 } 442 }
436 bcopy (tembuf, FRAME_MESSAGE_BUF (mini_frame), printbufidx);
437 message_enable_multibyte = 1; 443 message_enable_multibyte = 1;
438 } 444 }
439 445