From: Alan Mackenzie <acm@muc.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: xdisp.c's struct it questions.
Date: Sat, 3 Oct 2015 16:38:00 +0000 [thread overview]
Message-ID: <20151003163800.GB4509@acm.fritz.box> (raw)
In-Reply-To: <83r3lc2au2.fsf@gnu.org>
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 <acm@muc.de>
> > 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).
next prev parent reply other threads:[~2015-10-03 16:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-03 15:48 xdisp.c's struct it questions Alan Mackenzie
2015-10-03 16:06 ` Andreas Schwab
2015-10-03 16:09 ` Eli Zaretskii
2015-10-03 16:38 ` Alan Mackenzie [this message]
2015-10-03 16:59 ` Eli Zaretskii
2015-10-04 13:44 ` Alan Mackenzie
2015-10-04 17:04 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151003163800.GB4509@acm.fritz.box \
--to=acm@muc.de \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.