diff options
Diffstat (limited to 'src/bidi.c')
| -rw-r--r-- | src/bidi.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/bidi.c b/src/bidi.c index f4bca186177..9cf53787c4b 100644 --- a/src/bidi.c +++ b/src/bidi.c | |||
| @@ -367,6 +367,8 @@ bidi_isolate_fmt_char (bidi_type_t ch_type) | |||
| 367 | return (ch_type == LRI || ch_type == RLI || ch_type == PDI || ch_type == FSI); | 367 | return (ch_type == LRI || ch_type == RLI || ch_type == PDI || ch_type == FSI); |
| 368 | } | 368 | } |
| 369 | 369 | ||
| 370 | static void bidi_initialize (void); | ||
| 371 | |||
| 370 | /* Return the mirrored character of C, if it has one. If C has no | 372 | /* Return the mirrored character of C, if it has one. If C has no |
| 371 | mirrored counterpart, return C. | 373 | mirrored counterpart, return C. |
| 372 | Note: The conditions in UAX#9 clause L4 regarding the surrounding | 374 | Note: The conditions in UAX#9 clause L4 regarding the surrounding |
| @@ -381,6 +383,14 @@ bidi_mirror_char (int c) | |||
| 381 | if (c < 0 || c > MAX_CHAR) | 383 | if (c < 0 || c > MAX_CHAR) |
| 382 | emacs_abort (); | 384 | emacs_abort (); |
| 383 | 385 | ||
| 386 | /* We can be called at the very beginning of init_iterator, via | ||
| 387 | produce_special_glyphs, and the first such call in a session might | ||
| 388 | happen when the bidi-mirroring table was not yet initialized. Make | ||
| 389 | sure we do this now. */ | ||
| 390 | if (!CHAR_TABLE_P (bidi_mirror_table) | ||
| 391 | && !bidi_initialized) | ||
| 392 | bidi_initialize (); | ||
| 393 | |||
| 384 | val = CHAR_TABLE_REF (bidi_mirror_table, c); | 394 | val = CHAR_TABLE_REF (bidi_mirror_table, c); |
| 385 | if (FIXNUMP (val)) | 395 | if (FIXNUMP (val)) |
| 386 | { | 396 | { |