From mboxrd@z Thu Jan 1 00:00:00 1970 From: E Sabof Subject: Re: Auto-refreshing rendered images from org-babel Date: Thu, 06 Feb 2014 05:51:02 +0000 Message-ID: <87ob2k23i1.fsf@gmail.com> References: <874n4dh3zn.fsf@gmail.com> <87r47h9lrw.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44869) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WBHrl-0002hz-J0 for emacs-orgmode@gnu.org; Thu, 06 Feb 2014 00:51:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WBHre-000746-6z for emacs-orgmode@gnu.org; Thu, 06 Feb 2014 00:51:13 -0500 In-reply-to: <87r47h9lrw.fsf@bzg.ath.cx> 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: Bastien Cc: Org-mode Thanks. I've changed it to the version below, which covers my needs. I think it would make sense as a (default?) feature for ob-dot, ob-ditaa, and any other babel language that renders images. Evgeni ;; Must be defined in a lexical environment (defun es-org-babel-refresh-images-after-execution () (let (refresh-and-remove-self) (setq refresh-and-remove-self (lambda () (org-redisplay-inline-images) (remove-hook 'org-babel-after-execute-hook refresh-and-remove-self))) (add-hook 'org-babel-after-execute-hook refresh-and-remove-self))) (defadvice org-babel-execute:dot (after refresh-images activate) (es-org-babel-refresh-images-after-execution)) Bastien writes: > E Sabof writes: > >> I have the org snippet below. What I would like, is to see the >> rendered image when I press C-c C-c. I can achieve this with the elisp >> snippet below. Is there a "proper", or at least a better way of doing >> this? > > Not tested but should work: > > (add-hook 'org-babel-after-execute-hook 'org-redisplay-inline-images) > > HTH,