[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] ob-clojure: possible to display results as soon as something is
From: |
John Kitchin |
Subject: |
Re: [O] ob-clojure: possible to display results as soon as something is written to STDOUT? |
Date: |
Wed, 30 Mar 2016 12:58:54 -0400 |
User-agent: |
mu4e 0.9.16; emacs 25.1.50.1 |
a
Frederick Giasson writes:
> Hi John,
>
>> you should rename it org-babel-async-execute:clojure, and adapt it to
>> run clojure.
>
> Yes
>
>> I wrote the function in the org-file that is that post, and executed the
>> code block (C-c C-c) which "registers" the function for that instance of
>> emacs.
>
> I am not sure I understand here. Once you execute the elisp block with
> that function, the function becomes defined for that instance. But when
> you execute your other block, the example python block using C-c C-c,
> how does org-mode knows to use "org-babel-async-execute:python" instead
> of "org-babel-execute:python"??
>
> You put the cursor in the block, and then call it using M-x?
Right, with the cursor in the block type M-x org-babel-async-execute:clojure
>
>> Later you could put it in an init file that is loaded when Emacs starts.
>>
>> and use M-x to call it. Once I added an :async option to the header args
>> to make C-c C-c execute it, but until it works the way you want with M-x
>> that is just convenience ;)
>
> Yes, this is that :async option that would be great and necessary once
> it works using M-x :)
>
> How can this be done? (Is there an extension mechanism in org-mode for
> that, or it needs to hack the core code?)
You can see a commented out version for shell blocks here:
https://github.com/jkitchin/jmax/blob/master/jmax-org.el#L936
It looks like I just redefined the org-babel-execute:sh function after
it was loaded. That may not be recommended good practice, but it works
;)
I am not sure why it is commented out, maybe because I don't use it alot
and its not well tested.
You could always bind your own key sequence instead of C-c C-c.
>
> Thanks,
>
>
> Fred
--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu
- [O] ob-clojure: possible to display results as soon as something is written to STDOUT?, Frederick Giasson, 2016/03/29
- Re: [O] ob-clojure: possible to display results as soon as something is written to STDOUT?, Eric S Fraga, 2016/03/30
- Re: [O] ob-clojure: possible to display results as soon as something is written to STDOUT?, Frederick Giasson, 2016/03/30
- Re: [O] ob-clojure: possible to display results as soon as something is written to STDOUT?, John Kitchin, 2016/03/30
- Re: [O] ob-clojure: possible to display results as soon as something is written to STDOUT?, Eric S Fraga, 2016/03/30
- Re: [O] ob-clojure: possible to display results as soon as something is written to STDOUT?, Frederick Giasson, 2016/03/30
- Re: [O] ob-clojure: possible to display results as soon as something is written to STDOUT?, John Kitchin, 2016/03/30
- Re: [O] ob-clojure: possible to display results as soon as something is written to STDOUT?, Frederick Giasson, 2016/03/30
- Re: [O] ob-clojure: possible to display results as soon as something is written to STDOUT?,
John Kitchin <=
- Re: [O] ob-clojure: possible to display results as soon as something is written to STDOUT?, Frederick Giasson, 2016/03/30