diff options
| author | Richard M. Stallman | 1997-09-13 08:42:12 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-09-13 08:42:12 +0000 |
| commit | a3788d533273afd5e3cd6b0441ebf1cf1f3f2b88 (patch) | |
| tree | b98f59a74c3132d04529b3b821515ebf9306008d | |
| parent | 55206ca664786969679769db6ef6d5fff07306de (diff) | |
| download | emacs-a3788d533273afd5e3cd6b0441ebf1cf1f3f2b88.tar.gz emacs-a3788d533273afd5e3cd6b0441ebf1cf1f3f2b88.zip | |
When redisplaying the echo area, use the value
of enable-multibyte-characters from when message was called.
(message_enable_multibyte): New variable.
(message2_nolog): Set the variable.
(echo_area_display): Use that variable.
(display_string): New arg MULTIBYTE. Callers changed.
(display_menu_bar): Include WINDOW_LEFT_MARGIN in maxendcol.
| -rw-r--r-- | src/xdisp.c | 50 |
1 files changed, 34 insertions, 16 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 3c3e526ead5..26eca6d258b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -213,6 +213,10 @@ int echo_area_glyphs_length; | |||
| 213 | same window currently active as a minibuffer. */ | 213 | same window currently active as a minibuffer. */ |
| 214 | Lisp_Object echo_area_window; | 214 | Lisp_Object echo_area_window; |
| 215 | 215 | ||
| 216 | /* Nonzero means multibyte characters were enabled when the echo area | ||
| 217 | message was specified. */ | ||
| 218 | int message_enable_multibyte; | ||
| 219 | |||
| 216 | /* true iff we should redraw the mode lines on the next redisplay */ | 220 | /* true iff we should redraw the mode lines on the next redisplay */ |
| 217 | int update_mode_lines; | 221 | int update_mode_lines; |
| 218 | 222 | ||
| @@ -418,6 +422,9 @@ message2_nolog (m, len) | |||
| 418 | char *m; | 422 | char *m; |
| 419 | int len; | 423 | int len; |
| 420 | { | 424 | { |
| 425 | message_enable_multibyte | ||
| 426 | = ! NILP (current_buffer->enable_multibyte_characters); | ||
| 427 | |||
| 421 | if (noninteractive) | 428 | if (noninteractive) |
| 422 | { | 429 | { |
| 423 | if (noninteractive_need_newline) | 430 | if (noninteractive_need_newline) |
| @@ -636,7 +643,8 @@ echo_area_display () | |||
| 636 | echo_area_glyphs ? echo_area_glyphs_length : -1, | 643 | echo_area_glyphs ? echo_area_glyphs_length : -1, |
| 637 | FRAME_LEFT_SCROLL_BAR_WIDTH (f), | 644 | FRAME_LEFT_SCROLL_BAR_WIDTH (f), |
| 638 | 0, 0, 0, | 645 | 0, 0, 0, |
| 639 | FRAME_WIDTH (f) + FRAME_LEFT_SCROLL_BAR_WIDTH (f)); | 646 | FRAME_WIDTH (f) + FRAME_LEFT_SCROLL_BAR_WIDTH (f), |
| 647 | message_enable_multibyte); | ||
| 640 | 648 | ||
| 641 | #if 0 /* This just gets in the way. update_frame does the job. */ | 649 | #if 0 /* This just gets in the way. update_frame does the job. */ |
| 642 | /* If desired cursor location is on this line, put it at end of text */ | 650 | /* If desired cursor location is on this line, put it at end of text */ |
| @@ -660,7 +668,8 @@ echo_area_display () | |||
| 660 | display_string (XWINDOW (mini_window), i, | 668 | display_string (XWINDOW (mini_window), i, |
| 661 | "", 0, | 669 | "", 0, |
| 662 | 0, 0, 0, | 670 | 0, 0, 0, |
| 663 | 0, FRAME_WIDTH (f) + FRAME_SCROLL_BAR_WIDTH (f)); | 671 | 0, FRAME_WIDTH (f) + FRAME_SCROLL_BAR_WIDTH (f), |
| 672 | 0); | ||
| 664 | } | 673 | } |
| 665 | } | 674 | } |
| 666 | } | 675 | } |
| @@ -1630,7 +1639,7 @@ redisplay_window (window, just_this_one, preserve_echo_area) | |||
| 1630 | get_display_line (f, vpos + i, 0); | 1639 | get_display_line (f, vpos + i, 0); |
| 1631 | display_string (w, vpos + i, "", 0, | 1640 | display_string (w, vpos + i, "", 0, |
| 1632 | FRAME_LEFT_SCROLL_BAR_WIDTH (f), | 1641 | FRAME_LEFT_SCROLL_BAR_WIDTH (f), |
| 1633 | 0, 1, 0, width); | 1642 | 0, 1, 0, width, 0); |
| 1634 | } | 1643 | } |
| 1635 | 1644 | ||
| 1636 | goto finish_scroll_bars; | 1645 | goto finish_scroll_bars; |
| @@ -2979,7 +2988,8 @@ display_text_line (w, start, vpos, hpos, taboffset, ovstr_done) | |||
| 2979 | margin, so user input can at least start | 2988 | margin, so user input can at least start |
| 2980 | on the first line. */ | 2989 | on the first line. */ |
| 2981 | (XFASTINT (w->width) > 10 | 2990 | (XFASTINT (w->width) > 10 |
| 2982 | ? XFASTINT (w->width) - 4 : -1)) | 2991 | ? XFASTINT (w->width) - 4 : -1), |
| 2992 | -1) | ||
| 2983 | - hpos - WINDOW_LEFT_MARGIN (w)); | 2993 | - hpos - WINDOW_LEFT_MARGIN (w)); |
| 2984 | hpos += minibuf_prompt_width; | 2994 | hpos += minibuf_prompt_width; |
| 2985 | taboffset -= minibuf_prompt_width - old_width; | 2995 | taboffset -= minibuf_prompt_width - old_width; |
| @@ -3750,7 +3760,7 @@ display_menu_bar (w) | |||
| 3750 | Lisp_Object items, tail; | 3760 | Lisp_Object items, tail; |
| 3751 | register int vpos = 0; | 3761 | register int vpos = 0; |
| 3752 | register FRAME_PTR f = XFRAME (WINDOW_FRAME (w)); | 3762 | register FRAME_PTR f = XFRAME (WINDOW_FRAME (w)); |
| 3753 | int maxendcol = FRAME_WIDTH (f); | 3763 | int maxendcol = FRAME_WIDTH (f) + WINDOW_LEFT_MARGIN (w); |
| 3754 | int hpos = 0; | 3764 | int hpos = 0; |
| 3755 | int i; | 3765 | int i; |
| 3756 | 3766 | ||
| @@ -3780,13 +3790,13 @@ display_menu_bar (w) | |||
| 3780 | hpos = display_string (w, vpos, | 3790 | hpos = display_string (w, vpos, |
| 3781 | XSTRING (string)->data, | 3791 | XSTRING (string)->data, |
| 3782 | XSTRING (string)->size, | 3792 | XSTRING (string)->size, |
| 3783 | hpos, 0, 0, hpos, maxendcol); | 3793 | hpos, 0, 0, hpos, maxendcol, -1); |
| 3784 | /* Put a space between items. */ | 3794 | /* Put a space between items. */ |
| 3785 | if (hpos < maxendcol) | 3795 | if (hpos < maxendcol) |
| 3786 | { | 3796 | { |
| 3787 | int hpos1 = hpos + 1; | 3797 | int hpos1 = hpos + 1; |
| 3788 | hpos = display_string (w, vpos, "", 0, hpos, 0, 0, | 3798 | hpos = display_string (w, vpos, "", 0, hpos, 0, 0, |
| 3789 | min (hpos1, maxendcol), maxendcol); | 3799 | min (hpos1, maxendcol), maxendcol, 0); |
| 3790 | } | 3800 | } |
| 3791 | } | 3801 | } |
| 3792 | 3802 | ||
| @@ -3795,7 +3805,7 @@ display_menu_bar (w) | |||
| 3795 | 3805 | ||
| 3796 | /* Fill out the line with spaces. */ | 3806 | /* Fill out the line with spaces. */ |
| 3797 | if (maxendcol > hpos) | 3807 | if (maxendcol > hpos) |
| 3798 | hpos = display_string (w, vpos, "", 0, hpos, 0, 0, maxendcol, maxendcol); | 3808 | hpos = display_string (w, vpos, "", 0, hpos, 0, 0, maxendcol, maxendcol, 0); |
| 3799 | 3809 | ||
| 3800 | /* Clear the rest of the lines allocated to the menu bar. */ | 3810 | /* Clear the rest of the lines allocated to the menu bar. */ |
| 3801 | vpos++; | 3811 | vpos++; |
| @@ -3920,7 +3930,7 @@ display_mode_element (w, vpos, hpos, depth, minendcol, maxendcol, elt) | |||
| 3920 | hpos = store_frame_title (last, hpos, min (lim, maxendcol)); | 3930 | hpos = store_frame_title (last, hpos, min (lim, maxendcol)); |
| 3921 | else | 3931 | else |
| 3922 | hpos = display_string (w, vpos, last, -1, hpos, 0, 1, | 3932 | hpos = display_string (w, vpos, last, -1, hpos, 0, 1, |
| 3923 | hpos, min (lim, maxendcol)); | 3933 | hpos, min (lim, maxendcol), -1); |
| 3924 | } | 3934 | } |
| 3925 | else /* c == '%' */ | 3935 | else /* c == '%' */ |
| 3926 | { | 3936 | { |
| @@ -3957,7 +3967,7 @@ display_mode_element (w, vpos, hpos, depth, minendcol, maxendcol, elt) | |||
| 3957 | else | 3967 | else |
| 3958 | hpos = display_string (w, vpos, spec, -1, | 3968 | hpos = display_string (w, vpos, spec, -1, |
| 3959 | hpos, 0, 1, | 3969 | hpos, 0, 1, |
| 3960 | minendcol, maxendcol); | 3970 | minendcol, maxendcol, -1); |
| 3961 | } | 3971 | } |
| 3962 | } | 3972 | } |
| 3963 | } | 3973 | } |
| @@ -3985,7 +3995,7 @@ display_mode_element (w, vpos, hpos, depth, minendcol, maxendcol, elt) | |||
| 3985 | else | 3995 | else |
| 3986 | hpos = display_string (w, vpos, XSTRING (tem)->data, | 3996 | hpos = display_string (w, vpos, XSTRING (tem)->data, |
| 3987 | XSTRING (tem)->size, | 3997 | XSTRING (tem)->size, |
| 3988 | hpos, 0, 1, minendcol, maxendcol); | 3998 | hpos, 0, 1, minendcol, maxendcol, -1); |
| 3989 | } | 3999 | } |
| 3990 | /* Give up right away for nil or t. */ | 4000 | /* Give up right away for nil or t. */ |
| 3991 | else if (!EQ (tem, elt)) | 4001 | else if (!EQ (tem, elt)) |
| @@ -4079,7 +4089,7 @@ display_mode_element (w, vpos, hpos, depth, minendcol, maxendcol, elt) | |||
| 4079 | hpos = store_frame_title ("*invalid*", minendcol, maxendcol); | 4089 | hpos = store_frame_title ("*invalid*", minendcol, maxendcol); |
| 4080 | else | 4090 | else |
| 4081 | hpos = display_string (w, vpos, "*invalid*", -1, hpos, 0, 1, | 4091 | hpos = display_string (w, vpos, "*invalid*", -1, hpos, 0, 1, |
| 4082 | minendcol, maxendcol); | 4092 | minendcol, maxendcol, 0); |
| 4083 | return hpos; | 4093 | return hpos; |
| 4084 | } | 4094 | } |
| 4085 | 4095 | ||
| @@ -4087,7 +4097,8 @@ display_mode_element (w, vpos, hpos, depth, minendcol, maxendcol, elt) | |||
| 4087 | if (frame_title_ptr) | 4097 | if (frame_title_ptr) |
| 4088 | hpos = store_frame_title ("", minendcol, maxendcol); | 4098 | hpos = store_frame_title ("", minendcol, maxendcol); |
| 4089 | else | 4099 | else |
| 4090 | hpos = display_string (w, vpos, "", 0, hpos, 0, 1, minendcol, maxendcol); | 4100 | hpos = display_string (w, vpos, "", 0, hpos, |
| 4101 | 0, 1, minendcol, maxendcol, 0); | ||
| 4091 | return hpos; | 4102 | return hpos; |
| 4092 | } | 4103 | } |
| 4093 | 4104 | ||
| @@ -4697,11 +4708,15 @@ display_count_lines (from, limit, n, pos_ptr) | |||
| 4697 | and not display anything beyond there. Otherwise, only MAXCOL | 4708 | and not display anything beyond there. Otherwise, only MAXCOL |
| 4698 | controls where to stop output. | 4709 | controls where to stop output. |
| 4699 | 4710 | ||
| 4711 | MULTIBYTE can be 0 meaning do not display multibyte chars, | ||
| 4712 | 1 meaning do display them, or -1 meaning obey the current buffer's | ||
| 4713 | value of enable_multibyte_characters. | ||
| 4714 | |||
| 4700 | Returns ending hpos. */ | 4715 | Returns ending hpos. */ |
| 4701 | 4716 | ||
| 4702 | static int | 4717 | static int |
| 4703 | display_string (w, vpos, string, length, hpos, truncate, | 4718 | display_string (w, vpos, string, length, hpos, truncate, |
| 4704 | obey_window_width, mincol, maxcol) | 4719 | obey_window_width, mincol, maxcol, multibyte) |
| 4705 | struct window *w; | 4720 | struct window *w; |
| 4706 | unsigned char *string; | 4721 | unsigned char *string; |
| 4707 | int length; | 4722 | int length; |
| @@ -4709,6 +4724,7 @@ display_string (w, vpos, string, length, hpos, truncate, | |||
| 4709 | GLYPH truncate; | 4724 | GLYPH truncate; |
| 4710 | int obey_window_width; | 4725 | int obey_window_width; |
| 4711 | int mincol, maxcol; | 4726 | int mincol, maxcol; |
| 4727 | int multibyte; | ||
| 4712 | { | 4728 | { |
| 4713 | register int c; | 4729 | register int c; |
| 4714 | int truncated; | 4730 | int truncated; |
| @@ -4721,14 +4737,16 @@ display_string (w, vpos, string, length, hpos, truncate, | |||
| 4721 | struct frame_glyphs *desired_glyphs = FRAME_DESIRED_GLYPHS (f); | 4737 | struct frame_glyphs *desired_glyphs = FRAME_DESIRED_GLYPHS (f); |
| 4722 | GLYPH *p1start = desired_glyphs->glyphs[vpos] + hpos; | 4738 | GLYPH *p1start = desired_glyphs->glyphs[vpos] + hpos; |
| 4723 | int window_width = XFASTINT (w->width); | 4739 | int window_width = XFASTINT (w->width); |
| 4724 | /* If 1, we must display multibyte characters. */ | ||
| 4725 | int multibyte = !NILP (current_buffer->enable_multibyte_characters); | ||
| 4726 | 4740 | ||
| 4727 | /* Use the standard display table, not the window's display table. | 4741 | /* Use the standard display table, not the window's display table. |
| 4728 | We don't want the mode line in rot13. */ | 4742 | We don't want the mode line in rot13. */ |
| 4729 | register struct Lisp_Char_Table *dp = 0; | 4743 | register struct Lisp_Char_Table *dp = 0; |
| 4730 | int i; | 4744 | int i; |
| 4731 | 4745 | ||
| 4746 | if (multibyte == -1) | ||
| 4747 | multibyte = !NILP (current_buffer->enable_multibyte_characters); | ||
| 4748 | /* Now multibyte is 1 if we should display multibyte characters. */ | ||
| 4749 | |||
| 4732 | if (DISP_TABLE_P (Vstandard_display_table)) | 4750 | if (DISP_TABLE_P (Vstandard_display_table)) |
| 4733 | dp = XCHAR_TABLE (Vstandard_display_table); | 4751 | dp = XCHAR_TABLE (Vstandard_display_table); |
| 4734 | 4752 | ||