From: Nick Dokos <ndokos@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: babel completion notification
Date: Mon, 17 Mar 2014 18:03:36 -0400 [thread overview]
Message-ID: <87lhw8wkhz.fsf@alphaville.bos.redhat.com> (raw)
In-Reply-To: m2siqgec8y.fsf@gmail.com
Ken Mankoff <mankoff@gmail.com> writes:
> Hi Eric,
>
> On 2014-03-17 at 17:05, Eric Schulte wrote:
>> Ken Mankoff <mankoff@gmail.com> writes:
>>
>>> Until asynchronous babel exists, it would be nice to at least be
>>> notified when long-running tasks complete. Does anyone have advice
>>> how to set up a hook on babel completion so that growl or some
>>> other system notification alerts, perhaps only if the execution
>>> took more than x seconds?
>>
>> You can use the org-babel-after-execute-hook to run any action after a
>> code block finishes executing.
>
> Yes, and your reply makes me recall that :post works too, so I can
> call a shell command "notifier" (or Growl) like this:
>
> #+BEGIN_SRC python -n :results output :post (shell-command-to-string "notifier 'babel done'")
> print "hello, world"
> #+END_SRC
> #+RESULTS:
>
The :post method does not seem to work for me. With:
--8<---------------cut here---------------start------------->8---
#+BEGIN_SRC sh :results output :post (shell-command-to-string "popup.py babel done")
sleep 10
echo DONE
#+END_SRC
--8<---------------cut here---------------end--------------->8---
(popup.py is my homemade notifier) I get the popup immediately and the
results after 10 seconds. The org-babel-after-execute-hook method
worked fine.
Nick
next prev parent reply other threads:[~2014-03-17 22:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-17 20:33 babel completion notification Ken Mankoff
2014-03-17 21:05 ` Eric Schulte
2014-03-17 21:39 ` Ken Mankoff
2014-03-17 22:03 ` Nick Dokos [this message]
2014-03-18 1:07 ` Eric Schulte
2014-03-18 2:44 ` Nick Dokos
2014-03-18 14:32 ` Eric Schulte
2014-03-19 2:00 ` Grant Rettke
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lhw8wkhz.fsf@alphaville.bos.redhat.com \
--to=ndokos@gmail.com \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.