[Top][All Lists]

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

Re: posn-at-point returns nil after goto-char

From: Eli Zaretskii
Subject: Re: posn-at-point returns nil after goto-char
Date: Sun, 11 Apr 2010 20:39:24 +0300

> From: "D Chiesa" <address@hidden>
> 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'?

reply via email to

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