unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Po Lu <luangruo@yahoo.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: move_it_vertically_backward question
Date: Wed, 15 Dec 2021 21:38:14 +0800	[thread overview]
Message-ID: <87h7bang3d.fsf@yahoo.com> (raw)
In-Reply-To: <8335muj8zk.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 15 Dec 2021 15:25:19 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

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

No, I meant "don't quite understand" as in the two questions I asked
you, which you've answered below:

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

I didn't understand the comment when I first saw it, but now I do, so I
retract my question.  Thanks.

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

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

The requirement is basically to find the start of a line that is at
least above window start by a given number of pixels, and to also find
the vertical distance between the top of that line and the start of the
window.

For instance, if we're scrolling upwards (upwards in this context is
opposite to the terminology we use for line-based scrolling: it means
moving the display downwards, like scroll-down) by 17 pixels, and there
are two lines each 14 pixels in height above window start, the new
window start will be set to the start position of the second line above
window start (which this function should return), and vscroll will be
set to 7 (which is 24 - 17, where the 24 is the aformentioned vertical
distance that this function should also return).

Thanks.



  reply	other threads:[~2021-12-15 13:38 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
2021-12-15 13:38                 ` Po Lu [this message]
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

  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=87h7bang3d.fsf@yahoo.com \
    --to=luangruo@yahoo.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).