emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <ndokos@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: babel completion notification
Date: Mon, 17 Mar 2014 22:44:35 -0400	[thread overview]
Message-ID: <874n2w1azw.fsf@gmail.com> (raw)
In-Reply-To: 87eh20wbz0.fsf@gmail.com

Eric Schulte <schulte.eric@gmail.com> writes:

> Nick Dokos <ndokos@gmail.com> 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

  reply	other threads:[~2014-03-18  2:45 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
2014-03-18  1:07       ` Eric Schulte
2014-03-18  2:44         ` Nick Dokos [this message]
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

  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=874n2w1azw.fsf@gmail.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 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).