From: John Kitchin <jkitchin@andrew.cmu.edu>
To: Frederick Giasson <fred@fgiasson.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: ob-clojure: possible to display results as soon as something is written to STDOUT?
Date: Wed, 30 Mar 2016 12:58:54 -0400 [thread overview]
Message-ID: <m2fuv77vht.fsf@Johns-MacBook-Air.local> (raw)
In-Reply-To: <56FBE840.8080700@fgiasson.com>
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
next prev parent reply other threads:[~2016-03-30 16:59 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-29 17:44 ob-clojure: possible to display results as soon as something is written to STDOUT? Frederick Giasson
2016-03-30 10:10 ` Eric S Fraga
2016-03-30 12:04 ` Frederick Giasson
2016-03-30 12:30 ` John Kitchin
2016-03-30 12:58 ` Eric S Fraga
2016-03-30 14:07 ` Frederick Giasson
2016-03-30 14:41 ` John Kitchin
2016-03-30 14:52 ` Frederick Giasson
2016-03-30 16:58 ` John Kitchin [this message]
2016-03-30 17:06 ` Frederick Giasson
2016-04-05 13:43 ` Frederick Giasson
2016-04-06 8:26 ` Nicolas Goaziou
2016-04-06 12:10 ` Frederick Giasson
2016-04-06 12:44 ` Nicolas Goaziou
2016-04-06 12:57 ` Frederick Giasson
2016-04-06 13:08 ` Nicolas Goaziou
2016-04-06 13:07 ` Frederick Giasson
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=m2fuv77vht.fsf@Johns-MacBook-Air.local \
--to=jkitchin@andrew.cmu.edu \
--cc=emacs-orgmode@gnu.org \
--cc=fred@fgiasson.com \
/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).