From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: org-redisplay-inline-images and export to HTML Date: Mon, 21 Jul 2014 19:17:05 -0400 Message-ID: <87vbqq5mku.fsf@alphaville.bos.redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X9Mpl-0001lX-HT for emacs-orgmode@gnu.org; Mon, 21 Jul 2014 19:17:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X9Mpf-0001iD-Fk for emacs-orgmode@gnu.org; Mon, 21 Jul 2014 19:17:29 -0400 Received: from plane.gmane.org ([80.91.229.3]:58789) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X9Mpf-0001i9-8v for emacs-orgmode@gnu.org; Mon, 21 Jul 2014 19:17:23 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1X9Mpd-0001KW-Ui for emacs-orgmode@gnu.org; Tue, 22 Jul 2014 01:17:21 +0200 Received: from pool-98-110-160-12.bstnma.fios.verizon.net ([98.110.160.12]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 22 Jul 2014 01:17:21 +0200 Received: from ndokos by pool-98-110-160-12.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 22 Jul 2014 01:17:21 +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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Brett Viren writes: > Someone recently posted a tip to add > > :post (org-redisplay-inline-images) > > to a SRC block which generates an image in order to freshen the Emacs > buffer with the regenerated image each time the block is executed. It > works *almost* fine but I have two problems which I hope someone can > help with. > > > 1) Priming-the-pump > ... > > 2) Post-priming, still no HTML export > > ... > > So, the upshot is I have to keep adding and removing the :post to make > things work in different contexts. This is obviously not so smooth. > > > Is there some way to both have my cake an eat it too? > The :post trick works by side-effect: org-redisplay-inline-images does what it says and it returns the string that `message' prints in the echo area. Unfortunately, on export, :post is processed further with the result that the meaningless string is passed to org-babel-ref-resolve as a reference to be resolved - with predictable results[fn:1]. I think you'd be better off with the tip that Rick Frankel posted in the same thread: --8<---------------cut here---------------start------------->8--- #+BEGIN_SRC emacs-lisp (add-hook 'org-babel-after-execute-hook (lambda () (org-display-inline-images nil t))) #+END_SRC --8<---------------cut here---------------end--------------->8--- That's executed after you evaluate the block so it displays any image(s) produced. And it does not interfere with export. Footnotes: [fn:1] Assuming 20-20 hindsight of course... Nick