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: Po Lu
Subject: Re: move_it_vertically_backward question
Date: Tue, 21 Dec 2021 20:58:55 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux)

Yahoo said this reply wasn't delivered successfully (?), so I'm sending
it again.  Thanks.

> The last assignment should be unnecessary here: start-display always
> initializes the coordinates to zero.

The comment (and code) below seems to make it seem as if start_display
initializes it to WINDOW_TAB_LINE_HEIGHT + WINDOW_HEADER_LINE_HEIGHT.

>> +      if (movement < 0)
>> +    {
>> +      while (it.current_y > movement)
>> +        {
>> +          last_y = it.current_y;
>> +          move_it_vertically_backward (&it,
>> +                                       abs (movement) + it.current_y);
>> +
>> +          if (it.current_y == last_y)
>> +            break;
>> +        }
>> +    }
>> +      else
>> +    {
>> +      move_it_vertically (&it, movement);
>> +    }

> I don't understand the different logic depending on the sign of
> 'movement' (and didn't we agree to use a better name for it?).

Sorry for forgetting that.  I'll fix it ASAP.  As for the logic,
movement being negative means to move backwards from the specified
buffer position, while it being positive means to move forwards.

>> +      it.current_y = (WINDOW_TAB_LINE_HEIGHT (w)
>> +                  + WINDOW_HEADER_LINE_HEIGHT (w));
>> +      start = clip_to_bounds (BEGV, IT_CHARPOS (it), ZV);
>> +      start_y = it.current_y;
>> +    }
>> +  else
>> +    {
>> +      /* Start at the beginning of the line containing FROM.  Otherwise
>> +     IT.current_x will be incorrectly set to zero at some arbitrary
>> +     non-zero X coordinate.  */
>> +      reseat_at_previous_visible_line_start (&it);
>> +      it.current_x = it.hpos = 0;
>> +      if (IT_CHARPOS (it) != start)
>> +    move_it_to (&it, start, -1, -1, -1, MOVE_TO_POS);
>> +    }

> And here: why a different initial value for it.current_y, depending on
> how FROM was specified?

It should be that way, as we subtract the tab line height and header
line height from that value afterwards.

Thanks.


reply via email to

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