Commit 9a4d01d8 authored by Kenichi Handa's avatar Kenichi Handa
Browse files

(printchar): Fix previous change.

parent 51c6067d
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment