From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.devel Subject: Re: Line wrap reconsidered Date: Tue, 26 May 2020 09:55:46 +0800 Message-ID: <87imgjpihp.fsf@localhost> References: <92FF4412-04FB-4521-B6CE-52B08526E4E5@gmail.com> <83r1v7vmwy.fsf@gnu.org> 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="12673"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii , Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 26 04:01:16 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 1jdOu2-0003Au-DP for ged-emacs-devel@m.gmane-mx.org; Tue, 26 May 2020 04:01:14 +0200 Original-Received: from localhost ([::1]:57738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdOu1-0006Vb-Fh for ged-emacs-devel@m.gmane-mx.org; Mon, 25 May 2020 22:01:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34276) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdOtE-0005G7-PC for emacs-devel@gnu.org; Mon, 25 May 2020 22:00:24 -0400 Original-Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]:43220) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jdOtD-0000NU-A7; Mon, 25 May 2020 22:00:24 -0400 Original-Received: by mail-pf1-x42d.google.com with SMTP id v63so9433453pfb.10; Mon, 25 May 2020 19:00:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=5a178iFN7cUpEnzP4R+BqVSwU5LoNb9Q5EvxYZIn87E=; b=Xs+Tkb2/kZLzYlo9gbwN4zLXZnxzVF7Lyf6P1CH+PyV/td+FQ3+04M8Q3KT+NT3+66 ELiQlOIDMXgIpjnRh/b4tuootGbFXK/6738vv5TZ+72/YKEnwhXxz2lyPudkDwbWqqhn zolSBdb3YN0aZxLKUJ6zRvPy5qVnCXYn0E3zeZwIjyXRQOMM7kSrEXNBlMZYMj/EkdkK 4njZY8I5MF7khdBFDlN+k1aclIkKXykAIuDK7ieWRH0AVRdIybjjrEsU4qty6+/tzefo J4BpvD9fcl12F9lDjN8eaWUwIyjgVcPjyU+o/DrdPScs6V1W+KSLiS3KSwGLXBWStg/D ZHiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=5a178iFN7cUpEnzP4R+BqVSwU5LoNb9Q5EvxYZIn87E=; b=g+rdQEyZiLxEcdp7ywJhQn6lLgrS0jNNFzlXYoi14nlui6PiJuIgkDDAYzIM7eWHUU UcCotzzsuNEUIGOt7hHdvv6KJU7NrRBQmiJjyB5BjiyhSD8z5rRSSR/0qrEiP/pzTG8d iF+fHcjQmJns0ZVPUVcPjUeaWaJSll113VhiOzLYn/x5V81e8TVzzVIyNkGTS3+lNw0n 5erwl7rhlFv1q5nWEwr30j2WwhT8rfoMHX492car7FFUtdRXmJIw32398uifx6XNaP2X jqTQm8ClVbzQWVU6qFc+7ZcG0+6d9S34FvbXwPEvktt+EhHK+BQas0aubkmToS9DPPIM AGMw== X-Gm-Message-State: AOAM533421PTpeDxoEBk9cyaGNx9L/3HZbBgAicu0nPE50UDMNg5gzw7 ijqaks1AhWUmSn0mRXht1wIXyDefPMke0g== X-Google-Smtp-Source: ABdhPJx6Bn+CiYXQpQ/7Gr33EpTMKY8QcwGCEqyL29GrdOHJH6r6QdOUdBVknkI0TRtAoPdbjYOCTg== X-Received: by 2002:aa7:9302:: with SMTP id 2mr18877722pfj.164.1590458421007; Mon, 25 May 2020 19:00:21 -0700 (PDT) Original-Received: from localhost ([210.3.160.230]) by smtp.gmail.com with ESMTPSA id u17sm12899435pgo.90.2020.05.25.19.00.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2020 19:00:20 -0700 (PDT) In-Reply-To: <83r1v7vmwy.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=yantar92@gmail.com; helo=mail-pf1-x42d.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: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, 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:251407 Archived-At: >> 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 ap= plied >> once.=20=20 > > What are the use cases for such a feature? There is another possible use case for this. Consider an org document containing normal text and very wide table. ----------------------------------------------------------------------- ----------------------------------------------------------------------- Nunc porta vulputate tellus. Nunc eleifend leo vitae magna. Nunc rutrum t= urpis sed pede. In id erat non orci commodo lobortis. Aliquam posuere. A= liquam posuere. Donec vitae dolor. Vestibulum convallis, lorem a tempus s= emper, dui dui euismod elit. | Nam euismod tellus id erat. | Donec neque quam, dignissim in. | Phasellus= neque orci, | Nullam rutrum. = | Nulla posuere. | Nulla posuere. | Nun= c aliquet, augue nec. | Sed diam. | | Nulla facilisis, risus a | Nunc aliquet, augue nec | Nulla fac= ilisis, risus a rhoncus fermentum, tellus | In id erat non orci commodo lob= ortis. | Nunc rutrum turpis sed pede. | Cras placerat accumsan nulla. | Nul= lam rutrum. | Donec hendrerit tempor tellus. | ----------------------------------------------------------------------- ----------------------------------------------------------------------- With line wrapping: ----------------------------------------------------------------------- ----------------------------------------------------------------------- Nunc porta vulputate tellus. Nunc eleifend leo vitae magna. Nunc rutrum turpis sed pede. In id erat non orci commodo lobortis. Aliquam posuere. Aliquam posuere. Donec vitae dolor. Vestibulum convallis, lorem a tempus semper, dui dui euismod elit.=20 | Nam euismod tellus id erat. | Donec neque quam, dignissim in. | | Phasellus neque orci, | Nullam rutrum. | | Nulla posuere. | Nulla posuere. | Nunc | aliquet, augue nec. | Sed diam. |=20 | Nulla facilisis, risus a | Nunc aliquet, augue nec | Nulla | facilisis, risus a rhoncus fermentum, tellus | In id erat non orci | commodo lobortis. | Nunc rutrum turpis sed pede. | Cras placerat | accumsan nulla. | Nullam rutrum. | Donec hendrerit tempor | tellus. |=20 ----------------------------------------------------------------------- ----------------------------------------------------------------------- The table becomes completely unreadable with line wrapping. It would make sense to have an option not to wrap the table even when lines are not truncated. If the display backend supports such things, font-lock may take care about putting the needed =E2=80=98no-wrap or 'wrap text properties. Best, Ihor Eli Zaretskii writes: >> From: Yuan Fu >> Date: Mon, 25 May 2020 14:13:04 -0400 >>=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 charact= er 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-wr= ap property). And this text property is calculated and applied once.=20 > > What are the use cases for such a feature? > >> Is checking text property is fast enough for redisplay? > > We do this all the time in the display code, so speed shouldn't be a > problem. > --=20 Ihor Radchenko, PhD, Center for Advancing Materials Performance from the Nanoscale (CAMP-nano) State Key Laboratory for Mechanical Behavior of Materials, Xi'an Jiaotong U= niversity, Xi'an, China Email: yantar92@gmail.com, ihor_radchenko@alumni.sutd.edu.sg