Retrospective commit from 2009-10-05.
[bpt/emacs.git] / src / ChangeLog.bidi
1 2009-10-05 Eli Zaretskii <eliz@gnu.org>
2
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.
7
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.
15
16 * bidi.c (bidi_line_init): Fix second argument to
17 bidi_set_sor_type.
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.
23
24 2009-10-04 Eli Zaretskii <eliz@gnu.org>
25
26 * bidi.c (bidi_at_paragraph_end): Check for paragraph-start if
27 paragraph-separate failed to match. Return the length of the
28 matched separator.
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.
37
38 * dispextern.h (struct bidi_it): New member separator_limit.
39
40 * bidi.c (bidi_find_paragraph_start): Return the byte position of
41 the paragraph beginning.
42
43 * xdisp.c (set_iterator_to_next): Call bidi_paragraph_init if the
44 new_paragraph flag is set in the bidi iterator.
45
46 * bidi.c (bidi_at_paragraph_end, bidi_find_paragraph_start): Use
47 the buffer-local value of paragraph-start and paragraph-separate.
48
49 2009-10-03 Eli Zaretskii <eliz@gnu.org>
50
51 * bidi.c (bidi_set_paragraph_end): Don't set the new_paragraph
52 flag in the iterator.
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
60 a paragraph.
61 <fallback_paragraph_start_re, fallback_paragraph_separate_re>: New
62 variables.
63 <Qparagraph_start, Qparagraph_separate>: New variables.
64 (bidi_initialize): Initialize and staticpro them.
65
66 * dispextern.h <struct bidi_it>: New element paragraph_dir. Make
67 positional elements EMACS_INT.
68
69 * bidi.c <bidi_overriding_paragraph_direction>: Delete.
70
71 2009-09-28 Eli Zaretskii <eliz@gnu.org>
72
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
76 EOB.
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.
80
81 2009-09-27 Eli Zaretskii <eliz@gnu.org>
82
83 * xdisp.c (next_element_from_buffer): If called not at line
84 beginning, start bidi iteration from line beginning.
85
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.
90
91 * dispextern.h: Add prototype of bidi_mirror_char.
92
93 * xdisp.c (get_next_display_element): Mirror characters whose
94 resolved type is STRONG_R.
95
96 2009-09-26 Eli Zaretskii <eliz@gnu.org>
97
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.
102
103 * dispextern.h (struct bidi_it): New struct member first_elt.
104
105 * bidi.c (bidi_init_it): Initialize bidi_it->first_elt.
106 (bidi_copy_it): Don't copy the first_elt flag.
107
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
111 flag.
112
113 2009-09-20 Eli Zaretskii <eliz@gnu.org>
114
115 * xdisp.c (reseat_1): Handle position < BEGV.
116
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
120 initialized.
121 (bidi_at_paragraph_end, bidi_resolve_explicit_1)
122 (bidi_resolve_weak, bidi_level_of_next_char): Handle bytepos at
123 ZV_BYTE.
124 (bidi_resolve_explicit_1): Handle position < BEGV.
125
126 2009-09-19 Eli Zaretskii <eliz@gnu.org>
127
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.
133
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.
138
139 * dispextern.h <bidi_it>: Rename orig_type to type_after_w1 and
140 pristine_type to orig_type.
141
142 2009-09-12 Eli Zaretskii <eliz@gnu.org>
143
144 * dispnew.c (direct_output_for_insert): Give up if we are
145 reordering bidirectional text.
146
147 * dispextern.h (IT_STACK_SIZE): Enlarge to 5.
148
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.
153
154 2009-09-11 Eli Zaretskii <eliz@gnu.org>
155
156 Note: The following changes were undone on 2009-09-12.
157
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
162 buffers.
163
164 * dispnew.c (direct_output_for_insert): Call set_iterator_to_next
165 with additional argument zero.
166
167 * dispextern.h (set_iterator_to_next): Now accepts an additional
168 argument.
169
170 2009-08-29 Eli Zaretskii <eliz@gnu.org>
171
172 * xdisp.c (set_cursor_from_row): Don't assume glyph->charpos
173 increments linearly.
174 (try_window_reusing_current_matrix): Don't assume glyph->charpos
175 increments linearly.
176
177 2009-08-28 Eli Zaretskii <eliz@gnu.org>
178
179 * bidi.c <bidi_overriding_paragraph_direction>: Default to L2R,
180 for now.
181
182 2009-08-22 Eli Zaretskii <eliz@gnu.org>
183
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.
191
192 2009-08-15 Eli Zaretskii <eliz@gnu.org>
193
194 * bidi.c (bidi_initialize): Fix initialization of bidi_type_table.
195
196 * xdisp.c (set_iterator_to_next): Fix position setting after call
197 to bidi_get_next_char_visually.
198
199 2005-12-03 Eli Zaretskii <eliz@gnu.org>
200
201 * bidi.c: Include stdio.h unconditionally. Fix and elaborate
202 commentary. Add Copyright blurb.
203
204 2004-03-08 Kenichi Handa <handa@m17n.org>
205
206 * xdisp.c (reseat_1): Call bidi_init_it with a previous position.
207
208 * bidi.c (bidi_init_it): Set bidi_it->ch_len even if POS > 0.
209
210 2004-03-04 Kenichi Handa <handa@m17n.org>
211
212 The following changes are to support bidirectional text display.
213
214 * Makefile.in (obj): Include bidi.o.
215 (bidi.o): New target.
216
217 * bidi.c: New file.
218
219 * buffer.h (struct buffer): New member bidi_display_reordering.
220
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.
224
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.
231
232 * dispnew.c (direct_output_forward_char): Give up if we need bidi
233 processing or buffer's direction is right-to-left.
234
235 * xdisp.c (init_iterator): Initialize it->bidi_p.
236 (reseat_1): Cal bidi_init_it and bidi_get_next_char_visually if
237 necessary.
238 (set_iterator_to_next): Cal bidi_get_next_char_visually if
239 necessary.
240
241
242 ;; Local Variables:
243 ;; coding: utf-8
244 ;; add-log-time-zone-rule: t
245 ;; End:
246
247 Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
248
249 This file is part of GNU Emacs.
250
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.
255
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.
260
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/>.