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