branch emacs-bidi is created

Kenichi Handa <[email protected]>
Newsgroups gmane.emacs.bidi
Message-ID <[email protected]>
I've just made a branch "emacs-bidi" and commited several
changes including Eli's bidi code so that people other than
I can start working on it.

But, although I can compile the code and start up Emacs,
when I set the buffer local variable enable-bidi-display,
Emacs crashes.   Eli, I need your help.

In the reseat_1 (in xdisp.c), I put this code.

  if (it->bidi_p)
    {
      bidi_init_it (pos.charpos, L2R, &it->bidi_it);
      bidi_get_next_char_visually (&it->bidi_it);

      pos.charpos = it->bidi_it.charpos;
      pos.bytepos = it->bidi_it.bytepos;
      it->current.pos = it->position = pos;
    }

But, as bidi_init_it doesn't set bidi_it->ch_len,
bidi_get_next_char_visually sets it->bidi_it.bytepos to less
than it->bidi_it.charpos.

bidi_init_it has this code:

bidi_init_it (int pos, bidi_dir_t dir, struct bidi_it *bidi_it)
{
  if (! bidi_initialized)
    bidi_initialize ();
  bidi_set_paragraph_end (bidi_it);
  bidi_it->charpos = pos;
  if (pos <= 0)
    {
      bidi_it->bytepos = bidi_it->charpos;
      bidi_it->ch_len = 1;	/* so that incrementing bytepos works */
    }
  else
    bidi_it->bytepos = CHAR_TO_BYTE (pos);

As POS is always greater than 0 when we are scanning a
buffer, bidi_it->ch_len is not set.

---
Ken'ichi HANDA
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.