From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brett Viren Subject: org-redisplay-inline-images and export to HTML Date: Mon, 21 Jul 2014 18:12:10 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X9Lp4-0007F4-U1 for emacs-orgmode@gnu.org; Mon, 21 Jul 2014 18:12:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X9Lov-0006dH-RV for emacs-orgmode@gnu.org; Mon, 21 Jul 2014 18:12:42 -0400 Received: from smtpgw.bnl.gov ([2620:10a:0:3::30]:53759 helo=iron4.sec.bnl.local) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X9Lov-0006TB-KA for emacs-orgmode@gnu.org; Mon, 21 Jul 2014 18:12:33 -0400 Received: from bviren by lycastus.phy.bnl.gov with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1X9LoZ-0006uk-Af for emacs-orgmode@gnu.org; Mon, 21 Jul 2014 18:12:11 -0400 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 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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 I'm using a document containing a GraphViz graph and running "dot" on it: =2D--------------------------------------------------------------------- #+BEGIN_SRC dot :cmd dot :cmdline -Tpng :file foo.png :exports results :pos= t (org-redisplay-inline-images)=20 digraph "foo" { rankdir=3DLR; params -> builders; builders -> objects; objects -> file; } #+END_SRC =2D--------------------------------------------------------------------- I do "C-c C-c" in the block and the buffer does not display any result. I see the messages: =2D--------------------------------------------------------------------- No images to display inline executing Dot code block... Wrote /tmp/babel-11819Iqr/ob-input-11819Lrv org-babel-ref-resolve: Reference 'No images to display inline' not found in= this buffer =2D--------------------------------------------------------------------- If I do "C-c hh" to export to HTML I see: =2D--------------------------------------------------------------------- org-babel-exp processing... No images to display inline [2 times] executing Dot code block... Wrote /tmp/babel-11819Iqr/ob-input-11819kTR org-babel-ref-resolve: Reference 'No images to display inline' not found in= this buffer =2D--------------------------------------------------------------------- And I get no HTML file produced. If I now take out the :post and do "C-c C-c" I get this appearing just after the SRC block as expected: =2D--------------------------------------------------------------------- #+RESULTS: [[file:foo.png]] =2D--------------------------------------------------------------------- If I now add back the ":post" and do "C-c C-c" again I get the inlined image. I can now edit the SRC block and repeat the "C-c C-c" and I am pleased to see the figure refresh each time. It's great! But, it needs this "pump priming". 2) Post-priming, still no HTML export After this "priming the pump" is done the second problem is that still a "C-c hh" does not produce an exported HTML file. Similar messages: =2D--------------------------------------------------------------------- org-babel-exp processing... No images to display inline Inline image display turned off No images to display inline executing Dot code block... Wrote /tmp/babel-11819Iqr/ob-input-11819zYx org-babel-ref-resolve: Reference 'No images to display inline' not found in= this buffer =2D--------------------------------------------------------------------- Finally, if I remove the :post but leave the "#+RESULTS:" I can do=20 a successful "C-c hh".=20=20 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? Thanks! =2DBrett. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlPNkDsACgkQEixH2Z0dKCyN5wCdEzggbz26PHlx9F4e+rlm8a4I S2sAnA9rzUrGc+diaOth1GTVMVgNj+xs =dyk4 -----END PGP SIGNATURE----- --=-=-=--