From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: posn-at-point returns nil after goto-char Date: Sun, 11 Apr 2010 20:39:24 +0300 Message-ID: <834ojhzy5v.fsf@gnu.org> References: NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1271007706 25391 80.91.229.12 (11 Apr 2010 17:41:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 11 Apr 2010 17:41:46 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Apr 11 19:41:45 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O11A1-00057d-Bb for geh-help-gnu-emacs@m.gmane.org; Sun, 11 Apr 2010 19:41:42 +0200 Original-Received: from localhost ([127.0.0.1]:45480 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O119h-0000j0-Vr for geh-help-gnu-emacs@m.gmane.org; Sun, 11 Apr 2010 13:41:10 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O119N-0000id-9D for help-gnu-emacs@gnu.org; Sun, 11 Apr 2010 13:40:49 -0400 Original-Received: from [140.186.70.92] (port=38787 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O119J-0000iO-RZ for help-gnu-emacs@gnu.org; Sun, 11 Apr 2010 13:40:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O119F-00033I-O7 for help-gnu-emacs@gnu.org; Sun, 11 Apr 2010 13:40:43 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:50960) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O119F-000338-C4 for help-gnu-emacs@gnu.org; Sun, 11 Apr 2010 13:40:41 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0L0Q003003D9MG00@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Sun, 11 Apr 2010 20:39:20 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([77.127.74.198]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L0Q00IAP3PJM0M0@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Sun, 11 Apr 2010 20:39:20 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:72648 Archived-At: > From: "D Chiesa" > 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'?