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

From: Eli Zaretskii <[email-masked]>
Date: Sat, 12 Jan 2013 20:38:35 +0200

> Date: Sat, 12 Jan 2013 19:01:16 +0100
> From: martin rudalics <[email-masked]>
> CC: [email-masked], [email-masked]
> 
> Still `fit-window-to-buffer' would benefit from a function that returned
> either the pixel height needed for displaying the region or its number
> of canonical line units.  Obviously, the former would be preferable when
> we switch to pixel-sized windows.

Would something like this be good enough?

  (save-excursion
    (move-beginning-of-line 1)
    (setq pos1 (posn-at-point)))
  (save-excursion
    (move-beginning-of-line 2)
    (setq pos2 (posn-at-point)))

Then use the Y member of the returned information in pos1 and pos2.
(Alternatively, you could do something similar with
pos-visible-in-window-p instead of posn-at-point.)  Will this fit the
bill?