diff options
| author | Eli Zaretskii | 2011-06-18 23:17:29 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2011-06-18 23:17:29 +0300 |
| commit | acb288185281f8030279fd81705bb54fa16ca84a (patch) | |
| tree | eb7d5f4c1a15e5a8e805dbc19db6d1e79d39d189 /src | |
| parent | ca3122a07a44f375ef47dcec44b88b09dc981f47 (diff) | |
| download | emacs-acb288185281f8030279fd81705bb54fa16ca84a.tar.gz emacs-acb288185281f8030279fd81705bb54fa16ca84a.zip | |
Add comments for forced L2R directions of menu bar and tool bar.
GCPRO Lisp string inside bidi.c.
Force L2R direction in buffer menu buffer.
src/xdisp.c (tool_bar_lines_needed, redisplay_tool_bar)
(display_menu_bar): Force left-to-right direction. Add a FIXME
comment for making that be controlled by a user option.
src/bidi.c (bidi_move_to_visually_next): GCPRO the Lisp string we
are iterating.
lisp/buff-menu.el (Buffer-menu-mode, list-buffers-noselect): Force
left-to-right paragraph direction.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/bidi.c | 9 | ||||
| -rw-r--r-- | src/xdisp.c | 16 |
3 files changed, 31 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2ebd593d00e..37e1e85219f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | 2011-06-18 Eli Zaretskii <eliz@gnu.org> | 1 | 2011-06-18 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | * xdisp.c (tool_bar_lines_needed, redisplay_tool_bar) | ||
| 4 | (display_menu_bar): Force left-to-right direction. Add a FIXME | ||
| 5 | comment for making that be controlled by a user option. | ||
| 6 | |||
| 7 | * bidi.c (bidi_move_to_visually_next): GCPRO the Lisp string we | ||
| 8 | are iterating. | ||
| 9 | |||
| 3 | * term.c (produce_glyphs): Add IT_GLYPHLESS to the values of | 10 | * term.c (produce_glyphs): Add IT_GLYPHLESS to the values of |
| 4 | it->what accepted by the xassert. Fixes a gratuitous crash in an | 11 | it->what accepted by the xassert. Fixes a gratuitous crash in an |
| 5 | Emacs built with -DXASSERTS. | 12 | Emacs built with -DXASSERTS. |
diff --git a/src/bidi.c b/src/bidi.c index ac01f65bf4e..61de1fc7b5f 100644 --- a/src/bidi.c +++ b/src/bidi.c | |||
| @@ -1927,6 +1927,7 @@ bidi_move_to_visually_next (struct bidi_it *bidi_it) | |||
| 1927 | { | 1927 | { |
| 1928 | int old_level, new_level, next_level; | 1928 | int old_level, new_level, next_level; |
| 1929 | struct bidi_it sentinel; | 1929 | struct bidi_it sentinel; |
| 1930 | struct gcpro gcpro1; | ||
| 1930 | 1931 | ||
| 1931 | if (bidi_it->charpos < 0 || bidi_it->bytepos < 0) | 1932 | if (bidi_it->charpos < 0 || bidi_it->bytepos < 0) |
| 1932 | abort (); | 1933 | abort (); |
| @@ -1936,6 +1937,11 @@ bidi_move_to_visually_next (struct bidi_it *bidi_it) | |||
| 1936 | bidi_it->scan_dir = 1; /* default to logical order */ | 1937 | bidi_it->scan_dir = 1; /* default to logical order */ |
| 1937 | } | 1938 | } |
| 1938 | 1939 | ||
| 1940 | /* The code below can call eval, and thus cause GC. If we are | ||
| 1941 | iterating a Lisp string, make sure it won't GCed. */ | ||
| 1942 | if (STRINGP (bidi_it->string.lstring)) | ||
| 1943 | GCPRO1 (bidi_it->string.lstring); | ||
| 1944 | |||
| 1939 | /* If we just passed a newline, initialize for the next line. */ | 1945 | /* If we just passed a newline, initialize for the next line. */ |
| 1940 | if (!bidi_it->first_elt && bidi_it->orig_type == NEUTRAL_B) | 1946 | if (!bidi_it->first_elt && bidi_it->orig_type == NEUTRAL_B) |
| 1941 | bidi_line_init (bidi_it); | 1947 | bidi_line_init (bidi_it); |
| @@ -2061,6 +2067,9 @@ bidi_move_to_visually_next (struct bidi_it *bidi_it) | |||
| 2061 | else | 2067 | else |
| 2062 | bidi_cache_iterator_state (bidi_it, 1); | 2068 | bidi_cache_iterator_state (bidi_it, 1); |
| 2063 | } | 2069 | } |
| 2070 | |||
| 2071 | if (STRINGP (bidi_it->string.lstring)) | ||
| 2072 | UNGCPRO; | ||
| 2064 | } | 2073 | } |
| 2065 | 2074 | ||
| 2066 | /* This is meant to be called from within the debugger, whenever you | 2075 | /* This is meant to be called from within the debugger, whenever you |
diff --git a/src/xdisp.c b/src/xdisp.c index 7aafab4f32c..74afa80ada7 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -10796,7 +10796,7 @@ display_tool_bar_line (struct it *it, int height) | |||
| 10796 | ++i; | 10796 | ++i; |
| 10797 | } | 10797 | } |
| 10798 | 10798 | ||
| 10799 | /* Stop at line ends. */ | 10799 | /* Stop at line end. */ |
| 10800 | if (ITERATOR_AT_END_OF_LINE_P (it)) | 10800 | if (ITERATOR_AT_END_OF_LINE_P (it)) |
| 10801 | break; | 10801 | break; |
| 10802 | 10802 | ||
| @@ -10879,6 +10879,7 @@ tool_bar_lines_needed (struct frame *f, int *n_rows) | |||
| 10879 | it.first_visible_x = 0; | 10879 | it.first_visible_x = 0; |
| 10880 | it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f); | 10880 | it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f); |
| 10881 | reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); | 10881 | reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); |
| 10882 | it.paragraph_embedding = L2R; | ||
| 10882 | 10883 | ||
| 10883 | while (!ITERATOR_AT_END_P (&it)) | 10884 | while (!ITERATOR_AT_END_P (&it)) |
| 10884 | { | 10885 | { |
| @@ -10961,6 +10962,14 @@ redisplay_tool_bar (struct frame *f) | |||
| 10961 | /* Build a string that represents the contents of the tool-bar. */ | 10962 | /* Build a string that represents the contents of the tool-bar. */ |
| 10962 | build_desired_tool_bar_string (f); | 10963 | build_desired_tool_bar_string (f); |
| 10963 | reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); | 10964 | reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); |
| 10965 | /* FIXME: This should be controlled by a user option. But it | ||
| 10966 | doesn't make sense to have an R2L tool bar if the menu bar cannot | ||
| 10967 | be drawn also R2L, and making the menu bar R2L is tricky due to | ||
| 10968 | unibyte strings it uses and toolkit-specific code that implements | ||
| 10969 | it. If an R2L tool bar is ever supported, display_tool_bar_line | ||
| 10970 | should also be augmented to call unproduce_glyphs like | ||
| 10971 | display_line and display_string do. */ | ||
| 10972 | it.paragraph_embedding = L2R; | ||
| 10964 | 10973 | ||
| 10965 | if (f->n_tool_bar_rows == 0) | 10974 | if (f->n_tool_bar_rows == 0) |
| 10966 | { | 10975 | { |
| @@ -18656,6 +18665,11 @@ display_menu_bar (struct window *w) | |||
| 18656 | } | 18665 | } |
| 18657 | #endif /* not USE_X_TOOLKIT */ | 18666 | #endif /* not USE_X_TOOLKIT */ |
| 18658 | 18667 | ||
| 18668 | /* FIXME: This should be controlled by a user option. See the | ||
| 18669 | comments in redisplay_tool_bar and display_mode_line about | ||
| 18670 | this. */ | ||
| 18671 | it.paragraph_embedding = L2R; | ||
| 18672 | |||
| 18659 | if (! mode_line_inverse_video) | 18673 | if (! mode_line_inverse_video) |
| 18660 | /* Force the menu-bar to be displayed in the default face. */ | 18674 | /* Force the menu-bar to be displayed in the default face. */ |
| 18661 | it.base_face_id = it.face_id = DEFAULT_FACE_ID; | 18675 | it.base_face_id = it.face_id = DEFAULT_FACE_ID; |