emacs-devel
[Top][All Lists]
Advanced

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

Re: Efficiently using MOVE_IT_... to gather a plethora of information.


From: Eli Zaretskii
Subject: Re: Efficiently using MOVE_IT_... to gather a plethora of information.
Date: Tue, 22 Aug 2017 22:16:41 +0300

> Date: Tue, 22 Aug 2017 11:26:25 -0700
> From: Keith David Bershatsky <address@hidden>
> 
> The method that I am presently using to calculate coordinates is inefficient 
> and relies upon a unique set of circumstances that must exist for everything 
> to work.  I am looking for the most efficient approach to calculate certain 
> values at three locations of each visible screen line -- `point` and 
> coordinates (x/y/hpos/vpos):
> 
> 1.  Beginning of each visible screen line.
> 
> 2.  Ending of each visible screen line.
> 
> 3.  The current X axis aligned with the cursor on each visible screen line.

You need to do this for _every_ screen line in the window?  If so,
this will be terribly slow, so slow as to be impractical in some
situations.

Why do you need all those coordinates of all the screen lines?

Btw, if variable fonts are used, the cursor positions on two adjacent
lines might not be aligned, so I'm not sure I understand how your
feature is supposed to work in that case.

> This project utilizes the MOVE_IT family within xdisp.c.  We would probably 
> all agree that we start the IT at w->start, but where do we go from there is 
> the question.  Is the following connect-the-dot the most efficient approach 
> to move the IT to each location from window-start to window-end?
> 
> 1  2  3
> 
> 4  5  6
> 
> 7  8  9

The move_it_* functions all proceed in the buffer logical order, so
you are traversing all these places anyway.  IOW, yes, this is the
most efficient order.  But it will be very slow, if you need to do
this for all screen lines in a window.



reply via email to

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