summaryrefslogtreecommitdiff
path: root/src/bidi.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixed BPA stack overflow and infloop with nested brackets.Eli Zaretskii2014-10-131-12/+20
|
* Fix bidi_cache_find when NEUTRALS_OK is false; RLI no longer aborts.Eli Zaretskii2014-10-121-8/+13
|
* Refactored saving prev info, resolve_neutrals, and high-level cache access.Eli Zaretskii2014-10-121-196/+179
|
* Reset bracket_resolved bit earlier; remove bytepos from bidi_saved_info.Eli Zaretskii2014-10-111-7/+7
|
* Rename type_after_w1 into type_after_wn.Eli Zaretskii2014-10-111-69/+69
|
* Reset the bracket_resolved flag before advancing to next character.Eli Zaretskii2014-10-111-1/+4
|
* Fix assertion violations due to unresolvable neutrals in cache.Eli Zaretskii2014-10-101-6/+20
|
* Added BPA. Emacs aborts at startup.Eli Zaretskii2014-10-091-3/+251
|
* Move SOS calculation into push/pop embedding level; fix N1/N2 w/isolates.Eli Zaretskii2014-10-041-10/+24
|
* Fixed a crash in 'C-x =' and in RLE followed by PDF; fixed 'C-x =' display.Eli Zaretskii2014-10-041-6/+9
|
* Fixed handling of LRI, RLI, and FSI.Eli Zaretskii2014-10-031-148/+157
| | | | | Scrolled successfully through the entire biditest.txt file. The parentheses are still not implemented.
* Finished writing code for isolates and fixed a few bugs (no parens yet).Eli Zaretskii2014-09-271-42/+100
|
* Fix N1 and N2. Remove special level for PDF.Eli Zaretskii2014-09-261-78/+68
| | | | Improve glyphless glyph display in .gdbinit/pgx.
* Fix bidi_resolve_explicit when one directional control follows another.Eli Zaretskii2014-09-261-88/+88
|
* Remove the ignore_bn_limit ``optimization''.Eli Zaretskii2014-09-241-148/+47
|
* Adapt bidi_resolve_neutral to new treatment of PDF to avoid assertion ↵Eli Zaretskii2014-09-241-21/+20
| | | | violations.
* Fixed bidi_resolve_explicit_1 wrt isolate initiators and PDF.Eli Zaretskii2014-09-201-20/+35
| | | | bidi_resolve_neutral needs to be fixed, as it now aborts at line 2432.
* Rewrite LRI/RLI/FSI handling in bidi_resolve_explicit_1.Eli Zaretskii2014-09-201-55/+69
|
* Fix assertion violations due to a bug in bidi_set_sos_type; add assertions.Eli Zaretskii2014-09-191-31/+36
|
* Use the level stack for initial level below bidi_level_of_next_char.Eli Zaretskii2014-09-131-5/+12
| | | | This still crashes in TUTORIAL.he.
* Optimize memory footprint of the bidi level stack.Eli Zaretskii2014-09-061-3/+15
|
* Fixed problems revealed by -Wall.Eli Zaretskii2014-08-301-16/+12
|
* Updated bidi_resolve_weak. Removed next_en_* members from stack.Eli Zaretskii2014-08-301-5/+12
|
* Updated pushing and popping the bidi stack, and sos calculations.Eli Zaretskii2014-08-301-12/+54
| | | | Added the necessary members to bidi_stack.
* Fix find_first_strong_char and implement Unicode 8.0 isolate corrections.Eli Zaretskii2014-08-291-12/+57
| | | | | | find_first_strong_char accepts 1 additional argument, which says to stop at the PDI that matches the FSI where we started; callers changed. Implemented suggested Unicode 8.0 corrections for type of RLI/LRI/PDI.
* Finished coding of explicit directional format characters.Eli Zaretskii2014-08-231-115/+162
| | | | | | Refactored part of bidi_paragraph_init into find_first_strong_char. Removed old kludges from bidi_it and the code. sor is now sos.
* Remove bidi_ignore_explicit_marks_for_paragraph_level.Eli Zaretskii2014-08-231-8/+0
|
* Started working on implementing UBA v6.3.Eli Zaretskii2014-08-231-36/+62
| | | | | | | | | Modified struct bidi_it as required by UBA changes. Introduced BIDI_MAXDEPTH instead of BIDI_MAXLEVEL; users changed. Added bidi_fetch_char_skip_isolates. Changed bidi_paragraph_init to use bidi_fetch_char_skip_isolates. Removed uses of bidi_ignore_explicit_marks_for_paragraph_level. Reverted temporary kludges that treat isolate initiators as weak characters.
* src/bidi.c: Describe the design of reordering engine in the commentary.Eli Zaretskii2014-04-061-4/+186
|
* Fix bug #16265 with buffer caches when modifying text in indirect buffers.Eli Zaretskii2014-01-011-8/+36
| | | | | | | | | | | | | | | | | src/search.c (newline_cache_on_off, find_newline): In indirect buffers, use the newline cache of the base buffer. src/insdel.c (invalidate_buffer_caches): If BUF is an indirect buffer, invalidate the caches of its base buffer. src/indent.c (width_run_cache_on_off, compute_motion): In indirect buffers, use the width-run cache of the base buffer. src/xdisp.c (redisplay_window): When the window displays an indirect buffer, and the character widths in the display table have changed, invalidate the width-run cache of the corresponding base buffer. src/fileio.c (Finsert_file_contents): When invalidating the newline cache, consider the case of inserting into indirect buffer. src/bidi.c (bidi_paragraph_cache_on_off, bidi_find_paragraph_start): In indirect buffers, use the paragraph cache of the base buffer.
* Update copyright year to 2014 by running admin/update-copyright.Paul Eggert2014-01-011-1/+1
|
* * bidi.c (LRM_CHAR, RLM_CHAR): Remove; no longer used.Paul Eggert2013-12-041-3/+1
|
* Fix bug #16043 with crashes when displaying new bidi control characters.Eli Zaretskii2013-12-041-24/+34
| | | | | | | | | | | | | | | | | | | | src/bidi.c (bidi_get_type, bidi_get_category): Handle the isolate directional control characters. Update type and category determination according to the UBA from Unicode v6.3. (bidi_category_t): New category EXPLICIT_FORMATTING. src/dispextern.h (bidi_type_t): Update to include new bidirectional properties introduced with Unicode v6.3. admin/unidata/unidata-gen.el (unidata-prop-alist): Update bidi-class to include the new isolate-related classes introduced with Unicode v6.3. (unidata-encode-val): Accept an additional optional argument, a warning message to emit when UnicodeData.txt defines bidi-class values that are not in unidata-prop-alist. Add a comment explaining what should maintainers do if/when such a warning ever appears. (unidata-gen-table): Call unidata-encode-val with 3rd arg non-nil when generating uni-bidi.el.
* Fix bug #15951 with vertical-motion near beginning of narrowed region.Eli Zaretskii2013-11-221-0/+3
| | | | | src/bidi.c (bidi_find_paragraph_start): Limit the returned positions to BEGV_BYTE..ZV_BYTE range.
* Don't overuse 'const' in types of locals.Paul Eggert2013-09-171-2/+2
| | | | | | | | | | | | | | | | | | | | * bidi.c (bidi_count_bytes): * gtkutil.c, gtkutil.h (xg_event_is_for_menubar) (xg_event_is_for_scrollbar): * xselect.c (x_handle_property_notify) (x_handle_selection_notify, x_handle_dnd_message): * xsettings.c, xsettings.h (xft_settings_event): * xterm.c (x_handle_net_wm_state, handle_one_event) (x_menubar_window_to_frame, x_detect_focus_change) (construct_mouse_click, note_mouse_movement) (x_scroll_bar_to_input_event, x_scroll_bar_expose) (x_scroll_bar_handle_click, x_scroll_bar_note_movement) (handle_one_xevent, x_handle_net_wm_state): * xterm.h (x_handle_property_notify, x_handle_selection_notify) (x_handle_dnd_message): Avoid unnecessary 'const', typically the second 'const' in 'const foo * const arg', a 'const' that does not affect the API and doesn't significantly help the human reader.
* Use region cache to speedup bidi_find_paragraph_start.Dmitry Antipov2013-08-061-3/+36
| | | | | | | | | | | | | | | | | | | | | * src/buffer.h (struct buffer): New member bidi_paragraph_cache. Rename cache_long_line_scans to cache_long_scans. * src/buffer.c (bset_cache_long_line_scans): Rename to bset_cache_long_scans. (Fget_buffer_create, Fmake_indirect_buffer, Fkill_buffer) (Fbuffer_swap_text, init_buffer_once): Take bidi_paragraph_cache into account. (syms_of_buffer): Rename cache-long-line-scans to cache-long-scans. Adjust docstring. * src/search.c (newline_cache_on_off): * src/indent.c (width_run_cache_on_off): Adjust users. * src/bidi.c (bidi_paragraph_cache_on_off): New function. (bidi_find_paragraph_start): Use bidi_paragraph_cache if needed. * src/insdel.c (prepare_to_modify_buffer): Invalidate bidi_paragraph_cache if enabled. * doc/lispref/positions.texi (Motion by Screen Lines): * doc/lispref/display.texi (Truncation): Rename `cache-long-line-scans' to `cache-long-scans'.
* Fix bug #14575 with window-specific overlays with display props.Eli Zaretskii2013-06-081-6/+8
| | | | | | | | | | | | | | | | | src/bidi.c (bidi_fetch_char): Accept additional argument, the window being displayed, and pass it to compute_display_string_pos. (bidi_level_of_next_char, bidi_resolve_explicit_1) (bidi_paragraph_init): All callers changed. src/xdisp.c (init_from_display_pos, init_iterator) (handle_single_display_spec, next_overlay_string) (get_overlay_strings_1, reseat_1, reseat_to_string) (push_prefix_prop, Fcurrent_bidi_paragraph_direction): Set bidi_it.w member from it->w. (compute_display_string_pos): Accept additional argument, the window being displayed, and pass it to Fget_char_property. src/dispextern.h (struct bidi_it): New member w, the window being displayed. (compute_display_string_pos): Adjust prototype.
* * search.c (find_newline): Accept start and end byte positionsDmitry Antipov2013-03-081-5/+8
| | | | | | | | | | | | | | | | as arguments and allow -1 if not known. (find_newline_no_quit): Likewise for start position. * lisp.h (find_newline, find_newline_no_quit): Adjust prototype. * bidi.c (bidi_find_paragraph_start): Pass byte position to find_newline_no_quit, thus eliminating CHAR_TO_BYTE. * editfns.c (Fconstrain_to_field): Break long line. Adjust call to find_newline. * indent.c (vmotion): Adjust calls to find_newline_no_quit. Use DEC_BOTH to start next search from the previous buffer position, where appropriate. * xdisp.c (back_to_previous_line_start, forward_to_next_line_start) (get_visually_first_element, move_it_vertically_backward): Likewise. Obtain byte position from the display iterator, where appropriate.
* * bidi.c (bidi_fetch_char): Swap first and second argumentsDmitry Antipov2013-03-081-8/+7
| | | | | | | | | to match other functions accepting character and byte positions. Adjust comment. (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users. (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster when you need just to move to the previous buffer position. * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
* Rename find_next_newline to find_newline_no_quit.Eli Zaretskii2013-03-061-1/+1
| | | | | | | | | | | | src/search.c (find_newline_no_quit): Rename from find_next_newline. Add commentary. src/lisp.h (find_newline_no_quit): Rename prototype. src/xdisp.c (back_to_previous_line_start) (forward_to_next_line_start, get_visually_first_element) (move_it_vertically_backward): Callers of find_newline_no_quit changed. src/indent.c (vmotion): Callers of find_newline_no_quit changed. src/bidi.c (bidi_find_paragraph_start): Callers of find_newline_no_quit changed.
* * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.Dmitry Antipov2013-03-061-1/+1
| | | | | | | * xdisp.c (back_to_previous_line_start, forward_to_next_line_start) (get_visually_first_element, move_it_vertically_backward): Ajust users. * bidi.c (bidi_find_paragraph_start): Likewise. * indent.c (vmotion): Likewise.
* Don't sync charpos and bytepos in bidi_resolve_explicit_1.Eli Zaretskii2013-03-051-5/+9
| | | | | | | src/bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or bidi_count_bytes, as the callers now arrange for bidi_it->charpos to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
* * search.c (find_newline): Return byte position in bytepos.Dmitry Antipov2013-02-201-8/+5
| | | | | | | | | | | | | | Adjust comment. (find_next_newline_no_quit, find_before_next_newline): Add bytepos argument. * lisp.h (find_newline, find_next_newline_no_quit) (find_before_next_newline): Adjust prototypes. * bidi.c (bidi_find_paragraph_start): * editfns.c (Fconstrain_to_field, Fline_end_position): * indent.c (compute_motion, vmotion): * xdisp.c (back_to_previous_line_start, forward_to_next_line_start): (get_visually_first_element, move_it_vertically_backward): Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
* Fix rare aborts in bidi.c.Eli Zaretskii2013-02-111-0/+5
| | | | | | | | | | | src/bidi.c (bidi_resolve_neutral): After finding the next non-neutral character, accept NEUTRAL_ON type as well, because directional control characters, such as LRE and RLE, have their type converted to that by bidi_resolve_weak. This avoids aborts when LRE/RLE follows a run of neutrals. (bidi_move_to_visually_next): Assert that return value of bidi_peek_at_next_level is non-negative. Negative values will cause an infloop.
* Update copyright notices for 2013.Paul Eggert2013-01-011-2/+2
|
* Prefer plain 'static' to 'static inline'.Paul Eggert2012-10-011-22/+22
| | | | | | | | | | | | | | | * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category) (bidi_set_sor_type, bidi_push_embedding_level) (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it) (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state) (bidi_cache_search, bidi_cache_ensure_space) (bidi_cache_iterator_state, bidi_cache_find) (bidi_peek_at_next_level, bidi_set_paragraph_end) (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char) (bidi_explicit_dir_char, bidi_resolve_neutral_1): Now 'static', not 'static inline'. Fixes: debbugs:12541
* * bidi.c: Tune.Paul Eggert2012-09-301-14/+10
| | | | | (bidi_copy_it): Do the whole copy with a single memcpy. (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
* Port better to POSIX hosts lacking _setjmp.Paul Eggert2012-09-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (HAVE__SETJMP, HAVE_SIGSETJMP): New symbols. (_setjmp, _longjmp): Remove. * src/lisp.h: Include <setjmp.h> here, since we use its symbols here. All instances of '#include <setjmp.h>' removed, if the only reason for the instance was because "lisp.h" was included. (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols. Unless otherwise specified, replace all uses of jmp_buf, _setjmp, and _longjmp with the new symbols. Emacs already uses _setjmp if available, so this change affects only POSIXish hosts that have sigsetjmp but not _setjmp, such as some versions of Solaris and Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.) * src/image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros. (png_load_body) [HAVE_PNG]: (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]: (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]: Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp, since PNG requires jmp_buf. This is the only exception to the general rule that we now use sys_setjmp and sys_longjmp. This exception is OK since this code does not change the signal mask or longjmp out of a signal handler. Fixes: debbugs:12446
* Prefer assignment to memcpy when either will do.Paul Eggert2012-09-111-2/+2
| | | | | | | | | | | | | * lib-src/pop.c (socket_connection) [HAVE_GETADDRINFO]: * src/bidi.c (bidi_push_it, bidi_pop_it): * src/fns.c (copy_hash_table): * src/image.c (define_image_type): * src/keyboard.c (kbd_buffer_store_event_hold): * src/process.c (Fprocess_send_eof): * src/xfaces.c (x_create_gc) [HAVE_NS]: * src/xgselect.c (xg_select): Use assignment, not memcpy, as either will do here, and assignment is more likely to catch type errors.
* Simplify redefinition of 'abort' (Bug#12316).Paul Eggert2012-09-041-39/+40
| | | | | | | | | | | | | | | | | | | | | | Do not try to redefine the 'abort' function. Instead, redo the code so that it calls 'emacs_abort' rather than 'abort'. This removes the need for the NO_ABORT configure-time macro and makes it easier to change the abort code to do a backtrace. * configure.ac (NO_ABRT): Remove. * admin/CPP-DEFINES (NO_ABORT): Remove. * nt/inc/ms-w32.h (w32_abort) [HAVE_NTGUI]: Remove. * src/.gdbinit: Just stop at emacs_abort, not at w32_abort or abort. * src/emacs.c (abort) [!DOS_NT && !NO_ABORT]: Remove; sysdep.c's emacs_abort now takes its place. * src/lisp.h (emacs_abort): New decl. All calls from Emacs code to 'abort' changed to use 'emacs_abort'. * src/msdos.c (dos_abort) [defined abort]: Remove; not used. (abort) [!defined abort]: Rename to ... (emacs_abort): ... new name. * src/sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking the place of the old 'abort' in emacs.c. * src/w32.c, src/w32fns.c (abort): Do not #undef. * src/w32.c (emacs_abort): Rename from w32_abort.