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 <[email protected]> writes:
> E Sabof <[email protected]> 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,