1 2009-10-05 Eli Zaretskii <eliz@gnu.org>
3 * buffer.h (struct buffer): New member paragraph_direction.
4 * buffer.c (init_buffer_once): Initialize it.
5 (syms_of_buffer): Declare Lisp variables
6 default-paragraph-direction and paragraph-direction.
8 * dispextern.h (struct it): New member paragraph_embedding.
9 * xdisp.c (init_iterator): Initialize it from the buffer's value
10 of paragraph-direction.
11 <Qright_to_left, Qleft_to_right>: New variables.
12 (syms_of_xdisp): Initialize and staticpro them.
13 (set_iterator_to_next, next_element_from_buffer): Use the value of
14 paragraph_embedding to determine the paragraph direction.
16 * bidi.c (bidi_line_init): Fix second argument to
18 (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
19 (bidi_get_next_char_visually): Record the last character of the
20 separator in separator_limit, not the character after that.
21 (bidi_find_paragraph_start): Accept character and byte positions
22 instead of the whole iterator stricture. All callers changed.
24 2009-10-04 Eli Zaretskii <eliz@gnu.org>
26 * bidi.c (bidi_at_paragraph_end): Check for paragraph-start if
27 paragraph-separate failed to match. Return the length of the
29 (bidi_line_init): New function.
30 (bidi_paragraph_init): Use bidi_line_init. Do nothing if in the
31 middle of a paragraph-separate sequence. Don't override existing
32 paragraph direction if no strong characters found in this
33 paragraph. Set separator_limit according to what
34 bidi_at_paragraph_end returns. Reset new_paragraph flag when a
35 new paragraph is found.
36 (bidi_init_it): Reset separator_limit.
38 * dispextern.h (struct bidi_it): New member separator_limit.
40 * bidi.c (bidi_find_paragraph_start): Return the byte position of
41 the paragraph beginning.
43 * xdisp.c (set_iterator_to_next): Call bidi_paragraph_init if the
44 new_paragraph flag is set in the bidi iterator.
46 * bidi.c (bidi_at_paragraph_end, bidi_find_paragraph_start): Use
47 the buffer-local value of paragraph-start and paragraph-separate.
49 2009-10-03 Eli Zaretskii <eliz@gnu.org>
51 * bidi.c (bidi_set_paragraph_end): Don't set the new_paragraph
53 (bidi_init_it): Set the new_paragraph flag.
54 (bidi_at_paragraph_end): Arguments are now character and byte
55 position of the next character. All callers changed.
56 (bidi_resolve_explicit): Don't call bidi_at_paragraph_end, and
57 don't behave as if at paragraph end if it returns true.
58 (bidi_get_next_char_visually): Don't call bidi_paragraph_init if
59 new_paragraph flags is set. Set new_paragraph flag when at end of
61 <fallback_paragraph_start_re, fallback_paragraph_separate_re>: New
63 <Qparagraph_start, Qparagraph_separate>: New variables.
64 (bidi_initialize): Initialize and staticpro them.
66 * dispextern.h <struct bidi_it>: New element paragraph_dir. Make
67 positional elements EMACS_INT.
69 * bidi.c <bidi_overriding_paragraph_direction>: Delete.
71 2009-09-28 Eli Zaretskii <eliz@gnu.org>
73 * bidi.c (bidi_init_it): Initialize charpos, bytepos, and
74 first_elt before calling bidi_set_paragraph_end.
75 (bidi_resolve_explicit): Don't call bidi_set_paragraph_end at
77 (bidi_at_paragraph_end): Don't set new_paragraph flag at EOB.
78 (bidi_get_type): Accept an additional argument OVERRIDE, per UAX#9
79 "Explicit Overrides". All callers changed.
81 2009-09-27 Eli Zaretskii <eliz@gnu.org>
83 * xdisp.c (next_element_from_buffer): If called not at line
84 beginning, start bidi iteration from line beginning.
86 * bidi.c (bidi_paragraph_init): Use
87 bidi_overriding_paragraph_direction instead of a literal zero.
88 (bidi_initialize): Fix some character types, per Unicode 5.x.
89 (bidi_get_type): Abort if called with invalid character code.
91 * dispextern.h: Add prototype of bidi_mirror_char.
93 * xdisp.c (get_next_display_element): Mirror characters whose
94 resolved type is STRONG_R.
96 2009-09-26 Eli Zaretskii <eliz@gnu.org>
98 * bidi.c (bidi_paragraph_init): Don't set bidi_it->ch_len. Abort
99 if called not at beginning of a new paragraph.
100 (bidi_get_next_char_visually): Prepare and use a sentinel iterator
101 state when first_elt flag is set.
103 * dispextern.h (struct bidi_it): New struct member first_elt.
105 * bidi.c (bidi_init_it): Initialize bidi_it->first_elt.
106 (bidi_copy_it): Don't copy the first_elt flag.
108 * xdisp.c (reseat_1): Initialize bidi_it.first_elt. Move bidi
109 scan start code from here...
110 (next_element_from_buffer): ...to here. Use bidi_it.first_elt
113 2009-09-20 Eli Zaretskii <eliz@gnu.org>
115 * xdisp.c (reseat_1): Handle position < BEGV.
117 * bidi.c (bidi_paragraph_init): Set bidi_it->ch_len. Handle ZV.
118 (bidi_init_it): Don't initialize bidi_it->ch_len.
119 (bidi_resolve_explicit_1): Abort if bidi_it->ch_len was not
121 (bidi_at_paragraph_end, bidi_resolve_explicit_1)
122 (bidi_resolve_weak, bidi_level_of_next_char): Handle bytepos at
124 (bidi_resolve_explicit_1): Handle position < BEGV.
126 2009-09-19 Eli Zaretskii <eliz@gnu.org>
128 * xdisp.c (init_iterator): Call bidi_init_it. Set
129 bidi_it->bytepos if buffer position specified.
130 (reseat_1): Don't call bidi_init_it. Call bidi_paragraph_init
131 instead. Move back to preceding character before the call to
132 bidi_get_next_char_visually.
134 * bidi.c: Remove all STANDALONE parts.
135 (bidi_init_it): Init bidi_it->charpos and bidi_it->bytepos to -1.
136 Don't call bidi_paragraph_init. Change arguments.
137 (bidi_paragraph_init): Remove code for negative pos.
139 * dispextern.h <bidi_it>: Rename orig_type to type_after_w1 and
140 pristine_type to orig_type.
142 2009-09-12 Eli Zaretskii <eliz@gnu.org>
144 * dispnew.c (direct_output_for_insert): Give up if we are
145 reordering bidirectional text.
147 * dispextern.h (IT_STACK_SIZE): Enlarge to 5.
149 * xdisp.c (display_line): Set row->end and it->start for the next
150 row to the next character in logical order. If we are reordering
151 bidi text, push and pop the iterator before and after momentarily
152 iterating in logical order.
154 2009-09-11 Eli Zaretskii <eliz@gnu.org>
156 Note: The following changes were undone on 2009-09-12.
158 * xdisp.c (set_iterator_to_next, reseat, reseat_1)
159 (reseat_at_next_visible_line_start): Accept additional argument
160 force_logical_p; all callers changed. If force_logical_p is
161 non-zero, force iteration in buffer's logical order even in bidi
164 * dispnew.c (direct_output_for_insert): Call set_iterator_to_next
165 with additional argument zero.
167 * dispextern.h (set_iterator_to_next): Now accepts an additional
170 2009-08-29 Eli Zaretskii <eliz@gnu.org>
172 * xdisp.c (set_cursor_from_row): Don't assume glyph->charpos
174 (try_window_reusing_current_matrix): Don't assume glyph->charpos
177 2009-08-28 Eli Zaretskii <eliz@gnu.org>
179 * bidi.c <bidi_overriding_paragraph_direction>: Default to L2R,
182 2009-08-22 Eli Zaretskii <eliz@gnu.org>
184 * bidi.c (bidi_initialize): staticpro bidi_char_table.
185 (bidi_check_type): New function.
186 (bidi_cache_iterator_state, bidi_remember_char)
187 (bidi_resolve_explicit_1, bidi_resolve_explicit)
188 (bidi_resolve_weak, bidi_resolve_neutral)
189 (bidi_level_of_next_char): Use it to validate the bidi type
190 assigned to the iterator.
192 2009-08-15 Eli Zaretskii <eliz@gnu.org>
194 * bidi.c (bidi_initialize): Fix initialization of bidi_type_table.
196 * xdisp.c (set_iterator_to_next): Fix position setting after call
197 to bidi_get_next_char_visually.
199 2005-12-03 Eli Zaretskii <eliz@gnu.org>
201 * bidi.c: Include stdio.h unconditionally. Fix and elaborate
202 commentary. Add Copyright blurb.
204 2004-03-08 Kenichi Handa <handa@m17n.org>
206 * xdisp.c (reseat_1): Call bidi_init_it with a previous position.
208 * bidi.c (bidi_init_it): Set bidi_it->ch_len even if POS > 0.
210 2004-03-04 Kenichi Handa <handa@m17n.org>
212 The following changes are to support bidirectional text display.
214 * Makefile.in (obj): Include bidi.o.
215 (bidi.o): New target.
219 * buffer.h (struct buffer): New member bidi_display_reordering.
221 * buffer.c (init_buffer_once): Initialize bidi_display_reordering.
222 (syms_of_buffer): Declarations of Lisp variables
223 default-bidi-display-reordering and bidi-display-reordering.
225 * dispextern.h (BIDI_MAXLEVEL): New macro.
226 (bidi_type_t, bidi_dir_t): New types.
227 (bidi_saved_info, bidi_stack, bidi_it): New structs.
228 (struct it): New members bidi_p and bidi_it.
229 (bidi_init_it): Extern it.
230 (bidi_get_next_char_visually): Extern it.
232 * dispnew.c (direct_output_forward_char): Give up if we need bidi
233 processing or buffer's direction is right-to-left.
235 * xdisp.c (init_iterator): Initialize it->bidi_p.
236 (reseat_1): Cal bidi_init_it and bidi_get_next_char_visually if
238 (set_iterator_to_next): Cal bidi_get_next_char_visually if
244 ;; add-log-time-zone-rule: t
247 Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
249 This file is part of GNU Emacs.
251 GNU Emacs is free software: you can redistribute it and/or modify
252 it under the terms of the GNU General Public License as published by
253 the Free Software Foundation, either version 3 of the License, or
254 (at your option) any later version.
256 GNU Emacs is distributed in the hope that it will be useful,
257 but WITHOUT ANY WARRANTY; without even the implied warranty of
258 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
259 GNU General Public License for more details.
261 You should have received a copy of the GNU General Public License
262 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.