emacs-devel
[Top][All Lists]
Advanced

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

Re: xdisp.c's struct it questions.


From: Eli Zaretskii
Subject: Re: xdisp.c's struct it questions.
Date: Sat, 03 Oct 2015 19:59:01 +0300

> Date: Sat, 3 Oct 2015 16:38:00 +0000
> Cc: address@hidden
> From: Alan Mackenzie <address@hidden>
> 
> > Also note that the criteria is actually tested to "reach or exceed"
> > the goal values, i.e. do not expect to always get an exact equality,
> > only "greater or equal".
> 
> Ah.  Hmm.  OK.  That's rather important!  In fact, that's exactly what
> seems to be happening to me.
> 
> So these routines are only for use in contexts where it only matters
> that a particular range/position is _covered_, rather than reached
> exactly.

Not sure I agree; perhaps I don't understand what you mean by
"covered".

If you give a goal value that _can_ be reached exactly, these
functions should do exactly that.  But a value might not be reachable
exactly.  A trivial example is a value of X that is in the middle of a
character (the value is in pixels).  A less trivial example is when
the goal is the character position in the middle of invisible text,
like text covered by 'invisible' text property or by a display string.

> Would `reseat' (or one of its variants) be the right function to put a
> struct it _exactly_ at a particular position?

If you change the value of it->pos by hand, you _must_ call 'reseat'
afterwards to synchronize all the other fields, so that you could
continue using the move_it_* functions.  But note that 'reseat' cannot
compute the screen coordinates (current_x, current_y, and vpos), which
is why most uses reseat the iterator to a beginning of a physical
line, where these coordinates can be set by you.



reply via email to

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