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