From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: babel completion notification Date: Mon, 17 Mar 2014 22:44:35 -0400 Message-ID: <874n2w1azw.fsf@gmail.com> References: <87iorcwn6g.fsf@gmail.com> <87lhw8wkhz.fsf@alphaville.bos.redhat.com> <87eh20wbz0.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:32855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPk1P-0000Me-MF for emacs-orgmode@gnu.org; Mon, 17 Mar 2014 22:45:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPk1J-0007ee-3P for emacs-orgmode@gnu.org; Mon, 17 Mar 2014 22:44:55 -0400 Received: from plane.gmane.org ([80.91.229.3]:49742) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPk1I-0007df-SX for emacs-orgmode@gnu.org; Mon, 17 Mar 2014 22:44:49 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WPk1H-0001NQ-9u for emacs-orgmode@gnu.org; Tue, 18 Mar 2014 03:44:47 +0100 Received: from pool-98-110-160-12.bstnma.fios.verizon.net ([98.110.160.12]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 18 Mar 2014 03:44:47 +0100 Received: from ndokos by pool-98-110-160-12.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 18 Mar 2014 03:44: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 Eric Schulte writes: > Nick Dokos writes: > >> (popup.py is my homemade notifier) > > Try adding `(lambda () (shell-command-to-string "popup.py babel done"))' > to your `org-babel-after-execute-hook'. > >> >> I get the popup immediately and the results after 10 seconds. The >> org-babel-after-execute-hook method worked fine. >> Yes, as I said, the hook worked fine :-), although the function would have to be munged so that the notification doesn't pop up indiscriminately after every evaluation. > > That is probably because the elisp form in the :post value is executed > at header-argument parse time before the code block is executed. If > instead your use a code block name as your post header argument it will > only be evaluated after the code block finishes. > Thanks - that's good to know: the fact that it can be applied selectively to certain code blocks does make it a much better solution than the hook. However, there is a problem: --8<---------------cut here---------------start------------->8--- #+name: notify #+BEGIN_SRC emacs-lisp :results none (shell-command "popup.py DONE") #+END_SRC #+name: long-running #+BEGIN_SRC shell :results output :post notify sleep 5 echo DONE #+END_SRC #+RESULTS: long-running : nil --8<---------------cut here---------------end--------------->8--- The result seems to be the result of the notify block, not the long-running one. -- Nick