]> code.delx.au - gnu-emacs/blob - src/ChangeLog.bidi
Retrospective commit from 2009-1219.
[gnu-emacs] / src / ChangeLog.bidi
1 2009-12-19 Eli Zaretskii <eliz@gnu.org>
2
3 * buffer.c (Fbuffer_swap_text): Swap the values of
4 bidi_display_reordering and bidi_paragraph_direction.
5
6 * bidi.c (bidi_resolve_weak): Fix nesting of conditions for Wn
7 processing. Move W3 after W1 and W2. Simplify W4 because it is
8 now always after W1.
9
10 * .gdbinit (pbiditype): New command.
11 (pgx): Use it to display bidi level and type of the glyph.
12
13 2009-12-12 Eli Zaretskii <eliz@gnu.org>
14
15 * dispextern.h (struct it): New members prev_stop and
16 base_level_stop.
17
18 * xdisp.c (handle_stop_backwards): New function.
19 (next_element_from_buffer): Handle the situation where we
20 overstepped stop_charpos due to non-linearity of the bidi
21 iteration. Likewise for when we back up beyond the previous
22 stop_charpos.
23 (reseat_1, pop_it, push_it): Set prev_stop and base_level_stop.
24
25 * dispextern.h (BIDI_AT_BASE_LEVEL): New macro.
26
27 * bidi.c (bidi_copy_it): Fix compiler warning due to cast of a
28 pointer to `int'. Don't preserve the first_elt member, as it is
29 no longer copied, because its position in the structure was
30 changed, see below.
31
32 * dispextern.h (struct bidi_it): Move first_elt, new_paragraph,
33 separator_limit, and paragraph_dir to after bidi_stack. Add a
34 note that anything beyond the level stack is not preserved when
35 the bidi iterator state is copied/saved.
36
37 2009-11-21 Eli Zaretskii <eliz@gnu.org>
38
39 * xdisp.c (set_cursor_from_row): Fix cursor positioning on empty
40 lines when integer values of `cursor' property is used on display
41 strings.
42
43 2009-11-14 Eli Zaretskii <eliz@gnu.org>
44
45 * xdisp.c (init_iterator, text_outside_line_unchanged_p)
46 (try_window_id): Rename paragraph_direction to
47 bidi_paragraph_direction.
48 (set_cursor_from_row): Handle integer values of `cursor' property
49 on display strings.
50
51 * buffer.c (init_buffer_once, syms_of_buffer): Rename
52 paragraph_direction to bidi_paragraph_direction.
53
54 * buffer.h (struct buffer): Rename paragraph_direction to
55 bidi_paragraph_direction.
56
57 2009-11-07 Eli Zaretskii <eliz@gnu.org>
58
59 * bidi.c (bidi_paragraph_init): Don't overstep end of buffer.
60 Treat end of buffer as a NEUTRAL_B character.
61 (bidi_resolve_explicit): Don't special-case ZV when bidi_it->type
62 is NEUTRAL_B, since bidi_set_paragraph_end no longer sets the
63 new_paragraph flag.
64
65 2009-10-31 Eli Zaretskii <eliz@gnu.org>
66
67 * xdisp.c (display_line): Always extend reversed_p rows to the end
68 of line.
69 (set_cursor_from_row): In R2L rows that don't display text, put
70 the cursor on the rightmost glyph.
71
72 2009-10-24 Eli Zaretskii <eliz@gnu.org>
73
74 * xdisp.c (set_cursor_from_row): Fix off-by-one error when
75 skipping over non-character glyphs at end of a reversed row.
76
77 * dispextern.h (struct glyph): The `resolved_level' member needs
78 only 5 bits, not 6. The `bidi_type' member needs only 3 bits.
79 (bidi_type_t): Rearrange so that types that can appear in the
80 resolved type are at the beginning and have values less than 8.
81
82 2009-10-23 Eli Zaretskii <eliz@gnu.org>
83
84 * bidi.c: Include setjmp.h.
85
86 2009-10-17 Eli Zaretskii <eliz@gnu.org>
87
88 * dispextern.h (struct glyph): New members resolved_level and
89 bidi_type.
90
91 * xdisp.c (append_glyph, append_composite_glyph)
92 (produce_image_glyph, append_stretch_glyph): Set them.
93
94 * term.c (append_glyph): Ditto.
95
96 * xdisp.c (display_line, next_element_from_buffer): Set the glyph
97 row's reversed_p flag if the paragraph base direction is odd.
98 (extend_face_to_end_of_line): Don't reverse the glyphs here.
99
100 * term.c (append_glyph): Reverse glyphs here.
101
102 * bidi.c (bidi_get_next_char_visually): Don't exit early when at
103 ZV.
104 (bidi_paragraph_init): Don't step over a newline if at BEGV.
105
106 2009-10-16 Eli Zaretskii <eliz@gnu.org>
107
108 * bidi.c (bidi_paragraph_init): Handle empty buffers.
109
110 2009-10-10 Eli Zaretskii <eliz@gnu.org>
111
112 * xdisp.c (set_cursor_from_row): Skip over glyphs near end of row
113 with integer OBJECT even if their CHARPOS is zero.
114
115 * bidi.c (bidi_cache_iterator_state): Don't cache NEW_PARAGRAPH.
116 Abort if someone tries to add a cached state whose position is not
117 the immediate successor to that of the last cached state.
118 (bidi_paragraph_init): Don't bail out too early after a reseat.
119
120 2009-10-09 Eli Zaretskii <eliz@gnu.org>
121
122 * xdisp.c (text_outside_line_unchanged_p, try_window_id): Disable
123 optimizations if we are reordering bidirectional text and the
124 paragraph direction can be affected by the change.
125
126 2009-10-08 Eli Zaretskii <eliz@gnu.org>
127
128 * xdisp.c (string_buffer_position_lim): New function.
129 (string_buffer_position): Most of code moved to
130 string_buffer_position_lim. Last argument and return value are
131 now EMACS_INT; all callers changed.
132 (set_cursor_from_row): Rewritten to support bidirectional text and
133 reversed glyph rows.
134
135 dispextern.h <string_buffer_position>: Update prototype.
136
137 2009-10-07 Eli Zaretskii <eliz@gnu.org>
138
139 * bidi.c (bidi_paragraph_init): Fix initialization of POS.
140
141 * dispextern.h (struct glyph_row): New member reversed_p.
142
143 2009-10-06 Eli Zaretskii <eliz@gnu.org>
144
145 * buffer.c (syms_of_buffer): Remove DEFVAR_LISP_NOPRO for
146 default-direction-reversed, default-bidi-display-reordering, and
147 default-paragraph-direction.
148
149 2009-10-05 Eli Zaretskii <eliz@gnu.org>
150
151 * buffer.h (struct buffer): New member paragraph_direction.
152 * buffer.c (init_buffer_once): Initialize it.
153 (syms_of_buffer): Declare Lisp variables
154 default-paragraph-direction and paragraph-direction.
155
156 * dispextern.h (struct it): New member paragraph_embedding.
157 * xdisp.c (init_iterator): Initialize it from the buffer's value
158 of paragraph-direction.
159 <Qright_to_left, Qleft_to_right>: New variables.
160 (syms_of_xdisp): Initialize and staticpro them.
161 (set_iterator_to_next, next_element_from_buffer): Use the value of
162 paragraph_embedding to determine the paragraph direction.
163
164 * bidi.c (bidi_line_init): Fix second argument to
165 bidi_set_sor_type.
166 (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
167 (bidi_get_next_char_visually): Record the last character of the
168 separator in separator_limit, not the character after that.
169 (bidi_find_paragraph_start): Accept character and byte positions
170 instead of the whole iterator stricture. All callers changed.
171
172 2009-10-04 Eli Zaretskii <eliz@gnu.org>
173
174 * bidi.c (bidi_at_paragraph_end): Check for paragraph-start if
175 paragraph-separate failed to match. Return the length of the
176 matched separator.
177 (bidi_line_init): New function.
178 (bidi_paragraph_init): Use bidi_line_init. Do nothing if in the
179 middle of a paragraph-separate sequence. Don't override existing
180 paragraph direction if no strong characters found in this
181 paragraph. Set separator_limit according to what
182 bidi_at_paragraph_end returns. Reset new_paragraph flag when a
183 new paragraph is found.
184 (bidi_init_it): Reset separator_limit.
185
186 * dispextern.h (struct bidi_it): New member separator_limit.
187
188 * bidi.c (bidi_find_paragraph_start): Return the byte position of
189 the paragraph beginning.
190
191 * xdisp.c (set_iterator_to_next): Call bidi_paragraph_init if the
192 new_paragraph flag is set in the bidi iterator.
193
194 * bidi.c (bidi_at_paragraph_end, bidi_find_paragraph_start): Use
195 the buffer-local value of paragraph-start and paragraph-separate.
196
197 2009-10-03 Eli Zaretskii <eliz@gnu.org>
198
199 * bidi.c (bidi_set_paragraph_end): Don't set the new_paragraph
200 flag in the iterator.
201 (bidi_init_it): Set the new_paragraph flag.
202 (bidi_at_paragraph_end): Arguments are now character and byte
203 position of the next character. All callers changed.
204 (bidi_resolve_explicit): Don't call bidi_at_paragraph_end, and
205 don't behave as if at paragraph end if it returns true.
206 (bidi_get_next_char_visually): Don't call bidi_paragraph_init if
207 new_paragraph flags is set. Set new_paragraph flag when at end of
208 a paragraph.
209 <fallback_paragraph_start_re, fallback_paragraph_separate_re>: New
210 variables.
211 <Qparagraph_start, Qparagraph_separate>: New variables.
212 (bidi_initialize): Initialize and staticpro them.
213
214 * dispextern.h <struct bidi_it>: New element paragraph_dir. Make
215 positional elements EMACS_INT.
216
217 * bidi.c <bidi_overriding_paragraph_direction>: Delete.
218
219 2009-09-28 Eli Zaretskii <eliz@gnu.org>
220
221 * bidi.c (bidi_init_it): Initialize charpos, bytepos, and
222 first_elt before calling bidi_set_paragraph_end.
223 (bidi_resolve_explicit): Don't call bidi_set_paragraph_end at
224 EOB.
225 (bidi_at_paragraph_end): Don't set new_paragraph flag at EOB.
226 (bidi_get_type): Accept an additional argument OVERRIDE, per UAX#9
227 "Explicit Overrides". All callers changed.
228
229 2009-09-27 Eli Zaretskii <eliz@gnu.org>
230
231 * xdisp.c (next_element_from_buffer): If called not at line
232 beginning, start bidi iteration from line beginning.
233
234 * bidi.c (bidi_paragraph_init): Use
235 bidi_overriding_paragraph_direction instead of a literal zero.
236 (bidi_initialize): Fix some character types, per Unicode 5.x.
237 (bidi_get_type): Abort if called with invalid character code.
238
239 * dispextern.h: Add prototype of bidi_mirror_char.
240
241 * xdisp.c (get_next_display_element): Mirror characters whose
242 resolved type is STRONG_R.
243
244 2009-09-26 Eli Zaretskii <eliz@gnu.org>
245
246 * bidi.c (bidi_paragraph_init): Don't set bidi_it->ch_len. Abort
247 if called not at beginning of a new paragraph.
248 (bidi_get_next_char_visually): Prepare and use a sentinel iterator
249 state when first_elt flag is set.
250
251 * dispextern.h (struct bidi_it): New struct member first_elt.
252
253 * bidi.c (bidi_init_it): Initialize bidi_it->first_elt.
254 (bidi_copy_it): Don't copy the first_elt flag.
255
256 * xdisp.c (reseat_1): Initialize bidi_it.first_elt. Move bidi
257 scan start code from here...
258 (next_element_from_buffer): ...to here. Use bidi_it.first_elt
259 flag.
260
261 2009-09-20 Eli Zaretskii <eliz@gnu.org>
262
263 * xdisp.c (reseat_1): Handle position < BEGV.
264
265 * bidi.c (bidi_paragraph_init): Set bidi_it->ch_len. Handle ZV.
266 (bidi_init_it): Don't initialize bidi_it->ch_len.
267 (bidi_resolve_explicit_1): Abort if bidi_it->ch_len was not
268 initialized.
269 (bidi_at_paragraph_end, bidi_resolve_explicit_1)
270 (bidi_resolve_weak, bidi_level_of_next_char): Handle bytepos at
271 ZV_BYTE.
272 (bidi_resolve_explicit_1): Handle position < BEGV.
273
274 2009-09-19 Eli Zaretskii <eliz@gnu.org>
275
276 * xdisp.c (init_iterator): Call bidi_init_it. Set
277 bidi_it->bytepos if buffer position specified.
278 (reseat_1): Don't call bidi_init_it. Call bidi_paragraph_init
279 instead. Move back to preceding character before the call to
280 bidi_get_next_char_visually.
281
282 * bidi.c: Remove all STANDALONE parts.
283 (bidi_init_it): Init bidi_it->charpos and bidi_it->bytepos to -1.
284 Don't call bidi_paragraph_init. Change arguments.
285 (bidi_paragraph_init): Remove code for negative pos.
286
287 * dispextern.h <bidi_it>: Rename orig_type to type_after_w1 and
288 pristine_type to orig_type.
289
290 2009-09-12 Eli Zaretskii <eliz@gnu.org>
291
292 * dispnew.c (direct_output_for_insert): Give up if we are
293 reordering bidirectional text.
294
295 * dispextern.h (IT_STACK_SIZE): Enlarge to 5.
296
297 * xdisp.c (display_line): Set row->end and it->start for the next
298 row to the next character in logical order. If we are reordering
299 bidi text, push and pop the iterator before and after momentarily
300 iterating in logical order.
301
302 2009-09-11 Eli Zaretskii <eliz@gnu.org>
303
304 Note: The following changes were undone on 2009-09-12.
305
306 * xdisp.c (set_iterator_to_next, reseat, reseat_1)
307 (reseat_at_next_visible_line_start): Accept additional argument
308 force_logical_p; all callers changed. If force_logical_p is
309 non-zero, force iteration in buffer's logical order even in bidi
310 buffers.
311
312 * dispnew.c (direct_output_for_insert): Call set_iterator_to_next
313 with additional argument zero.
314
315 * dispextern.h (set_iterator_to_next): Now accepts an additional
316 argument.
317
318 2009-08-29 Eli Zaretskii <eliz@gnu.org>
319
320 * xdisp.c (set_cursor_from_row): Don't assume glyph->charpos
321 increments linearly.
322 (try_window_reusing_current_matrix): Don't assume glyph->charpos
323 increments linearly.
324
325 2009-08-28 Eli Zaretskii <eliz@gnu.org>
326
327 * bidi.c <bidi_overriding_paragraph_direction>: Default to L2R,
328 for now.
329
330 2009-08-22 Eli Zaretskii <eliz@gnu.org>
331
332 * bidi.c (bidi_initialize): staticpro bidi_char_table.
333 (bidi_check_type): New function.
334 (bidi_cache_iterator_state, bidi_remember_char)
335 (bidi_resolve_explicit_1, bidi_resolve_explicit)
336 (bidi_resolve_weak, bidi_resolve_neutral)
337 (bidi_level_of_next_char): Use it to validate the bidi type
338 assigned to the iterator.
339
340 2009-08-15 Eli Zaretskii <eliz@gnu.org>
341
342 * bidi.c (bidi_initialize): Fix initialization of bidi_type_table.
343
344 * xdisp.c (set_iterator_to_next): Fix position setting after call
345 to bidi_get_next_char_visually.
346
347 2005-12-03 Eli Zaretskii <eliz@gnu.org>
348
349 * bidi.c: Include stdio.h unconditionally. Fix and elaborate
350 commentary. Add Copyright blurb.
351
352 2004-03-08 Kenichi Handa <handa@m17n.org>
353
354 * xdisp.c (reseat_1): Call bidi_init_it with a previous position.
355
356 * bidi.c (bidi_init_it): Set bidi_it->ch_len even if POS > 0.
357
358 2004-03-04 Kenichi Handa <handa@m17n.org>
359
360 The following changes are to support bidirectional text display.
361
362 * Makefile.in (obj): Include bidi.o.
363 (bidi.o): New target.
364
365 * bidi.c: New file.
366
367 * buffer.h (struct buffer): New member bidi_display_reordering.
368
369 * buffer.c (init_buffer_once): Initialize bidi_display_reordering.
370 (syms_of_buffer): Declarations of Lisp variables
371 default-bidi-display-reordering and bidi-display-reordering.
372
373 * dispextern.h (BIDI_MAXLEVEL): New macro.
374 (bidi_type_t, bidi_dir_t): New types.
375 (bidi_saved_info, bidi_stack, bidi_it): New structs.
376 (struct it): New members bidi_p and bidi_it.
377 (bidi_init_it): Extern it.
378 (bidi_get_next_char_visually): Extern it.
379
380 * dispnew.c (direct_output_forward_char): Give up if we need bidi
381 processing or buffer's direction is right-to-left.
382
383 * xdisp.c (init_iterator): Initialize it->bidi_p.
384 (reseat_1): Cal bidi_init_it and bidi_get_next_char_visually if
385 necessary.
386 (set_iterator_to_next): Cal bidi_get_next_char_visually if
387 necessary.
388
389
390 ;; Local Variables:
391 ;; coding: utf-8
392 ;; add-log-time-zone-rule: t
393 ;; End:
394
395 Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
396
397 This file is part of GNU Emacs.
398
399 GNU Emacs is free software: you can redistribute it and/or modify
400 it under the terms of the GNU General Public License as published by
401 the Free Software Foundation, either version 3 of the License, or
402 (at your option) any later version.
403
404 GNU Emacs is distributed in the hope that it will be useful,
405 but WITHOUT ANY WARRANTY; without even the implied warranty of
406 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
407 GNU General Public License for more details.
408
409 You should have received a copy of the GNU General Public License
410 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.