diff options
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/keyboard.c | 33 |
2 files changed, 21 insertions, 16 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index c8ff93a44dc..2cffae07790 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2000-12-23 Gerd Moellmann <gerd@gnu.org> | 1 | 2000-12-23 Gerd Moellmann <gerd@gnu.org> |
| 2 | 2 | ||
| 3 | * keyboard.c (echo_prompt): Always set current_kboard->echoptr to | ||
| 4 | the end of the prompt. Set echo_after_prompt to the offset | ||
| 5 | of echoptr in echobuf. | ||
| 6 | |||
| 3 | * xdisp.c (init_from_display_pos): Pop until the iterator's | 7 | * xdisp.c (init_from_display_pos): Pop until the iterator's |
| 4 | stack is empty; there may be frames for stretch or images | 8 | stack is empty; there may be frames for stretch or images |
| 5 | on the stack. | 9 | on the stack. |
diff --git a/src/keyboard.c b/src/keyboard.c index d8fc173e7d8..d8c96c82add 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -692,36 +692,37 @@ void | |||
| 692 | echo_prompt (str) | 692 | echo_prompt (str) |
| 693 | Lisp_Object str; | 693 | Lisp_Object str; |
| 694 | { | 694 | { |
| 695 | int len = STRING_BYTES (XSTRING (str)); | 695 | int nbytes = STRING_BYTES (XSTRING (str)); |
| 696 | int multibyte_p = STRING_MULTIBYTE (str); | 696 | int multibyte_p = STRING_MULTIBYTE (str); |
| 697 | 697 | ||
| 698 | if (len > ECHOBUFSIZE - 4) | 698 | if (nbytes > ECHOBUFSIZE - 4) |
| 699 | { | 699 | { |
| 700 | if (multibyte_p) | 700 | if (multibyte_p) |
| 701 | { | 701 | { |
| 702 | unsigned char *p = XSTRING (str)->data, *lastp = p; | 702 | /* Have to find the last character that fit's into the |
| 703 | echo buffer. */ | ||
| 704 | unsigned char *p = XSTRING (str)->data; | ||
| 703 | unsigned char *pend = p + ECHOBUFSIZE - 4; | 705 | unsigned char *pend = p + ECHOBUFSIZE - 4; |
| 706 | int char_len; | ||
| 704 | 707 | ||
| 705 | while (p < pend) | 708 | do |
| 706 | { | 709 | { |
| 707 | int this_len; | 710 | PARSE_MULTIBYTE_SEQ (p, pend - p, char_len); |
| 708 | 711 | p += char_len; | |
| 709 | lastp = p; | ||
| 710 | PARSE_MULTIBYTE_SEQ (p, pend - p, this_len); | ||
| 711 | p += this_len; | ||
| 712 | } | 712 | } |
| 713 | len = lastp - XSTRING (str)->data; | 713 | while (p < pend); |
| 714 | |||
| 715 | nbytes = p - XSTRING (str)->data - char_len; | ||
| 714 | } | 716 | } |
| 715 | else | 717 | else |
| 716 | len = ECHOBUFSIZE - 4; | 718 | nbytes = ECHOBUFSIZE - 4; |
| 717 | } | 719 | } |
| 718 | 720 | ||
| 719 | current_kboard->echoptr | 721 | nbytes = copy_text (XSTRING (str)->data, current_kboard->echobuf, nbytes, |
| 720 | += copy_text (XSTRING (str)->data, current_kboard->echobuf, len, | 722 | STRING_MULTIBYTE (str), 1); |
| 721 | STRING_MULTIBYTE (str), 1); | 723 | current_kboard->echoptr = current_kboard->echobuf + nbytes; |
| 722 | *current_kboard->echoptr = '\0'; | 724 | *current_kboard->echoptr = '\0'; |
| 723 | 725 | current_kboard->echo_after_prompt = nbytes; | |
| 724 | current_kboard->echo_after_prompt = len; | ||
| 725 | 726 | ||
| 726 | echo_now (); | 727 | echo_now (); |
| 727 | } | 728 | } |