emacs-devel
[Top][All Lists]
Advanced

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

Re: "... the window start at a meaningless point within a line."


From: Eli Zaretskii
Subject: Re: "... the window start at a meaningless point within a line."
Date: Fri, 16 Oct 2015 21:36:10 +0300

> Date: Fri, 16 Oct 2015 21:23:10 +0300
> From: Eli Zaretskii <address@hidden>
> Cc: address@hidden
> 
>   . compute the horizontal difference, in pixels, between the position
>     which xdisp would use as window-start and the actual window-start
>     (the value should always be positive); let's call the result N
> 
>   . let Fvertical_motion do its thing exactly as it does now
> 
>   . move N more pixels to the right, i.e. in the direction of
>     increasing the X coordinate, or to the end of line, if it ends
>     before that coordinate
> 
> If this should work, then all you need is to implement the 1st bullet,
> which is very easy, nothing as complicated as your
> maybe_move_to_exact_bol.  It should just call move_it_in_display_line
> to get to the actual window-start, and save the X coordinate wehen it
> gets there.

Btw, it might be a good idea to store the offset between the two
window-start points as part of the window structure, instead of
storing just the flag.  The value of the offset will have to be
recomputed whenever text is scrolled or the window dimensions change,
but I suspect you recompute it in those situations anyway, so all you
need to add is a primitive that stores the value.

Then the 1st bullet above doesn't need to be implemented at all, you
just need to use the value stored in w->window_start_offset in the 3rd
bullet.

Does this make sense?



reply via email to

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