aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorEli Zaretskii2014-10-15 17:11:25 +0300
committerEli Zaretskii2014-10-15 17:11:25 +0300
commited7ebd933a5294e0f27cb49268e7b6376de36648 (patch)
tree90256953a29fa18f4cfb3945a6491567f8a8a6d0 /doc
parent0b4d6d30be2822df7d6b086bbab32b8ff419ed5d (diff)
parentb8ec977659df3970a6c8afb7a5b79c9b61e08307 (diff)
downloademacs-ed7ebd933a5294e0f27cb49268e7b6376de36648.tar.gz
emacs-ed7ebd933a5294e0f27cb49268e7b6376de36648.zip
Update the bidirectional reordering engine for Unicode 6.3 and 7.0.
src/bidi.c (bidi_ignore_explicit_marks_for_paragraph_level): Remove variable. (bidi_get_type): Return the isolate initiators and terminator types. (bidi_isolate_fmt_char, bidi_paired_bracket_type) (bidi_fetch_char_skip_isolates, find_first_strong_char) (bidi_find_bracket_pairs, bidi_resolve_brackets): New functions. (bidi_set_sos_type): Renamed from bidi_set_sor_type and updated for the new features. (bidi_push_embedding_level, bidi_pop_embedding_level): Update to push and pop correctly for isolates. (bidi_remember_char): Modified to accept an additional argument and record the bidi type according to its value. (bidi_cache_iterator_state): Accept an additional argument to only update an existing state. Handle the new members of struct bidi_it. (bidi_cache_find): Arguments changed: no lnger accepts a level, instead accepts a flag telling it whether it is okay to return unresolved neutrals. (bidi_initialize): Initiate and staticpro the bracket-type uniprop table. Initialize new isolate-related members. (bidi_paragraph_init): Some code factored out into find_first_strong_char. (bidi_resolve_explicit_1): Function deleted, its code incorporated into bidi_resolve_explicit. (bidi_resolve_explicit): Support the isolate initiators and terminator. Fix handling of embeddings and overrides according to new UBA requirements. Record information about previously seen characters here (moved from bidi_level_of_next_char). (bidi_resolve_weak): Adapt to changes in struct members. (FLAG_EMBEDDING_INSIDE, FLAG_OPPOSITE_INSIDE, MAX_BPA_STACK) (STORE_BRACKET_CHARPOS, PUSH_BPA_STACK): New macros. (bidi_resolve_neutral): Call bidi_resolve_brackets to handle the paired bracket resolution. Handle isolate initiators and terminator. (bidi_type_of_next_char): Remove unneeded code for BN limit. (bidi_level_of_next_char): Move the code that records information about previous characters to bidi_resolve_explicit. Fix logic of resolving neutrals and make sure their cache entries are updated. Remove now unneeded special handling of PDF level. src/dispextern.h (struct glyph): Enlarge the width of resolved_level. (BIDI_MAXDEPTH): New macro, renamed from BIDI_MAXLEVEL and enlarged per Unicode 6.3. (enum bidi_bracket_type_t): New data type. (struct bidi_saved_info): Leave only 2 type members out of 4. Remove bytepos. (struct bidi_stack): Add members necessary to support isolating sequences. (struct bidi_it): Add new members necessary to support isolating sequences and bracket pair resolution. src/xdisp.c (Fbidi_resolved_levels): New function. (syms_of_xdisp): Defsubr it. (append_glyph, append_composite_glyph, produce_image_glyph) (append_stretch_glyph, append_glyphless_glyph): Convert aborts to assertions. (syms_of_xdisp) <inhibit-bidi-mirroring>: New variable. src/term.c (append_glyph, append_composite_glyph) (append_glyphless_glyph): Convert aborts to assertions. src/.gdbinit (pgx): Display the character codepoint, resolved level, and bidi type also for glyphless glyphs. lisp/simple.el (what-cursor-position): Update to support the new bidi characters. lisp/descr-text.el (describe-char): Update to support the new bidi characters. admin/unidata/unidata-gen.el (unidata-prop-alist): New properties 'paired-bracket' and 'bracket-type', in support of the UBA 6.3. (unidata-gen-table): Support PROP-IDX being a function. (unidata-describe-bidi-bracket-type, unidata-gen-brackets-list) (unidata-gen-bracket-type-list): New functions. (unidata-check): Support checking the 'bracket-type' attribute. (unidata-gen-files): Don't create backups for uni-*.el files. admin/unidata/Makefile.in (${unidir}/charprop.el): Depend on BidiMirroring.txt and BidiBrackets.txt. admin/unidata/BidiBrackets.txt: New file, from Unicode. etc/NEWS: Mention the UBA implementation update. etc/HELLO: Remove now unneeded directional control characters. doc/lispref/nonascii.texi (Character Properties): Document the new properties 'bracket-type' and 'paired-bracket'. doc/lisprefdisplay.texi (Bidirectional Display): Update the version of the UBA to which we are conforming. test/BidiCharacterTest.txt: New file, from Unicode. test/biditest.el: New file.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/ChangeLog8
-rw-r--r--doc/lispref/display.texi7
-rw-r--r--doc/lispref/nonascii.texi26
3 files changed, 37 insertions, 4 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 3955bd09b38..ad1f6a6d45a 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,11 @@
12014-10-15 Eli Zaretskii <eliz@gnu.org>
2
3 * nonascii.texi (Character Properties): Document the new
4 properties 'bracket-type' and 'paired-bracket'.
5
6 * display.texi (Bidirectional Display): Update the version of the
7 UBA to which we are conforming.
8
12014-10-13 Glenn Morris <rgm@gnu.org> 92014-10-13 Glenn Morris <rgm@gnu.org>
2 10
3 * Makefile.in (dist): Update for new output variables. 11 * Makefile.in (dist): Update for new output variables.
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 7248aa32a30..4cb06dd188f 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -6613,10 +6613,9 @@ positions do not increase monotonically with string or buffer
6613position. In performing this @dfn{bidirectional reordering}, Emacs 6613position. In performing this @dfn{bidirectional reordering}, Emacs
6614follows the Unicode Bidirectional Algorithm (a.k.a.@: @acronym{UBA}), 6614follows the Unicode Bidirectional Algorithm (a.k.a.@: @acronym{UBA}),
6615which is described in Annex #9 of the Unicode standard 6615which is described in Annex #9 of the Unicode standard
6616(@url{http://www.unicode.org/reports/tr9/}). Emacs currently provides 6616(@url{http://www.unicode.org/reports/tr9/}). Emacs provides a ``Full
6617a ``Non-isolate Bidirectionality'' class implementation of the 6617Bidirectionality'' class implementation of the @acronym{UBA},
6618@acronym{UBA}: it does not yet support the isolate directional 6618consistent with the requirements of the Unicode Standard v7.0.
6619formatting characters introduced with Unicode Standard v6.3.0.
6620 6619
6621@defvar bidi-display-reordering 6620@defvar bidi-display-reordering
6622If the value of this buffer-local variable is non-@code{nil} (the 6621If the value of this buffer-local variable is non-@code{nil} (the
diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi
index d5bfacca976..902eb405411 100644
--- a/doc/lispref/nonascii.texi
+++ b/doc/lispref/nonascii.texi
@@ -520,6 +520,24 @@ property to display mirror images of characters when appropriate
520(@pxref{Bidirectional Display}). For unassigned codepoints, the value 520(@pxref{Bidirectional Display}). For unassigned codepoints, the value
521is @code{nil}. 521is @code{nil}.
522 522
523@item paired-bracket
524Corresponds to the Unicode @code{Bidi_Paired_Bracket} property. The
525value of this property is the codepoint of a character's @dfn{paired
526bracket}, or @code{nil} if the character is not a bracket character.
527This establishes a mapping between characters that are treated as
528bracket pairs by the Unicode Bidirectional Algorithm; Emacs uses this
529property when it decides how to reorder for display parentheses,
530braces, and other similar characters (@pxref{Bidirectional Display}).
531
532@item bracket-type
533Corresponds to the Unicode @code{Bidi_Paired_Bracket_Type} property.
534For characters whose @code{paired-bracket} property is non-@code{nil},
535the value of this property is a symbol, either @code{o} (for opening
536bracket characters) or @code{c} (for closing bracket characters). For
537characters whose @code{paired-bracket} property is @code{nil}, the
538value is the symbol @code{n} (None). Like @code{paired-bracket}, this
539property is used for bidirectional display.
540
523@item old-name 541@item old-name
524Corresponds to the Unicode @code{Unicode_1_Name} property. The value 542Corresponds to the Unicode @code{Unicode_1_Name} property. The value
525is a string. Unassigned codepoints, and characters that have no value 543is a string. Unassigned codepoints, and characters that have no value
@@ -574,6 +592,14 @@ This function returns the value of @var{char}'s @var{propname} property.
574(get-char-code-property ?\u2163 'numeric-value) 592(get-char-code-property ?\u2163 'numeric-value)
575 @result{} 4 593 @result{} 4
576@end group 594@end group
595@group
596(get-char-code-property ?\( 'paired-bracket)
597 @result{} 41 ;; closing parenthesis
598@end group
599@group
600(get-char-code-property ?\) 'bracket-type)
601 @result{} c
602@end group
577@end example 603@end example
578@end defun 604@end defun
579 605