From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "D Chiesa" Newsgroups: gmane.emacs.help Subject: posn-at-point returns nil after goto-char Date: Sun, 11 Apr 2010 03:30:21 -0400 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1270993940 12745 80.91.229.12 (11 Apr 2010 13:52:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 11 Apr 2010 13:52:20 +0000 (UTC) To: Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Apr 11 15:52:19 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 1O0xaE-0003Kh-PA for geh-help-gnu-emacs@m.gmane.org; Sun, 11 Apr 2010 15:52:19 +0200 Original-Received: from localhost ([127.0.0.1]:53203 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0xaE-0006t8-4Y for geh-help-gnu-emacs@m.gmane.org; Sun, 11 Apr 2010 09:52:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O0w9w-0000xA-N9 for help-gnu-emacs@gnu.org; Sun, 11 Apr 2010 08:21:04 -0400 Original-Received: from mailman by lists.gnu.org with local (Exim 4.43) id 1O0w9v-0000vf-FH for help-gnu-emacs@gnu.org; Sun, 11 Apr 2010 08:21:03 -0400 Original-Received: from [140.186.70.92] (port=53795 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0reo-0000Qo-VE for help-gnu-emacs@gnu.org; Sun, 11 Apr 2010 03:32:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O0rei-0007Wb-N1 for help-gnu-emacs@gnu.org; Sun, 11 Apr 2010 03:32:36 -0400 Original-Received: from col0-omc4-s11.col0.hotmail.com ([65.55.34.213]:38547) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0rei-0007Vr-HY for help-gnu-emacs@gnu.org; Sun, 11 Apr 2010 03:32:32 -0400 Original-Received: from COL124-DS21 ([65.55.34.199]) by col0-omc4-s11.col0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Sun, 11 Apr 2010 00:30:33 -0700 X-Originating-IP: [98.111.252.155] X-Originating-Email: [dpchiesa@hotmail.com] X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-OriginalArrivalTime: 11 Apr 2010 07:30:33.0270 (UTC) FILETIME=[DED2A560:01CAD948] X-detected-operating-system: by eggs.gnu.org: Windows 2000 SP4, XP SP1+ X-TMDA-Confirmed: Sun Apr 11 08:21:03 EDT 2010 X-Mailman-Approved-At: Sun, 11 Apr 2010 09:47:42 -0400 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:72646 Archived-At: I've got a function that looks something like this: (defun my-move-and-popup-menu () "move the point, then pop up a menu." (goto-char xxxx) (setq p (posn-at-point)) (my-popup-menu p ...) ) Basically, move the point, then retrieve the screen position at that point, and then popup a menu at that screen position. 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. 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. The reason I suggest that the position is not actually updated until exit from the function - when the menu successfully pops up (which happens when the xxxx position is visible, though not at point, before entering the function), the cursor is clearly visible in its previous location while the popup menu is being displayed. When I dismiss the menu, the cursor moves to where I expected it to move, during the `goto-char` call. 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? Thanks for any hints y'all can provide. D Chiesa