From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Word wrap for non-whitespace-seperated language Date: Wed, 4 Mar 2020 13:39:34 -0500 Message-ID: Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_CF5AABF6-4182-4CD2-AF22-43D3C2E3EADA" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="2608"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 04 19:40:31 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j9YwW-0000W4-CE for ged-emacs-devel@m.gmane-mx.org; Wed, 04 Mar 2020 19:40:28 +0100 Original-Received: from localhost ([::1]:38230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9YwV-0001O4-DA for ged-emacs-devel@m.gmane-mx.org; Wed, 04 Mar 2020 13:40:27 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60965) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9Yvk-0000pP-M2 for emacs-devel@gnu.org; Wed, 04 Mar 2020 13:39:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9Yvj-0003Cn-IL for emacs-devel@gnu.org; Wed, 04 Mar 2020 13:39:40 -0500 Original-Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]:38781) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j9Yvj-0003C6-BA for emacs-devel@gnu.org; Wed, 04 Mar 2020 13:39:39 -0500 Original-Received: by mail-qk1-x734.google.com with SMTP id j7so2416188qkd.5 for ; Wed, 04 Mar 2020 10:39:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:message-id:date:to; bh=E7oWQj6oeTgb3qaBGw1Xwu9xougDSnTubuVCShR/KAQ=; b=YBWLOknHKpcH1VK/MgwPufdut0Zkytc4jwS6pGqrJ9BDsumSfHFZeZ+wRJ8V7ZSJeq b9wmrryaOQwM524/Avlg4qSJ/BYtYwsZxdOvAiKe+qsMMHBsbqCjSPxO61s9U+DxhAMu GBbO0B/8WWMmbxCkRpQAcsB25bvLFBGOIdjXzmJj/RgOFB/HMwD2/oWeNpOXUXYXObGt cruTZfgmPXcucRh3W6RVDY6YgjNvj4h8OgUTViycyg+H5VR5u8HA5xzvYjzbgGCQhUAu gD3vJD/CxDSl6VO68AGCt3zBYaihY0vMAIDkIQ427CXu1PQlc+fiAh0hBuFR8z3fjhWQ 8x2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:message-id:date:to; bh=E7oWQj6oeTgb3qaBGw1Xwu9xougDSnTubuVCShR/KAQ=; b=GDlOJzfUxQjjJnfD4Duw/nwU3AZPtqSJVPf+pyoI873dCD4LsLm93XCMFJD9Tg8Bqv uw7qbkSjxV5n2+WC7o/bOKlC0Vv9yX1pzqCd1sqjhpHv9F9iExh5DiYJiSWHmxgwGa0F IOe7aVH+0lTxBrdVALJV95WSaiA3o/uqN8PsZJFFb3+3rLKQbbQ5NygTJuQvbeCOBx9r s6O1PWZJWMy+lGMQS8H9cgv1WDzgJiKdAC5S/ulyUhuFz93y3A8tb3MsS43l79Uqdjty Ui7V7lFDqlKAxnJ34nicS501L/Xdl1VgeiJdHt/Won76TOR1D55sTHvQp5iHdiUKQy3R Hn2w== X-Gm-Message-State: ANhLgQ1tu20Fv+wEIb/rT2bV1obdVYZ+s10oF7seMJXjTpw3PqEhN1kA rh8T0MchSngQICyLbpZdmsU11KX6noDG3w== X-Google-Smtp-Source: ADFU+vuF/hYBagtXIWufwOa9I1Fods0OxP7K7t+iiUCwjPtuBnIJhM0sZjJ3Y710EowlUlIbSsio3Q== X-Received: by 2002:a05:620a:a94:: with SMTP id v20mr4169981qkg.153.1583347178279; Wed, 04 Mar 2020 10:39:38 -0800 (PST) Original-Received: from [104.39.190.53] ([104.39.190.53]) by smtp.gmail.com with ESMTPSA id p18sm14249654qkp.47.2020.03.04.10.39.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Mar 2020 10:39:37 -0800 (PST) X-Mailer: Apple Mail (2.3608.60.0.2.5) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::734 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:245233 Archived-At: --Apple-Mail=_CF5AABF6-4182-4CD2-AF22-43D3C2E3EADA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Emacs word wrap tries to only wrap at whitespace and tabs; that = doesn=E2=80=99t work well when I mix, say, Chinese with English: since = Chinese doesn=E2=80=99t have spaces between words, Emacs couldn=E2=80=99t = find whitespaces to wrap a line, and it could happen that the line is = wrapped very early, far from the right fringe. For example: = =E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6= =B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B= =B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92= =E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6= =B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B= =B1=E6=96=87=E6=B7=B7 =E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6= =96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92 = English English = =E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6= =B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B= =B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92= =E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6= =B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B= =B1=E6=96=87=E6=B7=B7 The ideal wrapping is = =E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6= =B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B= =B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92= =E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6= =B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B= =B1=E6=96=87=E6=B7=B7 =E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6= =96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92 = English English =E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B= =B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92= =E4=B8=AD=E8=8B=B1 = =E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4= =B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7= =B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1= =E6=96=87=E6=B7=B7 It would be nice if word wrap knows when to wrap on whitespaces and when = to simply wrap between characters. Is the wrapping feature implemented = in redisplay engine? Or in lisp? The word-wrap variable is defined in = buffer.c but I didn=E2=80=99t find the word wrap code in buffer.c. If = it=E2=80=99s in lisp maybe I can hack on it. Yuan --Apple-Mail=_CF5AABF6-4182-4CD2-AF22-43D3C2E3EADA Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Emacs= word wrap tries to only wrap at whitespace and tabs; that doesn=E2=80=99t= work well when I mix, say, Chinese with English: since Chinese = doesn=E2=80=99t have spaces between words, Emacs couldn=E2=80=99t find = whitespaces to wrap a line, and it could happen that the line is wrapped = very early, far from the right fringe. For example:

=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1= =E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4= =B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7= =B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1= =E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4= =B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7
=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD= =E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6= =8E=92 English English
=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1= =E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4= =B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7= =B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1= =E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4= =B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7

The ideal wrapping is

=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1= =E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4= =B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7= =B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1= =E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4= =B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7
=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD= =E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6= =8E=92 English English = =E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6= =B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B= =B1
=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7= =E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6= =96=87=E6=B7=B7=E6=8E=92=E4=B8=AD=E8=8B=B1=E6=96=87=E6=B7=B7=E6=8E=92=E4=B8= =AD=E8=8B=B1=E6=96=87=E6=B7=B7

It would be nice if word wrap knows = when to wrap on whitespaces and when to simply wrap between characters. = Is the wrapping feature implemented in redisplay engine? Or in lisp? The = word-wrap variable is defined in buffer.c but I didn=E2=80=99t find the = word wrap code in buffer.c. If it=E2=80=99s in lisp maybe I can hack on = it.

Yuan


= --Apple-Mail=_CF5AABF6-4182-4CD2-AF22-43D3C2E3EADA--