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

From: Eli Zaretskii <[email-masked]>
Date: Fri, 11 Jan 2013 21:29:19 +0200

> From: Stefan Monnier <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>,  [email-masked]
> Date: Fri, 11 Jan 2013 13:50:00 -0500
> 
> > How could `posn-at-point' possibly work if the display is not up to
> > date?
> 
> Actually, it does not require the display to be up-to-date, only the
> glyph-matrices.

No, you cannot have up-to-date glyph matrices without triggering
redisplay.  Updating the glyph matrices is the first stage of
redisplay (the second stage being updating the windows using the
differences between the "current" and the "desired" glyph matrices).

What you mean is use move_it_* family of functions.  These _simulate_
redisplay by computing all the metrics of all the characters they move
across, but without producing glyphs and glyph matrices.  Because you
don't actually need the glyph matrices for the task at hand, you only
need the metrics of each display line (its ascent, descent, and pixel
width), and those are computed and tracked by the display iterator
even if no glyphs are produced.

> You should be able to update the glyph-matrices without causing the
> display to immediately reflect the changes.  E.g. window-end with
> a non-nil `update' argument should do that, IIUC.

window-end with a non-nil UPDATE arg uses the above mentioned
technique: it calls move_it_vertically, which moves through the lines
computing their metrics, but doesn't produce any glyphs.