From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Porter Subject: Re: Screenshot of agenda: agenda is not shown in time Date: Wed, 13 Apr 2016 23:42:40 +0000 (UTC) Message-ID: References: <2016-04-13T22-34-23@devnull.Karl-Voit.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqUQw-00047A-UM for emacs-orgmode@gnu.org; Wed, 13 Apr 2016 19:42:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqUQr-0005WF-VY for emacs-orgmode@gnu.org; Wed, 13 Apr 2016 19:42:54 -0400 Received: from plane.gmane.org ([80.91.229.3]:53439) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqUQr-0005W2-P1 for emacs-orgmode@gnu.org; Wed, 13 Apr 2016 19:42:49 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aqUQp-0000F6-88 for emacs-orgmode@gnu.org; Thu, 14 Apr 2016 01:42:47 +0200 Received: from 172-0-42-27.lightspeed.ltrkar.sbcglobal.net ([172.0.42.27]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 14 Apr 2016 01:42:47 +0200 Received: from adam by 172-0-42-27.lightspeed.ltrkar.sbcglobal.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 14 Apr 2016 01:42:47 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Hi Karl, This seems strange to me too. I tested your code and found that the screenshot always showed the pre-agenda state of the frame, showing the lisp window at the top and the helm-M-x window at the bottom, the way it looked when I hit RET to run the command. However, I tried stepping through the function with edebug, and then it worked properly: the screenshot was taken after the agenda displayed, and it showed the agenda in the screenshot. I don't know much about Emacs internals, but I'm guessing that something's preventing the frame from being repainted until the function finishes. Maybe you could use a separate function to take the screenshot and call it with a timer?