From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Line wrap reconsidered Date: Mon, 25 May 2020 15:31:12 -0400 Message-ID: References: <92FF4412-04FB-4521-B6CE-52B08526E4E5@gmail.com> Mime-Version: 1.0 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="91585"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 25 21:32:08 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 1jdIpR-000Nh8-Rq for ged-emacs-devel@m.gmane-mx.org; Mon, 25 May 2020 21:32:05 +0200 Original-Received: from localhost ([::1]:41702 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdIpQ-0006ou-R4 for ged-emacs-devel@m.gmane-mx.org; Mon, 25 May 2020 15:32:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdIog-0005oH-4p for emacs-devel@gnu.org; Mon, 25 May 2020 15:31:19 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:64113) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdIoe-0005xB-Ps for emacs-devel@gnu.org; Mon, 25 May 2020 15:31:17 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 46F14100922; Mon, 25 May 2020 15:31:15 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 5CD0A100311; Mon, 25 May 2020 15:31:13 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1590435073; bh=zZys18goYDSob9mJbXBHF6gHd9NxjYsN5wCtz2RWXEM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=QstVvQ/IXI9lW4bbH1OngRrgJGxePxNhCZOQCkBohuDlNH5h4Tus2QRDV6WaDitnV KhA5/rkrc3MtkO/zGwYwh4MPW7cVcCYoR4xREwT7wKrh2RFXfmUHTqOuDZGGAITpgv h/92Nd0+79KYJDqbyuFO/SBED+bRdIvYxm9zSNcbVLvFlje9+bQiH6Dn6akuKXPoMM 9MxZgr2/QNDyv/D3V4qQhy0FMztd7amE9rY5a1ASXYEZCv73bY2PjHH+bqeLCzSEMY N5YTlVvwhQM6FhveQcXcib4RMF5IgBfi99YohVN+AHnjWWHJ9BZOQryqK9mf1wOlyN VgD7EDgCRHZZQ== Original-Received: from alfajor (unknown [216.154.27.250]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 25961120554; Mon, 25 May 2020 15:31:13 -0400 (EDT) In-Reply-To: <92FF4412-04FB-4521-B6CE-52B08526E4E5@gmail.com> (Yuan Fu's message of "Mon, 25 May 2020 14:13:04 -0400") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/25 15:31:15 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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:251386 Archived-At: > I=E2=80=99ve implemented and used a lisp-based line-wrapping feature for = a while and > it=E2=80=99s still sub-optimal for me. I now want to try to explore if I = can add it > directly to redisplay.=20 > > Here is what I come up with: in redisplay code, instead of only checking = for > whitespace, check for a =E2=80=98no-wrap text-property, if the character = has this > property, don=E2=80=99t wrap before[1] this character (or maybe it can be= the > opposite, only wrap when the character has a =E2=80=98can-wrap property).= And this > text property is calculated and applied once.=20 I don't think I can discuss the quality of this proposal without first understanding the intended use cases (including who/how/when the property would be added). > Could this be plausible? Is checking text property is fast enough for red= isplay? I'll let Eli answer this part (I vaguely remember that it could be somewhat costly, but it likely depends on the details). > [1] There are some complications to this, some characters can=E2=80=99t h= ave line > break before them, some can=E2=80=99t have after; maybe use =E2=80=98bef= ore, =E2=80=98after and nil > instead of binary value. Hence the need to clarify the intended use case. Stefan