From: E Sabof <esabof@gmail.com>
To: Bastien <bzg@gnu.org>
Cc: Org-mode <emacs-orgmode@gnu.org>
Subject: Re: Auto-refreshing rendered images from org-babel
Date: Thu, 06 Feb 2014 05:51:02 +0000 [thread overview]
Message-ID: <87ob2k23i1.fsf@gmail.com> (raw)
In-Reply-To: <87r47h9lrw.fsf@bzg.ath.cx>
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 <bzg@gnu.org> writes:
> E Sabof <esabof@gmail.com> 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,
next prev parent reply other threads:[~2014-02-06 5:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-05 17:19 Auto-refreshing rendered images from org-babel E Sabof
2014-02-05 23:34 ` Bastien
2014-02-06 5:51 ` E Sabof [this message]
2014-02-06 8:45 ` Bastien
2014-02-06 9:06 ` E Sabof
2014-02-06 9:10 ` Bastien
2014-02-06 9:39 ` E Sabof
2014-02-06 9:46 ` Rainer M Krug
2014-02-06 9:52 ` Bastien
2014-02-06 10:09 ` Rainer M Krug
2014-02-06 10:22 ` Bastien
2014-02-06 10:26 ` Rainer M Krug
2014-02-06 12:22 ` Eric S Fraga
2014-02-06 13:24 ` Rainer M Krug
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ob2k23i1.fsf@gmail.com \
--to=esabof@gmail.com \
--cc=bzg@gnu.org \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).