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.
+2011-06-18 Eli Zaretskii <eliz@gnu.org>
+
+ * buff-menu.el (Buffer-menu-mode, list-buffers-noselect): Force
+ left-to-right paragraph direction.
+
2011-05-10 Glenn Morris <rgm@gnu.org>
Stefan Monnier <monnier@iro.umontreal.ca>
(set (make-local-variable 'buffer-stale-function)
(lambda (&optional _noconfirm) 'fast))
(setq truncate-lines t)
- (setq buffer-read-only t))
+ (setq buffer-read-only t)
+ ;; Force L2R direction, to avoid messing the display if the first
+ ;; buffer in the list happens to begin with a string R2L character.
+ (setq bidi-paragraph-direction 'left-to-right))
(define-obsolete-variable-alias 'buffer-menu-mode-hook
'Buffer-menu-mode-hook "23.1")
(setq buffer-read-only nil)
(erase-buffer)
(setq standard-output (current-buffer))
+ ;; Force L2R direction, to avoid messing the display if the
+ ;; first buffer in the list happens to begin with a string R2L
+ ;; character.
+ (setq bidi-paragraph-direction 'left-to-right)
(unless Buffer-menu-use-header-line
;; Use U+2014 (EM DASH) to underline if possible, else use ASCII
;; (i.e. U+002D, HYPHEN-MINUS).
2011-06-18 Eli Zaretskii <eliz@gnu.org>
+ * 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.
+
+ * bidi.c (bidi_move_to_visually_next): GCPRO the Lisp string we
+ are iterating.
+
* term.c (produce_glyphs): Add IT_GLYPHLESS to the values of
it->what accepted by the xassert. Fixes a gratuitous crash in an
Emacs built with -DXASSERTS.
{
int old_level, new_level, next_level;
struct bidi_it sentinel;
+ struct gcpro gcpro1;
if (bidi_it->charpos < 0 || bidi_it->bytepos < 0)
abort ();
bidi_it->scan_dir = 1; /* default to logical order */
}
+ /* The code below can call eval, and thus cause GC. If we are
+ iterating a Lisp string, make sure it won't GCed. */
+ if (STRINGP (bidi_it->string.lstring))
+ GCPRO1 (bidi_it->string.lstring);
+
/* If we just passed a newline, initialize for the next line. */
if (!bidi_it->first_elt && bidi_it->orig_type == NEUTRAL_B)
bidi_line_init (bidi_it);
else
bidi_cache_iterator_state (bidi_it, 1);
}
+
+ if (STRINGP (bidi_it->string.lstring))
+ UNGCPRO;
}
/* This is meant to be called from within the debugger, whenever you
++i;
}
- /* Stop at line ends. */
+ /* Stop at line end. */
if (ITERATOR_AT_END_OF_LINE_P (it))
break;
it.first_visible_x = 0;
it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f);
reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1);
+ it.paragraph_embedding = L2R;
while (!ITERATOR_AT_END_P (&it))
{
/* 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);
+ /* 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 to
+ unibyte strings it uses and toolkit-specific code that implements
+ it. If an R2L tool bar is ever supported, display_tool_bar_line
+ should also be augmented to call unproduce_glyphs like
+ display_line and display_string do. */
+ it.paragraph_embedding = L2R;
if (f->n_tool_bar_rows == 0)
{
}
#endif /* not USE_X_TOOLKIT */
+ /* FIXME: This should be controlled by a user option. See the
+ comments in redisplay_tool_bar and display_mode_line about
+ this. */
+ it.paragraph_embedding = L2R;
+
if (! mode_line_inverse_video)
/* Force the menu-bar to be displayed in the default face. */
it.base_face_id = it.face_id = DEFAULT_FACE_ID;