summaryrefslogtreecommitdiff
path: root/src/bidi.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix misuses of NULL when talking about the NUL characterStefan Monnier2019-03-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | * lisp/subr.el (inhibit-null-byte-detection): Make it an obsolete alias. * src/coding.c (setup_coding_system): Use new name. (detect_coding): Rename null_byte_found => nul_byte_found. (detect_coding_system): Use new name. Rename null_byte_found => nul_byte_found. (Fdefine_coding_system_internal): Use new name. (syms_of_coding): Rename inhibit-null-byte-detection to inhibit-nul-byte-detection. * src/w16select.c (get_clipboard_data): null_char => nul_char. * src/json.c (check_string_without_embedded_nuls): Rename from check_string_without_embedded_nulls. (Fjson_parse_string): Adjust accordingly. * src/coding.h (enum define_coding_undecided_arg_index) (enum coding_attr_index): ...null_byte... => ...nul_byte.... * lisp/info.el (info-insert-file-contents, Info-insert-dir): * lisp/international/mule.el (define-coding-system): * lisp/vc/vc-git.el (vc-git--call): * doc/lispref/nonascii.texi (Lisp and Coding Systems): Use the new name.
* Merge from origin/emacs-26Paul Eggert2018-12-311-1/+1
|\ | | | | | | | | | | 2fcf2df Fix copyright years by hand 26bed8b Update copyright year to 2019 2814292 Fix value of default frame height. (Bug#33921)
| * Update copyright year to 2019Paul Eggert2019-01-011-1/+1
| | | | | | | | Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
* | More macro renamings for bignumTom Tromey2018-08-071-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/alloc.c, src/bidi.c, src/buffer.c, src/buffer.h, src/bytecode.c, src/callint.c, src/callproc.c, src/casefiddle.c, src/casetab.c, src/category.c, src/ccl.c, src/character.c, src/character.h, src/charset.c, src/charset.h, src/chartab.c, src/cmds.c, src/coding.c, src/composite.c, src/composite.h, src/data.c, src/dbusbind.c, src/decompress.c, src/dired.c, src/dispextern.h, src/dispnew.c, src/disptab.h, src/doc.c, src/dosfns.c, src/editfns.c, src/emacs-module.c, src/emacs.c, src/eval.c, src/fileio.c, src/floatfns.c, src/fns.c, src/font.c, src/font.h, src/fontset.c, src/frame.c, src/frame.h, src/fringe.c, src/ftcrfont.c, src/ftfont.c, src/gfilenotify.c, src/gnutls.c, src/gtkutil.c, src/image.c, src/indent.c, src/insdel.c, src/intervals.c, src/json.c, src/keyboard.c, src/keymap.c, src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c, src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c, src/process.c, src/profiler.c, src/search.c, src/sound.c, src/syntax.c, src/syntax.h, src/sysdep.c, src/term.c, src/termhooks.h, src/textprop.c, src/undo.c, src/w32.c, src/w32console.c, src/w32fns.c, src/w32font.c, src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c, src/w32term.h, src/w32uniscribe.c, src/window.c, src/xdisp.c, src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c, src/xml.c, src/xrdb.c, src/xselect.c, src/xsettings.c, src/xterm.c, src/xwidget.c Rename XINT->XFIXNUM, XFASTINT->XFIXNAT, XUINT->XUFIXNUM.
* | Rename integerp->fixnum, etc, in preparation for bignumsTom Tromey2018-07-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/json.c, src/keyboard.c, src/keyboard.h, src/keymap.c, src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c, src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c, src/process.c, src/profiler.c, src/search.c, src/sound.c, src/syntax.c, src/sysdep.c, src/term.c, src/terminal.c, src/textprop.c, src/undo.c, src/w16select.c, src/w32.c, src/w32console.c, src/w32cygwinx.c, src/w32fns.c, src/w32font.c, src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c, src/w32uniscribe.c, src/widget.c, src/window.c, src/xdisp.c, src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c, src/xrdb.c, src/xselect.c, src/xterm.c, src/xwidget.c: Rename INTEGERP->FIXNUM, make_number->make_fixnum, CHECK_NUMBER->CHECK_FIXNUM, make_natnum->make_fixed_natum, NUMBERP->FIXED_OR_FLOATP, NATNUMP->FIXNATP, CHECK_NATNUM->CHECK_FIXNAT.
* | ; Replace "Written by" with standard "Author:" header in some C filesGlenn Morris2018-02-131-5/+5
|/
* Update copyright year to 2018Paul Eggert2018-01-011-1/+1
| | | | Run admin/update-copyright.
* Prefer HTTPS to FTP and HTTP in documentationPaul Eggert2017-09-131-1/+1
| | | | | | | | | | | | | Most of this change is to boilerplate commentary such as license URLs. This change was prompted by ftp://ftp.gnu.org's going-away party, planned for November. Change these FTP URLs to https://ftp.gnu.org instead. Make similar changes for URLs to other organizations moving away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and fsf.org when this works, as this will further help defend against man-in-the-middle attacks (for this part I omitted the MS-DOS and MS-Windows sources and the test tarballs to keep the workload down). HTTPS is not fully working to lists.gnu.org so I left those URLs alone for now.
* Allow user control on what starts and ends a paragraph for bidiEli Zaretskii2017-07-171-7/+22
| | | | | | | | | | | | | | | | | | | | | | | | * src/buffer.h (struct buffer): New members bidi_paragraph_separate_re_ and bidi_paragraph_start_re_. * src/buffer.c (bset_bidi_paragraph_start_re) (bset_bidi_paragraph_separate_re): New setters/ (Fbuffer_swap_text): Swap the values of bidi-paragraph-start-re and bidi-paragraph-separate-re. (init_buffer_once): Init the values of bidi-paragraph-start-re and bidi-paragraph-separate-re. (syms_of_buffer) <bidi-paragraph-start-re, bidi-paragraph-separate-re>: New per-buffer variables. * src/bidi.c (bidi_at_paragraph_end, bidi_find_paragraph_start): Support bidi-paragraph-start-re and bidi-paragraph-separate-re. (bidi_move_to_visually_next): Handle correctly the case when the separator matches an empty string. (Bug#27526) * doc/emacs/mule.texi (Bidirectional Editing): * doc/lispref/display.texi (Bidirectional Display): Document bidi-paragraph-start-re and bidi-paragraph-separate-re. * etc/NEWS: Mention bidi-paragraph-start-re and bidi-paragraph-separate-re.
* Limit bidi_find_bracket_pairs to MAX_ALLOCAPaul Eggert2017-06-211-7/+7
| | | | | | | | * src/bidi.c (MAX_BPA_STACK): Now a constant, not a macro. Shrink it to allow for the two struct bidi_it objects in the same frame. (PUSH_BPA_STACK): Avoid integer overflow with enormous bidi cache. (bidi_find_bracket_pairs): Use compile-time check instead of runtime.
* Merge with gnulib, pacifying GCC 7Paul Eggert2017-05-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This incorporates: 2017-05-16 manywarnings: update for GCC 7 2017-05-15 sys_select: Avoid "was expanded before it was required" * configure.ac (nw): Suppress GCC 7’s new -Wduplicated-branches and -Wformat-overflow=2 options, due to too many false alarms. * doc/misc/texinfo.tex, lib/strftime.c, m4/manywarnings.m4: Copy from gnulib. * m4/gnulib-comp.m4: Regenerate. * src/coding.c (decode_coding_iso_2022): Fix bug uncovered by -Wimplicit-fallthrough. * src/conf_post.h (FALLTHROUGH): New macro. Use it to mark all switch cases that fall through. * src/editfns.c (styled_format): Use !, not ~, on bool. * src/gtkutil.c (xg_check_special_colors): When using sprintf, don’t trust Gtk to output colors in [0, 1] range. (xg_update_scrollbar_pos): Avoid use of possibly-uninitialized bool; this bug was actually caught by Clang. * src/search.c (boyer_moore): Tell GCC that CHAR_BASE, if nonzero, must be a non-ASCII character. * src/xterm.c (x_draw_glyphless_glyph_string_foreground): Tell GCC that glyph->u.glyphless.ch must be a character.
* Merge from origin/emacs-25Paul Eggert2017-01-011-1/+1
|\ | | | | | | | | 2e2a806 Fix copyright years by hand 5badc81 Update copyright year to 2017
| * Update copyright year to 2017Paul Eggert2016-12-311-1/+1
| | | | | | | | Run admin/update-copyright.
* | Merge from origin/emacs-25Paul Eggert2016-08-051-8/+6
|\ \ | |/ | | | | | | | | | | 9a41cd1 ; Fix typo 9356fe2 Expand FIXME near definition of fboundp 219b39f kill-rectangle should mention killed-rectangle 59fa4c3 Avoid assertion violations in nhexl-mode
| * Avoid assertion violations in nhexl-modeEli Zaretskii2016-07-161-8/+6
| | | | | | | | | | * src/bidi.c (bidi_resolve_neutral): Convert an assertion to real code executed in all builds. (Bug#24001)
* | Try to speed-up display of many all-blank linesEli Zaretskii2016-05-071-8/+2
|/ | | | | * src/bidi.c (bidi_initialize): Use anchored regexps for paragraph start and paragraph separator sequences. (Bug#23457)
* Doc fixes for fclist and grepPaul Eggert2016-05-051-2/+2
| | | | | | A newline is needed between two fc-list calls. egrep and fgrep have been withdrawn from POSIX, so document grep -E and grep -F instead.
* Port to strict C99 offsetofPaul Eggert2016-03-181-1/+1
| | | | | | | * src/bidi.c (bidi_copy_it): * src/lisp.h (CHAR_TABLE_EXTRA_SLOTS): Use only a single identifier as the second argument of offsetof. Found by using clang -pedantic.
* Rework C source files to avoid ^(Paul Eggert2016-03-101-2/+2
| | | | | | | | Work around Bug#22884 by rewording comments and strings to avoid ‘(’ at the start of a line unless it starts a function. This change is a short-term hack; in the longer run we plan to fix cc-mode’s performance for C files that have ‘(’ at the start of a line in a comment or string.
* Speed up redisplay of binary files with long series of nullsEli Zaretskii2016-03-061-6/+34
| | | | | | | | | | | | | | * src/bidi.c (bidi_resolve_weak): Avoid entering a loop searching for a character needed for resolving the type of a series of BN and ET characters, as required by rule W5 of UAX#9, if the results of the resolution are known in advance, because we are at level zero, and the previous strong character was L. (bidi_resolve_neutral): Partially resurrect the optimization for a long series of control characters in an otherwise strictly L2R text. (bidi_level_of_next_char): Don't enter the loop that searches for a paragraph separator if the current character is already at base embedding level. (Bug#22739)
* Fix reordering of bidi text in an isolate inside an overrideEli Zaretskii2016-03-011-5/+8
| | | | | | | | * src/bidi.c (bidi_resolve_explicit): Override the orig_type value of FSI with either LRI or RLI, as determined by the first strong directional character in the isolate. This prevents failure to isolate when the FSI...PDI text is inside a directional override. (Bug#22786)
* Expunge "allow" + infinitive from source and doc, part 2.Alan Mackenzie2016-01-251-1/+1
| | | | | | | | | | | | | | | | | | | Do the same for "permit", "enable", "prevent", and (where appropriate) "require". doc/misc/reftex.texi: doc/misc/url.texi: lib/get-permissions.c: lib/strftime.c: lisp/org/org-element.el: lisp/org/org-mobile.el: lisp/textmodes/reftex-vars.el: src/bidi.c: src/emacs.c: src/xdisp.c: test/etags/c-src/emacs/src/lisp.h: Expunge the likes of "This allows to do something" from the above files.
* Update copyright year to 2016Paul Eggert2016-01-011-1/+1
| | | | Run admin/update-copyright.
* Fix display of characters adjacent to ZWJ and ZWNJEli Zaretskii2015-10-061-6/+12
| | | | | | | * src/bidi.c (bidi_resolve_neutral): Treat all Bn (a.k.a. "control") characters the same as directional formatting controls. (bidi_level_of_next_char): Include all Bn characters in rule L1, as mandated by the UBA.
* Assume GC_MARK_STACK == GC_MAKE_GCPROS_NOOPSPaul Eggert2015-08-261-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the need for GCPRO1 etc. Suggested by Stefan Monnier in: http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00918.html * doc/lispref/internals.texi (Writing Emacs Primitives): * etc/NEWS: Document the change. * src/alloc.c (gcprolist, dump_zombies, MAX_ZOMBIES, zombies) (nzombies, ngcs, avg_zombies, max_live, max_zombies, avg_live) (Fgc_status, check_gcpros, relocatable_string_data_p, gc-precise): * src/bytecode.c (mark_byte_stack) [BYTE_MARK_STACK]: * src/eval.c (gcpro_level) [DEBUG_GCPRO]: * src/lisp.h (struct handler.gcpro, struct gcpro, GC_MARK_STACK) (GC_USE_GCPROS_AS_BEFORE, GC_MAKE_GCPROS_NOOPS) (GC_MARK_STACK_CHECK_GCPROS, GC_USE_GCPROS_CHECK_ZOMBIES) (BYTE_MARK_STACK, GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6) (GCPRO7, UNGCPRO, RETURN_UNGCPRO): Remove. All uses removed. The code now assumes GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS. * src/bytecode.c (relocate_byte_stack): Rename from unmark_byte_stack, since it now only relocates. All callers changed. * src/frame.c (make_frame): Add an IF_LINT to pacify GCC 5.2 with GCPROs removed. * src/systime.h: Use EMACS_LISP_H as the canary instead of GCPRO1. * test/automated/finalizer-tests.el (finalizer-basic) (finalizer-circular-reference, finalizer-cross-reference) (finalizer-error): * test/automated/generator-tests.el (cps-test-iter-close-finalizer): Remove tests, as they depend on gc-precise.
* Give names to Unicode code points in C codePaul Eggert2015-08-111-4/+4
| | | | | | | | | | | | | | | | | | * src/character.h (NO_BREAK_SPACE, SOFT_HYPHEN) (ZERO_WIDTH_NON_JOINER, ZERO_WIDTH_JOINER, HYPHEN) (NON_BREAKING_HYPHEN, LEFT_SINGLE_QUOTATION_MARK) (RIGHT_SINGLE_QUOTATION_MARK, PARAGRAPH_SEPARATOR) (LEFT_POINTING_ANGLE_BRACKET, RIGHT_POINTING_ANGLE_BRACKET) (LEFT_ANGLE_BRACKET, RIGHT_ANGLE_BRACKET) (OBJECT_REPLACEMENT_CHARACTER): New named constants for Unicode code points. * src/bidi.c (bidi_fetch_char, CANONICAL_EQU): * src/composite.c (char_composable_p): * src/lread.c (readevalloop, read1): * src/xdisp.c (get_next_display_element): Use them. * src/doc.c (LEFT_SINGLE_QUOTATION_POINT): Remove; now in character.h.
* ;* src/bidi.c (bpa_stack_entry): Update commentary for Unicode 8.0.Eli Zaretskii2015-07-021-1/+1
|
* Fix bidi_explicit_dir_char undefined behaviorPaul Eggert2015-02-081-0/+5
| | | | | * bidi.c (bidi_explicit_dir_char): Avoid subscript error when argument is BIDI_EOB. This can happen in bidi_level_of_next_char.
* Compute C decls for DEFSYMs automaticallyPaul Eggert2015-01-051-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes Bug#15880. This patch also makes Q constants (e.g., Qnil) constant addresses from the C point of view. * make-docfile.c: Revamp to generate table of symbols, too. Include <stdbool.h>. (xstrdup): New function. (main): Don't process the same file twice. (SYMBOL): New constant in enum global_type. (struct symbol): Turn 'value' member into a union, either v.value for int or v.svalue for string. All uses changed. (add_global): New arg svalue, which overrides value, so that globals can have a string value. (close_emacs_global): New arg num_symbols; all uses changed. Output lispsym decl. (write_globals): Output symbol globals too. Output more ATTRIBUTE_CONST, now that Qnil etc. are C constants. Output defsym_name table. (scan_c_file): Move most of guts into ... (scan_c_stream): ... new function. Scan for DEFSYMs and record symbols found. Don't read past EOF if file doesn't end in newline. * alloc.c, bidi.c, buffer.c, bytecode.c, callint.c, casefiddle: * casetab.c, category.c, ccl.c, charset.c, chartab.c, cmds.c, coding.c: * composite.c, data.c, dbusbind.c, decompress.c, dired.c, dispnew.c: * doc.c, editfns.c, emacs.c, eval.c, fileio.c, fns.c, font.c, fontset.c: * frame.c, fringe.c, ftfont.c, ftxfont.c, gfilenotify.c, gnutls.c: * image.c, inotify.c, insdel.c, keyboard.c, keymap.c, lread.c: * macfont.m, macros.c, minibuf.c, nsfns.m, nsfont.m, nsimage.m: * nsmenu.m, nsselect.m, nsterm.m, print.c, process.c, profiler.c: * search.c, sound.c, syntax.c, term.c, terminal.c, textprop.c, undo.c: * window.c, xdisp.c, xfaces.c, xfns.c, xftfont.c, xmenu.c, xml.c: * xselect.c, xsettings.c, xterm.c: Remove Q vars that represent symbols (e.g., Qnil, Qt, Qemacs). These names are now defined automatically by make-docfile. * alloc.c (init_symbol): New function. (Fmake_symbol): Use it. (c_symbol_p): New function. (valid_lisp_object_p, purecopy): Use it. * alloc.c (marked_pinned_symbols): Use make_lisp_symbol instead of make_lisp_ptr. (garbage_collect_1): Mark lispsym symbols. (CHECK_ALLOCATED_AND_LIVE_SYMBOL): New macro. (mark_object): Use it. (sweep_symbols): Sweep lispsym symbols. (symbol_uses_obj): New function. (which_symbols): Use it. Work for lispsym symbols, too. (init_alloc_once): Initialize Vpurify_flag here; no need to wait, since Qt's address is already known now. (syms_of_alloc): Add lispsym count to symbols_consed. * buffer.c (init_buffer_once): Compare to Qnil, not to make_number (0), when testing whether storage is all bits zero. * dispextern (struct image_type): * font.c (font_property_table): * frame.c (struct frame_parm_table, frame_parms): * keyboard.c (scroll_bar_parts, struct event_head): * xdisp.c (struct props): Use XSYMBOL_INIT (Qfoo) and struct Lisp_Symbol * rather than &Qfoo and Lisp_Object *, since Qfoo is no longer an object whose address can be taken. All uses changed. * eval.c (run_hook): New function. Most uses of Frun_hooks changed to use it, so that they no longer need to take the address of a Lisp sym. (syms_of_eval): Don't use DEFSYM on Vrun_hooks, as it's a variable. * frame.c (syms_of_frame): Add defsyms for the frame_parms table. * keyboard.c (syms_of_keyboard): Don't DEFSYM Qmenu_bar here. DEFSYM Qdeactivate_mark before the corresponding var. * keymap.c (syms_of_keymap): Use DEFSYM for Qmenu_bar and Qmode_line instead of interning their symbols; this avoids duplicates. (LISP_INITIALLY, TAG_PTR) (DEFINE_LISP_SYMBOL_BEGIN, DEFINE_LISP_SYMBOL_END, XSYMBOL_INIT): New macros. (LISP_INITIALLY_ZERO): Use it. (enum symbol_interned, enum symbol_redirect, struct Lisp_Symbol) (EXFUN, DEFUN_ARGS_MANY, DEFUN_ARGS_UNEVALLED, DEFUN_ARGS_*): Move decls up, to avoid forward uses. Include globals.h earlier, too. (make_lisp_symbol): New function. (XSETSYMBOL): Use it. (DEFSYM): Now just a placeholder for make-docfile. * lread.c (DEFINE_SYMBOLS): Define, for globals.h. (intern_sym): New function, with body taken from old intern_driver. (intern_driver): Use it. Last arg is now Lisp integer, not ptrdiff_t. All uses changed. (define_symbol): New function. (init_obarray): Define the C symbols taken from lispsym. Use plain DEFSYM for Qt and Qnil. * syntax.c (init_syntax_once): No need to worry about Qchar_table_extra_slots.
* Update copyright year to 2015Paul Eggert2015-01-011-1/+1
| | | | Run admin/update-copyright.
* Minor cleanups for Lisp objects and symbolsPaul Eggert2014-12-181-4/+2
| | | | | | | | | | | | | | | | | | | | | | | * alloc.c (next_vector, set_next_vector): * lisp.h (lisp_h_INTEGERP, make_number, XFASTINT, make_natnum): (lisp_h_make_number) [USE_LSB_TAG]: Use Lisp_Int0 instead of the mystery constant 0. * alloc.c (mark_object): Always set and use po; that's simpler. (CHECK_LIVE, CHECK_ALLOCATED_AND_LIVE): Properly parenthesize definientia. * bidi.c (bidi_initialize): * buffer.c (init_buffer_once): * nsfns.m (syms_of_nsfns): * nsmenu.m (syms_of_nsmenu): * nsselect.m (syms_of_nsselect): Prefer DEFSYM to defining by hand. * data.c: Fix too-long line. * lisp.h (DECLARE_GDB_SYM): New macro. (DEFINE_GDB_SYMBOL_BEGIN): Use it. (DEFINE_GDB_SYMBOL_BEGIN, DEFINE_GDB_SYMBOL_END) [!MAIN_PROGRAM]: Declare the symbol, so it's visible to everywhere lisp.h is included. Move forward decls as far forward as they can go, to allow future changes to use them.
* Fix out-of-memory condition in display of long bracketed lines (bug#19322)Eli Zaretskii2014-12-101-31/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | src/bidi.c (BIDI_CACHE_MAX_ELTS_PER_SLOT): New macro. (bidi_cache_max_elts): New global variable. (bidi_shelve_header_size): Add the sizeof bidi_cache_max_elts. (bidi_cache_shrink, bidi_initialize): Reset bidi_cache_max_elts to its initial value. (bidi_cache_search): Handle overflown cache. Improve commentary. (bidi_cache_ensure_space): Limit allocations to the current value of bidi_cache_max_elts. Force xpalloc not to over-allocate. If less than a full BIDI_CACHE_CHUNK is left to the limit, decrease the increment to not exceed the limit. (bidi_cache_iterator_state): Now returns non-zero if succeeded to cache, zero otherwise (meaning the cache overflowed). In the latter case, set bidi_cache_last_idx to -1. (bidi_peek_at_next_level): Handle overflown cache. (bidi_push_it): Increase the cache limit for iterating the new object. (bidi_pop_it): Decrease the cache limit back to previous value. (bidi_shelve_cache): Shelve the current value of the cache limit. (bidi_unshelve_cache): Restore the value of cache limit. (bidi_find_bracket_pairs): If the cache overflows while looking for the paired bracket, give up and let bidi_resolve_neutrals process the bracket as a simple neutral. (bidi_find_other_level_edge): If the cache overflows, fall back on Plan B, which effectively stops the reordering and restarts it on the next character (after resetting the cache). (bidi_move_to_visually_next): When the cache overflows, reset it after processing the last cached character.
* Reduce memory footprint of struct bidi_it by a factor of 5.Eli Zaretskii2014-12-051-29/+35
| | | | | | | | | | | | | | | | | src/dispextern.h (enum bidi_dir_t): Force NEUTRAL_DIR to be zero. (struct bidi_stack): Reduce size by using bit fields and by packing sos, override, and isolate_status into a single 8-bit byte called 'flags'. src/bidi.c (ISOLATE_STATUS, OVERRIDE): New macros. (bidi_push_embedding_level): Construct flags from individual bits. Adapt to changes in prev_for_neutral and next_for_neutral members. (bidi_pop_embedding_level): Use ISOLATE_STATUS. Extract 'sos' from flags. Adapt to changes in prev_for_neutral, next_for_neutral, and last_strong members. (bidi_line_init): Initialize flags to zero. (bidi_resolve_explicit, bidi_resolve_weak, bidi_resolve_brackets) (bidi_resolve_neutral): Use ISOLATE_STATUS and OVERRIDE.
* Allow to search for characters whose bidi directionality was overridden.Eli Zaretskii2014-12-021-0/+27
| | | | | | | | | | | | src/bidi.c (bidi_find_first_overridden): New function. src/xdisp.c (Fbidi_find_overridden_directionality): New function. (syms_of_xdisp): Defsubr it. src/dispextern.h (bidi_find_first_overridden): Add prototype. doc/lispref/display.texi (Bidirectional Display): Document 'bidi-find-overridden-directionality'. etc/NEWS: Mention 'bidi-find-overridden-directionality'.
* Minor fix in bidi.c:bidi_cache_reset_to.Eli Zaretskii2014-10-301-6/+5
| | | | | | | src/bidi.c (bidi_cache_reset_to): Invalidate bidi_cache_last_idx by setting it to -1. (bidi_find_bracket_pairs): Pass to bidi_cache_reset_to a relative index, not an absolute one, as that's what the function expects.
* A possible fix for bug #18815 with assertion violations in bidi.c.Eli Zaretskii2014-10-241-6/+16
| | | | | | src/bidi.c (bidi_resolve_explicit, bidi_find_bracket_pairs) (bidi_resolve_brackets): Use end of string position rather than ZV when iterating over a string.
* Fix bug #18778 with slow redisplay of bracketed L2R text with long lines.Eli Zaretskii2014-10-221-20/+114
| | | | | | | | | | | | | | | | | | | | src/bidi.c (bidi_cache_reset_to): New function. (bidi_cache_reset): Call it. (bidi_init_it, bidi_line_init): Initialize the bracket_pairing_pos member to -1. (bidi_resolve_explicit): Reset bracket_pairing_pos and bracket_enclosed_type only if bracket_pairing_pos's value is not ZV. (MAX_BPA_STACK): Make sure the value is signed. (PUSH_BPA_STACK): If the BPA stack overflows, don't bail out, but stop pushing values onto the stack. (bidi_find_bracket_pairs): If the bracketed text is only on the base embedding level, remove all the states cached by this function from the cache, and return zero, so that the brackets in this segment of text are processed as normal neutrals. (bidi_resolve_brackets): Detect the brackets that are to be processed as neutrals, and don't call bidi_find_bracket_pairs on them.
* Spelling and grammar fixes in comments.Paul Eggert2014-10-201-3/+3
|
* Add support for canonically equivalent bracket characters.Eli Zaretskii2014-10-181-11/+48
|
* Move cache retrieval on forwards scans to bidi_resolve_brackets.Eli Zaretskii2014-10-181-89/+61
|
* Fix processing of brackets in isolates and crash in w32select.c.Eli Zaretskii2014-10-181-9/+15
|
* Fix a typo in a comment.Eli Zaretskii2014-10-161-1/+1
|
* Cherry-pick a fix from trunk; fix level handling in bidi_resolve_brackets.Eli Zaretskii2014-10-161-13/+47
|
* Fix initialization of flags when pushing BPA stack.Eli Zaretskii2014-10-151-0/+1
|
* Rewrote bracket resolution to match subtleties of Reference Implementation.Eli Zaretskii2014-10-151-109/+144
|
* Fix resolution of neutrals that came out of the cache.Eli Zaretskii2014-10-141-3/+23
|
* Increase 'level' in glyph struct; convert bad type aborts into assertions.Eli Zaretskii2014-10-141-0/+3
|
* 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
|