]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow disabling the BPA part of bidi reordering
authorEli Zaretskii <eliz@gnu.org>
Thu, 28 Nov 2019 15:00:33 +0000 (17:00 +0200)
committerEli Zaretskii <eliz@gnu.org>
Thu, 28 Nov 2019 15:00:33 +0000 (17:00 +0200)
* src/xdisp.c (syms_of_xdisp): New variable 'bidi-inhibit-bpa'.
* src/bidi.c (bidi_paired_bracket_type): If 'bidi-inhibit-bpa'
is non-nil, return BIDI_BRACKET_NONE for all characters.

* lisp/frame.el: Add 'bidi-inhibit-bpa' to the list of
variables whose changes require redisplay.  (Bug#38407)

lisp/frame.el
src/bidi.c
src/xdisp.c

index 1a15a4c9f266b8904ed8bdd09d11c7b67f2688f2..1d1dcab580d8fc407b291585fb4fe163ad9c436c 100644 (file)
@@ -2736,7 +2736,8 @@ See also `toggle-frame-maximized'."
         display-fill-column-indicator-column
         display-fill-column-indicator-character
         bidi-paragraph-direction
-        bidi-display-reordering))
+        bidi-display-reordering
+        bidi-inhibit-bpa))
 
 (provide 'frame)
 
index 1430d22331344b730c785cd64b21f174a5666276..cb94c4e0d7af45104b6e50c3d940de4312941401 100644 (file)
@@ -404,7 +404,7 @@ bidi_mirror_char (int c)
 static bidi_bracket_type_t
 bidi_paired_bracket_type (int c)
 {
-  if (c == BIDI_EOB)
+  if (c == BIDI_EOB || bidi_inhibit_bpa)
     return BIDI_BRACKET_NONE;
   if (c < 0 || c > MAX_CHAR)
     emacs_abort ();
index c4d23be4cded35d1fb63830f968a73867905a82e..2467b336f4a658fd6e6fee9b6f9e1dc91c906cb7 100644 (file)
@@ -34839,6 +34839,14 @@ Intended for use during debugging and for testing bidi display;
 see biditest.el in the test suite.  */);
   inhibit_bidi_mirroring = false;
 
+  DEFVAR_BOOL ("bidi-inhibit-bpa", bidi_inhibit_bpa,
+    doc: /* Non-nil means inhibit the Bidirectional Parentheses Algorithm.
+Disabling the BPA makes redisplay faster, but might produce incorrect
+display reordering of bidirectional text with embedded parentheses and
+other bracket characters whose 'paired-bracket' Unicode property is
+non-nil, see `get-char-code-property'.  */);
+  bidi_inhibit_bpa = false;
+
 #ifdef GLYPH_DEBUG
   DEFVAR_BOOL ("inhibit-try-window-id", inhibit_try_window_id,
               doc: /* Inhibit try_window_id display optimization.  */);