From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Line wrap reconsidered Date: Tue, 26 May 2020 22:50:36 +0300 Message-ID: <83lfletr03.fsf@gnu.org> References: <92FF4412-04FB-4521-B6CE-52B08526E4E5@gmail.com> <878shfsq35.fsf@gnus.org> <83imgivjak.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="8640"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 26 21:53:24 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 1jdfdb-0002BL-O3 for ged-emacs-devel@m.gmane-mx.org; Tue, 26 May 2020 21:53:23 +0200 Original-Received: from localhost ([::1]:57634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdfda-0003oZ-N6 for ged-emacs-devel@m.gmane-mx.org; Tue, 26 May 2020 15:53:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdfb8-000115-OL for emacs-devel@gnu.org; Tue, 26 May 2020 15:50:50 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50831) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdfb8-00080u-BT; Tue, 26 May 2020 15:50:50 -0400 Original-Received: from [176.228.60.248] (port=3230 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jdfb7-0000i3-Pj; Tue, 26 May 2020 15:50:50 -0400 In-Reply-To: (message from Yuan Fu on Tue, 26 May 2020 13:34:01 -0400) 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:251474 Archived-At: > From: Yuan Fu > Date: Tue, 26 May 2020 13:34:01 -0400 > Cc: larsi@gnus.org, > emacs-devel@gnu.org > > 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 “《” will not be place at the end of a line, etc. > > It determines whether we can wrap before/after a character by looking at “<“, “>” and “|” categories, roughly corresponding to “don’t wrap before”, “don’t wrap after” and “wrap before and after”. Thanks. This still doesn't support strings, only buffer text. 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? 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.