all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Alan Mackenzie <acm@muc.de>
Cc: emacs-devel@gnu.org
Subject: Re: xdisp.c's struct it questions.
Date: Sat, 03 Oct 2015 19:59:01 +0300	[thread overview]
Message-ID: <83oagf3n3e.fsf@gnu.org> (raw)
In-Reply-To: <20151003163800.GB4509@acm.fritz.box>

> Date: Sat, 3 Oct 2015 16:38:00 +0000
> Cc: emacs-devel@gnu.org
> From: Alan Mackenzie <acm@muc.de>
> 
> > 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	other threads:[~2015-10-03 16:59 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
2015-10-03 16:59     ` Eli Zaretskii [this message]
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=83oagf3n3e.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=acm@muc.de \
    --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.