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:23:10 +0300

> Date: Fri, 16 Oct 2015 18:12:50 +0000
> Cc: address@hidden
> From: Alan Mackenzie <address@hidden>
> 
> > But why do you need to do that?  IOW, what problem does
> > maybe_move_to_exact_bol solve, and how that problem is related to what
> > Fvertical_motion does?
> 
> > Perhaps start by explaining what problems you discovered in
> > Fvertical_motion that required you to make those changes.
> 
> Without maybe_move_to_exact_bol, vertical-motion, when it lands near
> the top of the window, leaves the cursor not at column 0 on the screen.
> 
> So, for example, with point at C, unmodified (vertical-motion -1) takes
> us to A2, when we want to go to L3.

So all you need is make a correction after Fvertical_motion did its
thing, is that right?

Will the following algorithm work:

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



reply via email to

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