From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#13399: 24.3.50; Word-wrap can't wrap at zero-width space U-200B Date: Sun, 03 Feb 2013 19:57:31 +0100 Message-ID: <510EB31B.1070809@gmx.at> References: <50EE7BE5.2060806@gmx.at> <83hamohmtj.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1359917895 4792 80.91.229.3 (3 Feb 2013 18:58:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Feb 2013 18:58:15 +0000 (UTC) Cc: 13399@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 03 19:58:35 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U24lu-000548-4j for geb-bug-gnu-emacs@m.gmane.org; Sun, 03 Feb 2013 19:58:34 +0100 Original-Received: from localhost ([::1]:34624 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U24lb-0006n6-SO for geb-bug-gnu-emacs@m.gmane.org; Sun, 03 Feb 2013 13:58:15 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:40819) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U24lY-0006n1-9s for bug-gnu-emacs@gnu.org; Sun, 03 Feb 2013 13:58:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U24lO-0005fw-3g for bug-gnu-emacs@gnu.org; Sun, 03 Feb 2013 13:58:12 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U24lN-0005fr-TP for bug-gnu-emacs@gnu.org; Sun, 03 Feb 2013 13:58:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U24mL-0008Mz-Qx for bug-gnu-emacs@gnu.org; Sun, 03 Feb 2013 13:59:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 Feb 2013 18:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13399 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13399-submit@debbugs.gnu.org id=B13399.135991793332157 (code B ref 13399); Sun, 03 Feb 2013 18:59:01 +0000 Original-Received: (at 13399) by debbugs.gnu.org; 3 Feb 2013 18:58:53 +0000 Original-Received: from localhost ([127.0.0.1]:34549 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U24mC-0008Mb-Qa for submit@debbugs.gnu.org; Sun, 03 Feb 2013 13:58:53 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]:62539) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U24mA-0008MS-DY for 13399@debbugs.gnu.org; Sun, 03 Feb 2013 13:58:51 -0500 Original-Received: from mailout-de.gmx.net ([10.1.76.12]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0Mfl5W-1UN1xY1DHA-00N89n for <13399@debbugs.gnu.org>; Sun, 03 Feb 2013 19:57:48 +0100 Original-Received: (qmail invoked by alias); 03 Feb 2013 18:57:39 -0000 Original-Received: from 62-47-33-209.adsl.highway.telekom.at (EHLO [62.47.33.209]) [62.47.33.209] by mail.gmx.net (mp012) with SMTP; 03 Feb 2013 19:57:39 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18NMpNenoMNutKfGb5/DSYmlUu7erYNoinVhwR4Su Fb5xLsKBIURPCx In-Reply-To: <83hamohmtj.fsf@gnu.org> X-Y-GMX-Trusted: 0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:70652 Archived-At: Just to recite the initial problem and your proposal: >> With emacs -Q evaluate >> >> (with-current-buffer (get-buffer-create "*foo*") >> (dotimes (i 1000) >> (insert "1234=E2=80=8B")) ; U-200B >> (setq word-wrap t) >> (display-buffer "*foo*")) >> >> where the character after 1234 is a zero-width space character with >> unicode code point U-200B. 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. > >> Doing >> >> (with-current-buffer (get-buffer-create "*foo*") >> (dotimes (i 1000) >> (insert "1234 ")) >> (setq word-wrap t) >> (display-buffer "*foo*")) >> >> instead wraps lines as expected. > > If anything, this is a missing feature, since word-wrap is explicitly > coded to break lines only on SPC and TAB characters. See the > IT_DISPLAYING_WHITESPACE macro in xdisp.c. > > 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. I now rewrote IT_DISPLAYING_WHITESPACE as #define IT_DISPLAYING_WHITESPACE(it) \ ((it->what =3D=3D 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 ?=E2=80=8B) 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? Thanks, martin