From: Eli Zaretskii <eliz@gnu.org>
To: Po Lu <luangruo@yahoo.com>
Cc: emacs-devel@gnu.org
Subject: Re: move_it_vertically_backward question
Date: Wed, 15 Dec 2021 15:25:19 +0200 [thread overview]
Message-ID: <8335muj8zk.fsf@gnu.org> (raw)
In-Reply-To: <87ilvqty24.fsf@yahoo.com> (message from Po Lu on Wed, 15 Dec 2021 10:13:39 +0800)
> From: Po Lu <luangruo@yahoo.com>
> Cc: emacs-devel@gnu.org
> Date: Wed, 15 Dec 2021 10:13:39 +0800
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > No, I meant to ask window-text-pixel-size to do that, by passing it a
> > specially-formatted value of FROM (and possibly also TO).
> >
> > So let's teach window-text-pixel-size to be able to accept the FROM
> > argument which says "N pixels above position POS".
>
> I still don't believe that would be better than a separate primitive
> (since it doesn't make sense to supply the width information to the
> pixel scrolling code), and unfortunately I don't quite understand how
> `window_text_pixel_size' works either:
So you don't have a sufficient understanding of how
window_text_pixel_size works, but you are already sure it isn't a good
candidate for the job you'd like to do? Maybe it's better to wait
until your understanding is sufficient, before making up your mind
about that?
> for instance, it seems to disable the bidirectional reordering of
> text?
Yes, because text metrics between two (reasonably chosen) buffer
positions are unaffected by reordering. There's a comment in the code
explaining further why is that.
> I also don't see why `it' is saved into `it2' only to be restored
> before anything interesting is done with `it'.
Do you understand why we use SAVE_IT and RESTORE_IT in the display
engine? (There's a comment near their definition which explains the
basic reasons.) If you do, I don't really see how such a question
could pop up. Maybe the comment that explains the need for this gork
should be improved or clarified?
> Correctly pixel-scrolling over bidirectional text will probably be a
> very important feature for people working with RTL languages, but I'm
> not sure how many of them are likely to use such a feature.
See above: we don't lose anything in such situations. I would not
have allowed code into the display engine that would break bidi
support.
> > That's not very efficient if PIX can be a large value.
>
> Yes. Maybe calling `move_it_vertically_backward' itself until a
> suitable position is reached will be better, as I really don't want to
> reinvent "move_it_vertically_backwards but slightly different".
>
> Something like this:
>
> move_it_vertically_backward (&it, pix);
>
> while (-it.current_y < pix)
> {
> last_y = it.current_y;
> move_it_vertically_backward (&it, pix + it.current_y);
>
> if (it.current_y == last_y)
> break;
> }
I cannot say anything intelligent because I don't think I understand
the requirements well enough. AFAICT, you never described them in
enough detail, neither on help-gnu-emacs nor here.
next prev parent reply other threads:[~2021-12-15 13:25 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87lf0pw78r.fsf.ref@yahoo.com>
2021-12-13 2:47 ` move_it_vertically_backward question Po Lu
2021-12-13 14:50 ` Eli Zaretskii
2021-12-14 0:53 ` Po Lu
2021-12-14 12:52 ` Eli Zaretskii
2021-12-14 13:28 ` Po Lu
2021-12-14 13:45 ` Eli Zaretskii
2021-12-15 1:18 ` Po Lu
2021-12-15 3:27 ` Eli Zaretskii
2021-12-15 3:30 ` Po Lu
2021-12-15 13:27 ` Eli Zaretskii
2021-12-15 13:39 ` Po Lu
2021-12-15 2:13 ` Po Lu
2021-12-15 10:28 ` Po Lu
2021-12-15 13:56 ` Eli Zaretskii
2021-12-15 13:25 ` Eli Zaretskii [this message]
2021-12-15 13:38 ` Po Lu
2021-12-15 14:50 ` Eli Zaretskii
2021-12-16 0:41 ` Po Lu
2021-12-16 8:29 ` Eli Zaretskii
2021-12-16 9:25 ` Po Lu
2021-12-16 10:04 ` Eli Zaretskii
2021-12-16 10:27 ` Po Lu
2021-12-16 12:17 ` Po Lu
2021-12-16 13:27 ` Eli Zaretskii
2021-12-16 13:34 ` Po Lu
2021-12-16 13:59 ` Eli Zaretskii
2021-12-17 1:45 ` Po Lu
2021-12-18 10:28 ` Eli Zaretskii
2021-12-18 10:49 ` Po Lu
2021-12-18 11:03 ` Eli Zaretskii
2021-12-18 11:18 ` Po Lu
2021-12-18 11:29 ` Eli Zaretskii
2021-12-18 11:31 ` Po Lu
2021-12-18 11:35 ` Eli Zaretskii
2021-12-18 11:39 ` Po Lu
2021-12-19 0:54 ` Po Lu
2021-12-19 8:29 ` Eli Zaretskii
2021-12-19 9:16 ` Po Lu
2021-12-19 9:27 ` Eli Zaretskii
2021-12-19 10:25 ` Po Lu
2021-12-19 18:07 ` Eli Zaretskii
2021-12-20 1:05 ` Po Lu
2021-12-21 12:58 ` Po Lu
2021-12-21 17:07 ` Eli Zaretskii
2021-12-22 0:49 ` Po Lu
2021-12-22 14:59 ` Eli Zaretskii
2021-12-23 1:30 ` Po Lu
2021-12-23 9:49 ` Eli Zaretskii
2021-12-23 10:29 ` Po Lu
2021-12-23 10:39 ` Eli Zaretskii
2021-12-23 10:42 ` Po Lu
2021-12-23 10:50 ` Eli Zaretskii
2021-12-23 10:55 ` Po Lu
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8335muj8zk.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=luangruo@yahoo.com \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.