[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Word wrap for non-whitespace-seperated language

From: Drew Adams
Subject: RE: Word wrap for non-whitespace-seperated language
Date: Thu, 5 Mar 2020 14:46:47 -0800 (PST)

> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]