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: Alan Mackenzie
Subject: Re: xdisp.c's struct it questions.
Date: Sat, 3 Oct 2015 16:38:00 +0000
User-agent: Mutt/1.5.23 (2014-03-12)

Hello, Eli,

Thanks for such a rapid and useful answer.

On Sat, Oct 03, 2015 at 07:09:09PM +0300, Eli Zaretskii wrote:
> > Date: Sat, 3 Oct 2015 15:48:36 +0000
> > From: Alan Mackenzie <address@hidden>

> > I'm trying to get some stuff in xdisp.c working.  It's hard.

> My sympathies.  Please consider recording in the comments everything
> you learn that isn't already there.  Let's take something positive and
> useful from your ordeal ;-)

I'll see what I can manage.

> > I'm currently looking at routines like `move_it_to', which is described
> > as "Move IT forward until it satisfies one or more of the criteria in
> > TO_CHARPOS, TO_X, TO_Y, and TO_VPOS."

> > What I can't find anywhere is a description of what it means for a
> > "struct it" to _be_ somewhere.  There are around 100 fields in struct
> > it, and several of them record locations, coordinates, etc., in one way
> > and another.  Which of these fields are changed when move_it_to is
> > called?

> It depends on the criteria.  For TO_CHARPOS, the goal value is in
> it->pos.charpos; for TO_X, it's in it->current_x; for TO_Y, it's in
> it->current_y; and for TO_VPOS, it's in it->vpos.

OK.

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

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

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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