diff options
author | Eli Zaretskii <eliz@gnu.org> | 2019-09-13 10:47:28 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2019-09-13 10:47:28 +0300 |
commit | 5940ac63300c71b983b173c99c718920c179cbf8 (patch) | |
tree | b6b6e715885d10200623359603a7e3615009a5d0 /src | |
parent | a4c471c98474a249948793aad386e4efc64a1c96 (diff) | |
download | emacs-5940ac63300c71b983b173c99c718920c179cbf8.tar.gz |
Fix assertion violations due to non-ASCII text in menus
* src/xdisp.c (tool_bar_height, redisplay_tool_bar)
(display_menu_bar): If the Lisp string to be displayed in the
menu-bar or tool-bar window is multibyte, tell the display
engine to treat it as multibyte, instead of relying on the
initial determination by init_iterator (which is based on the
multibyteness of the current buffer). (Bug#37385)
Diffstat (limited to 'src')
-rw-r--r-- | src/xdisp.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 94f969f37cf..6626fbcf63e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -12907,7 +12907,8 @@ tool_bar_height (struct frame *f, int *n_rows, bool pixelwise) temp_row->reversed_p = false; it.first_visible_x = 0; it.last_visible_x = WINDOW_PIXEL_WIDTH (w); - reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); + reseat_to_string (&it, NULL, f->desired_tool_bar_string, + 0, 0, 0, STRING_MULTIBYTE (f->desired_tool_bar_string)); it.paragraph_embedding = L2R; while (!ITERATOR_AT_END_P (&it)) @@ -12994,7 +12995,8 @@ redisplay_tool_bar (struct frame *f) /* Build a string that represents the contents of the tool-bar. */ build_desired_tool_bar_string (f); - reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); + reseat_to_string (&it, NULL, f->desired_tool_bar_string, + 0, 0, 0, STRING_MULTIBYTE (f->desired_tool_bar_string)); /* FIXME: This should be controlled by a user option. But it doesn't make sense to have an R2L tool bar if the menu bar cannot be drawn also R2L, and making the menu bar R2L is tricky due @@ -23531,7 +23533,7 @@ display_menu_bar (struct window *w) /* Display the item, pad with one space. */ if (it.current_x < it.last_visible_x) display_string (NULL, string, Qnil, 0, 0, &it, - SCHARS (string) + 1, 0, 0, -1); + SCHARS (string) + 1, 0, 0, STRING_MULTIBYTE (string)); } /* Fill out the line with spaces. */ |