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: Mon, 25 May 2020 15:51:48 -0400 Message-ID: References: <92FF4412-04FB-4521-B6CE-52B08526E4E5@gmail.com> 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="47120"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 25 21:52:34 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 1jdJ9F-000CA2-Ln for ged-emacs-devel@m.gmane-mx.org; Mon, 25 May 2020 21:52:33 +0200 Original-Received: from localhost ([::1]:55108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdJ9E-0007lR-L1 for ged-emacs-devel@m.gmane-mx.org; Mon, 25 May 2020 15:52:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdJ8a-00076H-KM for emacs-devel@gnu.org; Mon, 25 May 2020 15:51:52 -0400 Original-Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]:40601) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jdJ8Z-0001Gv-FN for emacs-devel@gnu.org; Mon, 25 May 2020 15:51:52 -0400 Original-Received: by mail-qk1-x72a.google.com with SMTP id c185so4308454qke.7 for ; Mon, 25 May 2020 12:51:50 -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=kqOg9zY6ATp5OVSdy55kgrD8W2QkJhCDy0ye5RBTL6E=; b=rcIO9R4WmEDl/Wnawsh4uyf3ydoKVGnUETFRwWWih7E9pXeOtlmloqNAP4/I8bbGfm FP1XQHChQL3A7kbdw/D30Wy2ZeCeTkiyyPr7X3piqvDuTWgGzmBtyN1ziW9h3zOWyjn+ mvCSmIXKZXjYMJH+tC59oEAgCPwYnFpb6OHMnQ8weLDeYFIRTGftUeHwDp8iHAH6+hrn 5lvDC9SBPSsicim9OQHn5uTn7zRSy/5jde+DbAWKRfez1UT54AEkSy9pJoAdCkA0BloM ESE+UBoZY2ay8GDf5UyLoY68r1+9qIh5gjUpheRYk2QaniAPWXeMri87INJbl5MAtGHP 8uhQ== 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=kqOg9zY6ATp5OVSdy55kgrD8W2QkJhCDy0ye5RBTL6E=; b=p4at9RtbB0HQTTLokFA5gsBgEh5AySVAP9/MDGHxMyk7jVjvfTssBesnjMSJ9W2APj ui3aB+2U9iI5LLwB+yufd/ifr7n2m+Ne3Rs9EUHhNtaRKMZY1ABhRiFAr+yHaY382EQ4 XsjmZhD1N+sUfF2asQjjbkMfKsGabqVs0iNVNADwTlPcz/Nyh4KKMPFI84/Ti/OLYfRT 7bZ20fHMykdKwHLXXhT1LWJouPYrRVNoXek2dUNOwVogbULa1lRk9vv+LPE/7reKuRO5 w2OancpIHSCS5ls41q91ruYa4s0yVqzcCkIqER44HnPHRFOKPPUMTJw+ps8b2nNlOmsA q2+w== X-Gm-Message-State: AOAM533qVM/Abfr22SHfEJOVtLxbSHNChE0hH3DQy33+A+5ScntKJ9d0 B8TxmKdA4kp/2PFDNqr8RBI= X-Google-Smtp-Source: ABdhPJxUPDXeXzeoeeII5+7GQVXHw80SbJfjUK0Zxkdutix0LtdSZJ/g2SCBPnoWtJ5jygNF7UPOhQ== X-Received: by 2002:a37:8d45:: with SMTP id p66mr16001018qkd.194.1590436310003; Mon, 25 May 2020 12:51:50 -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 g19sm15269986qke.32.2020.05.25.12.51.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 May 2020 12:51:49 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3608.80.23.2.2) Received-SPF: pass client-ip=2607:f8b0:4864:20::72a; envelope-from=casouri@gmail.com; helo=mail-qk1-x72a.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:251388 Archived-At: > On May 25, 2020, at 3:31 PM, Stefan Monnier = wrote: >=20 >> 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 >>=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 >=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). >=20 I=E2=80=99ve added the intended use case on the previous message. I=E2=80=99= m not sure when to add the property yet. Right now I only have a general = idea of using text property as a cache, so the more complex wrapping = rule does not slow down redisplay. There could be a table specifying a = mapping from unicode ranges to =E2=80=9Cwrappablility=E2=80=9D = (can/can't wrap before/after) and some one will iterate each character = and apply the text property. The good thing is that this = =E2=80=9Cwrappability=E2=80=9D property of a character never changes, so = we only need to calculate it once. The redisplay code doesn=E2=80=99t need to change greatly since checking = for =E2=80=9Cwrappability=E2=80=9D is similar to checking = =E2=80=9Cwhitespace_p=E2=80=9D. Yuan=