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: Re: Line wrap reconsidered Date: Tue, 26 May 2020 16:31:36 -0400 Message-ID: <4895C6EE-5E1F-44BF-93C1-CC5F7C096F73@gmail.com> References: <92FF4412-04FB-4521-B6CE-52B08526E4E5@gmail.com> <878shfsq35.fsf@gnus.org> <83imgivjak.fsf@gnu.org> <83lfletr03.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="46567"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 26 22:32:25 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 1jdgFN-000C2E-RT for ged-emacs-devel@m.gmane-mx.org; Tue, 26 May 2020 22:32:25 +0200 Original-Received: from localhost ([::1]:59566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdgFM-0006xK-T9 for ged-emacs-devel@m.gmane-mx.org; Tue, 26 May 2020 16:32:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdgEf-0006WH-5d for emacs-devel@gnu.org; Tue, 26 May 2020 16:31:41 -0400 Original-Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]:46852) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jdgEe-0004Zq-3A; Tue, 26 May 2020 16:31:40 -0400 Original-Received: by mail-qt1-x835.google.com with SMTP id g18so430232qtu.13; Tue, 26 May 2020 13:31:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=D82U/52tfeR99eMbUyF3zthn1Wopl4aeNdYz30KI9Ts=; b=AQPwAVwyJEP2BGIU0kzGhtNJheC2/SaYra8kP27eg/GFhtDzba+nAOUSKLlDg2+XON S+3bQIiFYqdnNgTR4e8PyGgQUfbLy57flx74YvwtYuNHS4YQYOaVjva2d1Lq7ZVilqmh ody0gU/VVRBiH+9HWOAsPVq62dOXurMuhagSvorq9+XaClO+LuO8KiqGjnLv4Uv1TQ9t 0wo2/XinWOGooLlg9Z31yhd3XqyweKJG20NYOElWSMnpvfYzSUxLrUz/3fjDLkoe/Lwu aw+aLNMkQ0AUpUNWRuL2YTU5H45TgX1tDhebr5Y+QAQL4DLlS0EF5el28PsY8iR/ndt7 srMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=D82U/52tfeR99eMbUyF3zthn1Wopl4aeNdYz30KI9Ts=; b=hyCoW8F10fPBKotIpfNwZeDZB/KhwIGtDEeXGhm0cm9ClUVeAUf4TxevTfVAb6vVVy /IwMqHb4MzJZDzsPm7c2+OQPnntEhhx7J07YS7OBmZa6i8Y7XRyojnh5mdnGM+iFhguD zijr4Bz56NgrzfoLFg64WU7PMAjAoVWfLN39U9a2D+es2wPCoOToElRKh6iUQL2IO8Wj WE9aZcyp+tWDfkwT0ypHXe8fIfv1rzdCnQb+KAvKBFGcLNPuwiatABhfODUfNdl63fER ctCAIM3POtqVOkzEOjrpaNfhR1yUbuiIukUvvAImDm8R7MOgxCJmryrCcAQqBRJb10p4 8vMQ== X-Gm-Message-State: AOAM532Hl8lMtuSBvT4MhIUYhpq3dzY43uRlhMMz7WlXCmukKRNDZPqZ IQURLNBfmQOtlOBCbEb6WoF4qRRKJiq6wQ== X-Google-Smtp-Source: ABdhPJx1wKYJtLvaCAhFlRZYNq+xXvGgd/DvSRM5cwhW1BzO6onNWpPYCCm1vSK9JpfIYNpNOwbN1g== X-Received: by 2002:ac8:2397:: with SMTP id q23mr705358qtq.44.1590525097830; Tue, 26 May 2020 13:31:37 -0700 (PDT) Original-Received: from [192.168.1.10] (c-174-60-229-153.hsd1.pa.comcast.net. [174.60.229.153]) by smtp.gmail.com with ESMTPSA id b9sm603914qto.91.2020.05.26.13.31.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 May 2020 13:31:37 -0700 (PDT) In-Reply-To: <83lfletr03.fsf@gnu.org> X-Mailer: Apple Mail (2.3608.80.23.2.2) Received-SPF: pass client-ip=2607:f8b0:4864:20::835; envelope-from=casouri@gmail.com; helo=mail-qt1-x835.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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:251477 Archived-At: > On May 26, 2020, at 3:50 PM, Eli Zaretskii wrote: >=20 >> From: Yuan Fu >> Date: Tue, 26 May 2020 13:34:01 -0400 >> Cc: larsi@gnus.org, >> emacs-devel@gnu.org >>=20 >> I fixed the problems and it now works. If you apply the patch below = and load kinsaku.el, open the test.txt and M-x toggle-word-wrap. You = should see the text properly wrapped: wrapping between CJK characters = and whitespaces but not between ASCII characters. Also according to = kinsoku rules, CJK comma will not be placed at the beginning of a line; = CJK =E2=80=9C=E3=80=8A=E2=80=9D will not be place at the end of a line, = etc. >>=20 >> It determines whether we can wrap before/after a character by looking = at =E2=80=9C<=E2=80=9C, =E2=80=9C>=E2=80=9D and =E2=80=9C|=E2=80=9D = categories, roughly corresponding to =E2=80=9Cdon=E2=80=99t wrap = before=E2=80=9D, =E2=80=9Cdon=E2=80=99t wrap after=E2=80=9D and =E2=80=9Cw= rap before and after=E2=80=9D.=20 >=20 > Thanks. >=20 > This still doesn't support strings, only buffer text. >=20 > Also, why are you putting a text property, instead of just examining > the category as part of IT_CAN_WRAP? What do you need the property > for? >=20 I don=E2=80=99t really know which way is better/more efficient and just = took one to implement. Plus text property might allow some user = customizations. I can change it to only use category table.=20 > And finally, this feature must be optional, so some customization > knobs are missing. But we could defer this until the basic code is in > good shape. Cool. I saw someone mentioning Line_Break.txt from unicode and looked it up, = unicode commission has already marked out all wrap-able code points. = IIUC we can add Line_Break.txt to admin/unidat and parse it and put a = elisp file under /lisp/international, right? We can categoarize all the = marked code points into three categories as I mentioned earlier.=20 Yuan