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: Eli Zaretskii <eliz <at> gnu.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 13399 <at> debbugs.gnu.org
Subject: bug#13399: 24.3.50; Word-wrap can't wrap at zero-width space U-200B
Date: Sun, 03 Feb 2013 21:45:29 +0200
> Date: Sun, 03 Feb 2013 19:57:31 +0100
> From: martin rudalics <rudalics <at> gmx.at>
> CC: 13399 <at> debbugs.gnu.org
> 
> I now rewrote IT_DISPLAYING_WHITESPACE as
> 
> #define IT_DISPLAYING_WHITESPACE(it)					\
>    ((it->what == IT_CHARACTER						\
>      && !NILP (CHAR_TABLE_REF (Vword_wrap_chars, it->c)))		\
>     || ((STRINGP (it->string)						\
> 	&& !NILP (CHAR_TABLE_REF					\
> 		   (Vword_wrap_chars,					\
> 		      SREF (it->string, IT_STRING_BYTEPOS (*it)))))	\
>         || (it->s && !NILP (CHAR_TABLE_REF				\
> 			    (Vword_wrap_chars,				\
> 			       it->s[IT_BYTEPOS (*it)])))		\
>         || (IT_BYTEPOS (*it) < ZV_BYTE					\
> 	   && !NILP (CHAR_TABLE_REF					\
> 		      (Vword_wrap_chars,				\
> 			 (*BYTE_POS_ADDR (IT_BYTEPOS (*it))))))))	\
> 
> 
> and have a character table called `word-wrap-chars' such that
> (aref word-wrap-chars ?​) returns t, but it doesn't wrap at a
> U-200B character.  Is there some additional wrinkle like some
> hardcoded space/tab in the word-wrap code I have to observe?
> Or is my code wrong?

Does CHAR_TABLE_REF return the right value?

Also, the code is wrong here:

   SREF (it->string, IT_STRING_BYTEPOS (*it))

and here:

   it->s[IT_BYTEPOS (*it)]

and here:

   *BYTE_POS_ADDR (IT_BYTEPOS (*it))

in that that it assumes the character is always one byte, which is
clearly wrong with non-ASCII characters.  You should instead use
FETCH_CHAR and STRING_CHAR.





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.