The last patch is formatted for email. Here's the correct one. Sorry. -deech
On Sun, Aug 22, 2010 at 4:21 PM, aditya siram <aditya.si...@gmail.com>wrote: > The function that loads the code block into the interpreter > org-babel-load-in-session does not do noweb reference expansion. > > I have included a git patch that adds that functionality. > > -deech > > > On Sat, Aug 21, 2010 at 4:42 PM, aditya siram <aditya.si...@gmail.com>wrote: > >> Hi all, >> I have the development version of org-mode and org-babel noweb style >> references are not expanding during evaluation, they are instead copied >> literally into the temp file. They seem to expand fine when tangling. Here >> is file that is failing: >> * Root >> #+begin_src haskell :noweb yes :tangle Main.hs >> <<Imports>> >> <<Test>> >> main = print $ test [1,2,3] >> #+end_src >> >> * Imports >> #+srcname: Imports >> #+begin_src haskell >> import Control.Monad.State >> #+end_src >> >> * Append Function >> #+srcname: Test >> #+begin_src haskell >> test = length >> #+end_src >> >> I have tried unsuccessfully to make "Imports" and "Append Function" >> children of "Root". >> >> Thanks! >> -deech >> > >
commit eeeece26be443438325bb985488bddc784432e97 Author: Aditya Siram <aditya.si...@gmail.com> Date: Sun Aug 22 16:12:17 2010 -0500 Noweb style references are now expanded with loading a code block in a session. diff --git a/lisp/ob.el b/lisp/ob.el index 8557f09..2ecc1db 100644 --- a/lisp/ob.el +++ b/lisp/ob.el @@ -421,8 +421,12 @@ session." (interactive) (let* ((info (or info (org-babel-get-src-block-info))) (lang (nth 0 info)) - (body (nth 1 info)) (params (nth 2 info)) + (body (setf (nth 1 info) + (if (and (cdr (assoc :noweb params)) + (string= "yes" (cdr (assoc :noweb params)))) + (org-babel-expand-noweb-references info) + (nth 1 info)))) (session (cdr (assoc :session params))) (dir (cdr (assoc :dir params))) (default-directory
_______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode