Retrospective commit from 2009-10-17.
[emacs.git] / src / ChangeLog.bidi
blob9824981c08611fc1b9dab276bed9d63be5fb3625
1 2009-10-17  Eli Zaretskii  <eliz@gnu.org>
3         * dispextern.h (struct glyph): New members resolved_level and
4         bidi_type.
6         * xdisp.c (append_glyph, append_composite_glyph)
7         (produce_image_glyph, append_stretch_glyph): Set them.
9         * term.c (append_glyph): Ditto.
11         * xdisp.c (display_line, next_element_from_buffer): Set the glyph
12         row's reversed_p flag if the paragraph base direction is odd.
13         (extend_face_to_end_of_line): Don't reverse the glyphs here.
15         * term.c (append_glyph): Reverse glyphs here.
17         * bidi.c (bidi_get_next_char_visually): Don't exit early when at
18         ZV.
19         (bidi_paragraph_init): Don't step over a newline if at BEGV.
21 2009-10-16  Eli Zaretskii  <eliz@gnu.org>
23         * bidi.c (bidi_paragraph_init): Handle empty buffers.
25 2009-10-10  Eli Zaretskii  <eliz@gnu.org>
27         * xdisp.c (set_cursor_from_row): Skip over glyphs near end of row
28         with integer OBJECT even if their CHARPOS is zero.
30         * bidi.c (bidi_cache_iterator_state): Don't cache NEW_PARAGRAPH.
31         Abort if someone tries to add a cached state whose position is not
32         the immediate successor to that of the last cached state.
33         (bidi_paragraph_init): Don't bail out too early after a reseat.
35 2009-10-09  Eli Zaretskii  <eliz@gnu.org>
37         * xdisp.c (text_outside_line_unchanged_p, try_window_id): Disable
38         optimizations if we are reordering bidirectional text and the
39         paragraph direction can be affected by the change.
41 2009-10-08  Eli Zaretskii  <eliz@gnu.org>
43         * xdisp.c (string_buffer_position_lim): New function.
44         (string_buffer_position): Most of code moved to
45         string_buffer_position_lim.  Last argument and return value are
46         now EMACS_INT; all callers changed.
47         (set_cursor_from_row): Rewritten to support bidirectional text and
48         reversed glyph rows.
50         dispextern.h <string_buffer_position>: Update prototype.
52 2009-10-07  Eli Zaretskii  <eliz@gnu.org>
54         * bidi.c (bidi_paragraph_init): Fix initialization of POS.
56         * dispextern.h (struct glyph_row): New member reversed_p.
58 2009-10-06  Eli Zaretskii  <eliz@gnu.org>
60         * buffer.c (syms_of_buffer): Remove DEFVAR_LISP_NOPRO for
61         default-direction-reversed, default-bidi-display-reordering, and
62         default-paragraph-direction.
64 2009-10-05  Eli Zaretskii  <eliz@gnu.org>
66         * buffer.h (struct buffer): New member paragraph_direction.
67         * buffer.c (init_buffer_once): Initialize it.
68         (syms_of_buffer): Declare Lisp variables
69         default-paragraph-direction and paragraph-direction.
71         * dispextern.h (struct it): New member paragraph_embedding.
72         * xdisp.c (init_iterator): Initialize it from the buffer's value
73         of paragraph-direction.
74         <Qright_to_left, Qleft_to_right>: New variables.
75         (syms_of_xdisp): Initialize and staticpro them.
76         (set_iterator_to_next, next_element_from_buffer): Use the value of
77         paragraph_embedding to determine the paragraph direction.
79         * bidi.c (bidi_line_init): Fix second argument to
80         bidi_set_sor_type.
81         (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
82         (bidi_get_next_char_visually): Record the last character of the
83         separator in separator_limit, not the character after that.
84         (bidi_find_paragraph_start): Accept character and byte positions
85         instead of the whole iterator stricture.  All callers changed.
87 2009-10-04  Eli Zaretskii  <eliz@gnu.org>
89         * bidi.c (bidi_at_paragraph_end): Check for paragraph-start if
90         paragraph-separate failed to match.  Return the length of the
91         matched separator.
92         (bidi_line_init): New function.
93         (bidi_paragraph_init): Use bidi_line_init.  Do nothing if in the
94         middle of a paragraph-separate sequence.  Don't override existing
95         paragraph direction if no strong characters found in this
96         paragraph.  Set separator_limit according to what
97         bidi_at_paragraph_end returns.  Reset new_paragraph flag when a
98         new paragraph is found.
99         (bidi_init_it): Reset separator_limit.
101         * dispextern.h (struct bidi_it): New member separator_limit.
103         * bidi.c (bidi_find_paragraph_start): Return the byte position of
104         the paragraph beginning.
106         * xdisp.c (set_iterator_to_next): Call bidi_paragraph_init if the
107         new_paragraph flag is set in the bidi iterator.
109         * bidi.c (bidi_at_paragraph_end, bidi_find_paragraph_start): Use
110         the buffer-local value of paragraph-start and paragraph-separate.
112 2009-10-03  Eli Zaretskii  <eliz@gnu.org>
114         * bidi.c (bidi_set_paragraph_end): Don't set the new_paragraph
115         flag in the iterator.
116         (bidi_init_it): Set the new_paragraph flag.
117         (bidi_at_paragraph_end): Arguments are now character and byte
118         position of the next character.  All callers changed.
119         (bidi_resolve_explicit): Don't call bidi_at_paragraph_end, and
120         don't behave as if at paragraph end if it returns true.
121         (bidi_get_next_char_visually): Don't call bidi_paragraph_init if
122         new_paragraph flags is set.  Set new_paragraph flag when at end of
123         a paragraph.
124         <fallback_paragraph_start_re, fallback_paragraph_separate_re>: New
125         variables.
126         <Qparagraph_start, Qparagraph_separate>: New variables.
127         (bidi_initialize): Initialize and staticpro them.
129         * dispextern.h <struct bidi_it>: New element paragraph_dir.  Make
130         positional elements EMACS_INT.
132         * bidi.c <bidi_overriding_paragraph_direction>: Delete.
134 2009-09-28  Eli Zaretskii  <eliz@gnu.org>
136         * bidi.c (bidi_init_it): Initialize charpos, bytepos, and
137         first_elt before calling bidi_set_paragraph_end.
138         (bidi_resolve_explicit): Don't call bidi_set_paragraph_end at
139         EOB.
140         (bidi_at_paragraph_end): Don't set new_paragraph flag at EOB.
141         (bidi_get_type): Accept an additional argument OVERRIDE, per UAX#9
142         "Explicit Overrides".  All callers changed.
144 2009-09-27  Eli Zaretskii  <eliz@gnu.org>
146         * xdisp.c (next_element_from_buffer): If called not at line
147         beginning, start bidi iteration from line beginning.
149         * bidi.c (bidi_paragraph_init): Use
150         bidi_overriding_paragraph_direction instead of a literal zero.
151         (bidi_initialize): Fix some character types, per Unicode 5.x.
152         (bidi_get_type): Abort if called with invalid character code.
154         * dispextern.h: Add prototype of bidi_mirror_char.
156         * xdisp.c (get_next_display_element): Mirror characters whose
157         resolved type is STRONG_R.
159 2009-09-26  Eli Zaretskii  <eliz@gnu.org>
161         * bidi.c (bidi_paragraph_init): Don't set bidi_it->ch_len.  Abort
162         if called not at beginning of a new paragraph.
163         (bidi_get_next_char_visually): Prepare and use a sentinel iterator
164         state when first_elt flag is set.
166         * dispextern.h (struct bidi_it): New struct member first_elt.
168         * bidi.c (bidi_init_it): Initialize bidi_it->first_elt.
169         (bidi_copy_it): Don't copy the first_elt flag.
171         * xdisp.c (reseat_1): Initialize bidi_it.first_elt.  Move bidi
172         scan start code from here...
173         (next_element_from_buffer): ...to here.  Use bidi_it.first_elt
174         flag.
176 2009-09-20  Eli Zaretskii  <eliz@gnu.org>
178         * xdisp.c (reseat_1): Handle position < BEGV.
180         * bidi.c (bidi_paragraph_init): Set bidi_it->ch_len.  Handle ZV.
181         (bidi_init_it): Don't initialize bidi_it->ch_len.
182         (bidi_resolve_explicit_1): Abort if bidi_it->ch_len was not
183         initialized.
184         (bidi_at_paragraph_end, bidi_resolve_explicit_1)
185         (bidi_resolve_weak, bidi_level_of_next_char): Handle bytepos at
186         ZV_BYTE.
187         (bidi_resolve_explicit_1): Handle position < BEGV.
189 2009-09-19  Eli Zaretskii  <eliz@gnu.org>
191         * xdisp.c (init_iterator): Call bidi_init_it.  Set
192         bidi_it->bytepos if buffer position specified.
193         (reseat_1): Don't call bidi_init_it.  Call bidi_paragraph_init
194         instead.  Move back to preceding character before the call to
195         bidi_get_next_char_visually.
197         * bidi.c: Remove all STANDALONE parts.
198         (bidi_init_it): Init bidi_it->charpos and bidi_it->bytepos to -1.
199         Don't call bidi_paragraph_init.  Change arguments.
200         (bidi_paragraph_init): Remove code for negative pos.
202         * dispextern.h <bidi_it>: Rename orig_type to type_after_w1 and
203         pristine_type to orig_type.
205 2009-09-12  Eli Zaretskii  <eliz@gnu.org>
207         * dispnew.c (direct_output_for_insert): Give up if we are
208         reordering bidirectional text.
210         * dispextern.h (IT_STACK_SIZE): Enlarge to 5.
212         * xdisp.c (display_line): Set row->end and it->start for the next
213         row to the next character in logical order.  If we are reordering
214         bidi text, push and pop the iterator before and after momentarily
215         iterating in logical order.
217 2009-09-11  Eli Zaretskii  <eliz@gnu.org>
219         Note: The following changes were undone on 2009-09-12.
221         * xdisp.c (set_iterator_to_next, reseat, reseat_1)
222         (reseat_at_next_visible_line_start): Accept additional argument
223         force_logical_p; all callers changed.  If force_logical_p is
224         non-zero, force iteration in buffer's logical order even in bidi
225         buffers.
227         * dispnew.c (direct_output_for_insert): Call set_iterator_to_next
228         with additional argument zero.
230         * dispextern.h (set_iterator_to_next): Now accepts an additional
231         argument.
233 2009-08-29  Eli Zaretskii  <eliz@gnu.org>
235         * xdisp.c (set_cursor_from_row): Don't assume glyph->charpos
236         increments linearly.
237         (try_window_reusing_current_matrix): Don't assume glyph->charpos
238         increments linearly.
240 2009-08-28  Eli Zaretskii  <eliz@gnu.org>
242         * bidi.c <bidi_overriding_paragraph_direction>: Default to L2R,
243         for now.
245 2009-08-22  Eli Zaretskii  <eliz@gnu.org>
247         * bidi.c (bidi_initialize): staticpro bidi_char_table.
248         (bidi_check_type): New function.
249         (bidi_cache_iterator_state, bidi_remember_char)
250         (bidi_resolve_explicit_1, bidi_resolve_explicit)
251         (bidi_resolve_weak, bidi_resolve_neutral)
252         (bidi_level_of_next_char): Use it to validate the bidi type
253         assigned to the iterator.
255 2009-08-15  Eli Zaretskii  <eliz@gnu.org>
257         * bidi.c (bidi_initialize): Fix initialization of bidi_type_table.
259         * xdisp.c (set_iterator_to_next): Fix position setting after call
260         to bidi_get_next_char_visually.
262 2005-12-03  Eli Zaretskii  <eliz@gnu.org>
264         * bidi.c: Include stdio.h unconditionally.  Fix and elaborate
265         commentary.  Add Copyright blurb.
267 2004-03-08  Kenichi Handa  <handa@m17n.org>
269         * xdisp.c (reseat_1): Call bidi_init_it with a previous position.
271         * bidi.c (bidi_init_it): Set bidi_it->ch_len even if POS > 0.
273 2004-03-04  Kenichi Handa  <handa@m17n.org>
275         The following changes are to support bidirectional text display.
277         * Makefile.in (obj): Include bidi.o.
278         (bidi.o): New target.
280         * bidi.c: New file.
282         * buffer.h (struct buffer): New member bidi_display_reordering.
284         * buffer.c (init_buffer_once): Initialize bidi_display_reordering.
285         (syms_of_buffer): Declarations of Lisp variables
286         default-bidi-display-reordering and bidi-display-reordering.
288         * dispextern.h (BIDI_MAXLEVEL): New macro.
289         (bidi_type_t, bidi_dir_t): New types.
290         (bidi_saved_info, bidi_stack, bidi_it): New structs.
291         (struct it): New members bidi_p and bidi_it.
292         (bidi_init_it): Extern it.
293         (bidi_get_next_char_visually): Extern it.
295         * dispnew.c (direct_output_forward_char): Give up if we need bidi
296         processing or buffer's direction is right-to-left.
298         * xdisp.c (init_iterator): Initialize it->bidi_p.
299         (reseat_1): Cal bidi_init_it and bidi_get_next_char_visually if
300         necessary.
301         (set_iterator_to_next): Cal bidi_get_next_char_visually if
302         necessary.
305 ;; Local Variables:
306 ;; coding: utf-8
307 ;; add-log-time-zone-rule: t
308 ;; End:
310     Copyright (C) 2007, 2008, 2009  Free Software Foundation, Inc.
312   This file is part of GNU Emacs.
314   GNU Emacs is free software: you can redistribute it and/or modify
315   it under the terms of the GNU General Public License as published by
316   the Free Software Foundation, either version 3 of the License, or
317   (at your option) any later version.
319   GNU Emacs is distributed in the hope that it will be useful,
320   but WITHOUT ANY WARRANTY; without even the implied warranty of
321   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
322   GNU General Public License for more details.
324   You should have received a copy of the GNU General Public License
325   along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.