From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: babel completion notification Date: Mon, 17 Mar 2014 18:03:36 -0400 Message-ID: <87lhw8wkhz.fsf@alphaville.bos.redhat.com> References: <87iorcwn6g.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPfdX-0002L0-Lq for emacs-orgmode@gnu.org; Mon, 17 Mar 2014 18:04:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPfdR-0004vX-3D for emacs-orgmode@gnu.org; Mon, 17 Mar 2014 18:03:59 -0400 Received: from plane.gmane.org ([80.91.229.3]:56382) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPfdQ-0004v1-R5 for emacs-orgmode@gnu.org; Mon, 17 Mar 2014 18:03:52 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WPfdL-0008U3-4X for emacs-orgmode@gnu.org; Mon, 17 Mar 2014 23:03:47 +0100 Received: from nat-pool-bos-t.redhat.com ([66.187.233.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 17 Mar 2014 23:03:47 +0100 Received: from ndokos by nat-pool-bos-t.redhat.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 17 Mar 2014 23:03:47 +0100 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: emacs-orgmode@gnu.org Ken Mankoff writes: > Hi Eric, > > On 2014-03-17 at 17:05, Eric Schulte wrote: >> Ken Mankoff 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