From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: posn-at-point returns nil after goto-char
Date: Sun, 11 Apr 2010 20:39:24 +0300 [thread overview]
Message-ID: <834ojhzy5v.fsf@gnu.org> (raw)
In-Reply-To: <COL124-DS21C2371BBA557E2AF71F07CE130@phx.gbl>
> From: "D Chiesa" <dpchiesa@hotmail.com>
> Date: Sun, 11 Apr 2010 03:30:21 -0400
>
> But I am finding that `posn-at-point` returns non-nil, only if the xxxx
> character position (the *after* position) is visible in the window, *before*
> the call to `goto-char`. It seems that the position is not actually updated
> until exit from the function.
The documentation explicitly says that it returns nil for a position
that is not visible.
> If `goto-char` goes a long way, more than one screenful, then the
> retrieved position is always nil, and my code doesn't know where to
> popup the menu.
That's because Emacs never updates the display until it has no more
pending commands to run.
> How can I get the position to be *really* updated, between `goto-char` and
> `posn-at-point`, so that `posn-at-point` will not return nil?
Add a call to `sit-for'?
prev parent reply other threads:[~2010-04-11 17:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-11 7:30 posn-at-point returns nil after goto-char D Chiesa
2010-04-11 14:49 ` Jeff Clough
2010-04-11 17:39 ` Eli Zaretskii [this message]
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=834ojhzy5v.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=help-gnu-emacs@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.