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

From: martin rudalics <[email-masked]>
Date: Sat, 12 Jan 2013 19:01:16 +0100

>> But PARTIALLY nil means to return nil if the position is only partially
 >> visible.  And in this case `fit-window-to-buffer' should try to enlarge
 >> the window.
 >
 > Should it?  It enlarges the window in line units, so the enlarged
 > window will again show a partially visible line, no?

That's the clue.  The bug is in this part of `fit-window-to-buffer':

	    (if (zerop delta)
		;; Return zero if DELTA became zero in the process.
		0

The delta comes from `count-screen-lines' and that function returns the
number of lines in the buffer but NOT in canonical line units.  Removing
this conditional now seems to fix the problem for sure.

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.

martin