From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Word wrap for non-whitespace-seperated language Date: Thu, 5 Mar 2020 14:46:47 -0800 (PST) Message-ID: References: <838skgvu2l.fsf@gnu.org> <3692AB81-B291-4D14-BEDE-924F020D94ED@gmail.com> <837e00vsk9.fsf@gnu.org> <9737C398-80FC-4377-91BA-C0891BD5A0F5@gmail.com> <835zfjwgyb.fsf@gnu.org> <6DE83788-5296-4C4F-A265-88B33A43DC93@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="81024"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Yuan Fu , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Mar 05 23:47:42 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 1j9zHJ-000Kxz-8l for ged-emacs-devel@m.gmane-mx.org; Thu, 05 Mar 2020 23:47:41 +0100 Original-Received: from localhost ([::1]:57046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9zHI-0001AY-74 for ged-emacs-devel@m.gmane-mx.org; Thu, 05 Mar 2020 17:47:40 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38165) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9zGb-0000gK-HK for emacs-devel@gnu.org; Thu, 05 Mar 2020 17:46:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9zGZ-0003qc-Pi for emacs-devel@gnu.org; Thu, 05 Mar 2020 17:46:57 -0500 Original-Received: from userp2130.oracle.com ([156.151.31.86]:59700) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j9zGX-0003mI-Sd; Thu, 05 Mar 2020 17:46:54 -0500 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 025MRq7B026982; Thu, 5 Mar 2020 22:46:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=RoklH3k+QvdmiG2JKAg9KGyqlK8X9/QfoaHetMFPlA0=; b=cAWmmISyMe1nQcH7F8E7zCo5hp1WJE/avfnDwnxKR+lYulIYXxVsgk4fz3FrPS8UvIaR OsBiQxqbmYsQXjoHFdk+vE8QcHT84zjOtdy37cZ28yGFIVeDIk8vKJe3S2fBvgrvR3Os d1HwiTzcZufBimZmKswQlF6JjIVu/3nQGSdnlkSIT3xjslgFKYWGUo7dNbuEqXoDunHU jWJXMLi4+k0DMgW8nCJvjnSn+mafmccnJzJtqgEG34Fxn/6ciOeOx7m/AWTpKLzOJ7ub 31M6Gki7lAse6bbFrXPGFDRNVVEgIYgl56yfRQvBxMobWXlfUzY0UpA2jvSMs0Mpi/8G Rg== Original-Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 2yffcv05hq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 05 Mar 2020 22:46:49 +0000 Original-Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 025MhcZ7139858; Thu, 5 Mar 2020 22:46:49 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3030.oracle.com with ESMTP id 2yjuf25r1u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 05 Mar 2020 22:46:49 +0000 Original-Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 025MkmwR023180; Thu, 5 Mar 2020 22:46:48 GMT In-Reply-To: <6DE83788-5296-4C4F-A265-88B33A43DC93@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4966.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9551 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 spamscore=0 malwarescore=0 bulkscore=0 adultscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2003050127 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9551 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 bulkscore=0 adultscore=0 suspectscore=0 spamscore=0 malwarescore=0 impostorscore=0 priorityscore=1501 mlxlogscore=999 lowpriorityscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2003050127 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 156.151.31.86 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:245278 Archived-At: > I wrote something that works. The goal is to have a word wrap effect for > variable pitch words while breaking not only on white space characters bu= t > also between CJK characters. fill.el doesn=E2=80=99t work because it does= n=E2=80=99t work > for variable pitch fonts, word-wrap doesn=E2=80=99t work because it can= =E2=80=99t break > between CJK characters. The key point is to find the place to break, my > current method is forward char until the x position of point exceeds cert= ain > value (say 70*7 pixels). This has two flaws: first, forward char-by-char = is > very slow, although I added some simple optimizations, the lag is still > noticeable even with small paragraphs. Second, I can=E2=80=99t get the po= sition of > point if it goes out of the window, in which case I need to recenter. >=20 > Is there a better way to search forward for a point such that it=E2=80=99= s x > position is larger than some value? (Come think of it, is it possible to > find a point in a window by x-y coordinate?) Thanks. I have no idea if it helps (apologies, if not), but maybe take a look at library `find-where.el'. It lets you find (forward or backward) the first (or the Nth) buffer position where some predicate holds. --- https://www.emacswiki.org/emacs/FindWhere https://www.emacswiki.org/emacs/download/find-where.el