GNU bug report logs - #13399
24.3.50; Word-wrap can't wrap at zero-width space U-200B

Previous Next

Package: emacs;

Reported by: martin rudalics <rudalics <at> gmx.at>

Date: Thu, 10 Jan 2013 08:31:02 UTC

Severity: wishlist

Found in version 24.3.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 13399 <at> debbugs.gnu.org
Subject: bug#13399: 24.3.50; Word-wrap can't wrap at zero-width space U-200B
Date: Fri, 11 Jan 2013 09:16:45 +0100
>> As can be seen in the window showing *foo*,
>> lines are not regularly wrapped at that character.
>
> You mean, not wrapped at all.  Witness the continuation bitmaps in the
> fringes, which shouldn't appear when a line is wrapped.

I thought these bitmaps appear when a line is wrapped.

> If anything, this is a missing feature, since word-wrap is explicitly
> coded to break lines only on SPC and TAB characters.

The doc-string of `word-wrap' says

  When word-wrapping is on, continuation lines are wrapped at the space
  or tab character nearest to the right window edge

Since U-200B is a space character the line should wrap at it.  Also

  this character is intended for invisible word separation and for line
  break control; it has no width, but its presence between two
  characters does not prevent increased letter spacing in justification

and Emacs apparently does handle it specially since it reserves a few
pixels when drawing it.  But documentation on `word-wrap' is scarce ...

> See the
> IT_DISPLAYING_WHITESPACE macro in xdisp.c.

I tried to understand the code but failed.

> If we want to add more characters to the set, we should probably
> arrange a special char-table for this, and have it exposed to Lisp, so
> it could be customized.  Patches are welcome.

IIUC all breakable spaces are between U-2000 and U-200B so maybe a
character table is not needed.

Anway, exposing displayed text to Lisp would be great.  We'd just need
two functions - one that gets the pixel width of an arbitrary buffer
string wrt a specific window, and one that gets the pixel height of an
arbitrary buffer string (newlines ignored) wrt a specific window.  This
way we could get rid of lots of problems currently hidden in the display
engine ...

martin




This bug report was last modified 4 years and 244 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.