emacs-devel
[Top][All Lists]
Advanced

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

Re: move_it_vertically_backward question


From: Eli Zaretskii
Subject: Re: move_it_vertically_backward question
Date: Wed, 15 Dec 2021 15:25:19 +0200

> 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.



reply via email to

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