Subject: bug#13399: 24.3.50; Word-wrap can't wrap at zero-width space U-200B

From: Eli Zaretskii <[email-masked]>
Date: Fri, 08 Dec 2017 22:08:22 +0200

> Date: Fri, 08 Dec 2017 17:38:29 +0200
> From: Eli Zaretskii <[email-masked]>
> Cc: [email-masked]
> 
> >    || ((STRINGP (it->string)                        \
> >     && !NILP (CHAR_TABLE_REF                    \
> >           (Vword_wrap_chars, STRING_CHAR            \
> >            (SDATA (it->string) + IT_STRING_BYTEPOS (*it)))))    \
> >        || (it->s && !NILP (CHAR_TABLE_REF                \
> >                (Vword_wrap_chars,                \
> >                 STRING_CHAR(it->s + IT_BYTEPOS (*it)))))    \

One other thought: since TAB and SPC are single-byte characters,
whereas the other "whitespace" characters are not, supporting the
non-ASCII whitespace will be associated with some performance hit in
the display engine, because it requires a char-table look up and
fetching multibyte characters.  So perhaps we should allow the
word-wrap-chars char-table to be nil (and make that the default), and
in that case support only TAB and SPC as word-wrap characters.  This
would let the default configuration work as fast is it does now,
imposing the performance penalty only on those who want to support
more whitespace characters.

WDYT?