emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* trying to automatically refresh inline images after org-babel-execute:ditaa
@ 2016-10-11 17:01 Stig Brautaset
  2016-10-11 17:42 ` Grant Rettke
  0 siblings, 1 reply; 2+ messages in thread
From: Stig Brautaset @ 2016-10-11 17:01 UTC (permalink / raw)
  To: emacs-orgmode

Hello!

I'm trying to automatically update inline ditaa images, by adding this
advice:

,----
|   (advice-add 'org-babel-execute:ditaa
|               :after
|               (lambda (a &rest b)
|                 (message "my sage advice")
|                 (org-redisplay-inline-images)))
`----

When hitting =C-c C-c= in a =#+begin_src ditaa= block I *do* get my sage
advice printed to *Messages*, but inline images just blinks out of
existence. Is the image overlay removed at a higher level?

Any advice (hah!) welcome.

Stig

-- 
: Stig Brautaset, GNU Emacs 25.1.1, Org-mode version 8.3.6

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: trying to automatically refresh inline images after org-babel-execute:ditaa
  2016-10-11 17:01 trying to automatically refresh inline images after org-babel-execute:ditaa Stig Brautaset
@ 2016-10-11 17:42 ` Grant Rettke
  0 siblings, 0 replies; 2+ messages in thread
From: Grant Rettke @ 2016-10-11 17:42 UTC (permalink / raw)
  To: Stig Brautaset; +Cc: emacs-orgmode@gnu.org

On Tue, Oct 11, 2016 at 12:01 PM, Stig Brautaset <stig@brautaset.org> wrote:
> Hello!
>
> I'm trying to automatically update inline ditaa images, by adding this
> advice:
>
> ,----
> |   (advice-add 'org-babel-execute:ditaa
> |               :after
> |               (lambda (a &rest b)
> |                 (message "my sage advice")
> |                 (org-redisplay-inline-images)))
> `----
>
> When hitting =C-c C-c= in a =#+begin_src ditaa= block I *do* get my sage
> advice printed to *Messages*, but inline images just blinks out of
> existence. Is the image overlay removed at a higher level?
>
> Any advice (hah!) welcome.

(defun help/org-babel-after-execute-hook ()
  "HELP settings for the `org-babel-after-execute-hook'.

This does not interfere with exports.

Attribution: URL
`https://lists.gnu.org/archive/html/emacs-orgmode/2015-01/msg00534.html'"
  (interactive)
  (org-redisplay-inline-images))

(add-hook 'org-babel-after-execute-hook #'help/org-babel-after-execute-hook)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-11 17:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-11 17:01 trying to automatically refresh inline images after org-babel-execute:ditaa Stig Brautaset
2016-10-11 17:42 ` Grant Rettke

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).