unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Yuan Fu <casouri@gmail.com>, Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: RE: Word wrap for non-whitespace-seperated language
Date: Thu, 5 Mar 2020 14:46:47 -0800 (PST)	[thread overview]
Message-ID: <d6b569f0-3bb8-4eb5-9641-f11254b44df9@default> (raw)
In-Reply-To: <6DE83788-5296-4C4F-A265-88B33A43DC93@gmail.com>

> 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 but
> also between CJK characters. fill.el doesn’t work because it doesn’t work
> for variable pitch fonts, word-wrap doesn’t work because it can’t 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 certain
> 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’t get the position of
> point if it goes out of the window, in which case I need to recenter.
> 
> Is there a better way to search forward for a point such that it’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



  reply	other threads:[~2020-03-05 22:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-04 18:39 Word wrap for non-whitespace-seperated language Yuan Fu
2020-03-04 18:44 ` Eli Zaretskii
2020-03-04 18:51   ` Yuan Fu
2020-03-04 19:16     ` Eli Zaretskii
2020-03-04 20:34       ` Yuan Fu
2020-03-05  4:42         ` Eli Zaretskii
2020-03-05 22:33           ` Yuan Fu
2020-03-05 22:46             ` Drew Adams [this message]
2020-03-05 22:50             ` Yuan Fu
2020-03-06  2:18               ` Yuan Fu
2020-03-07  4:23             ` Richard Stallman
2020-03-07  5:04               ` Yuan Fu
2020-03-07  8:19                 ` Eli Zaretskii
2020-03-07 17:30                   ` Yuan Fu
2020-03-09  2:52                     ` Richard Stallman
2020-03-08  6:16                 ` Richard Stallman
2020-03-08 15:04                   ` Yuan Fu
2020-03-09  2:50                     ` Richard Stallman
2020-03-09 15:44                       ` Yuan Fu
2020-03-09 17:20                         ` Eli Zaretskii
2020-03-09 20:11                           ` Yuan Fu
2020-03-07  8:22               ` Eli Zaretskii
2020-03-07  8:40                 ` Lars Ingebrigtsen
2020-03-07 10:50                   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d6b569f0-3bb8-4eb5-9641-f11254b44df9@default \
    --to=drew.adams@oracle.com \
    --cc=casouri@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).