Hi Neeum, Neeum Zawan <mailingli...@nawaz.org> writes:
> Eric Schulte <schulte.e...@gmail.com> writes: > >> Hi Neeum, >> >> Thanks for your feedback. Your point is well taken about the >> flexibility of header arguments, and the ability of a header argument >> based solution to overwrite blocks. >> >> I would mention that variables such as the newly introduced >> `org-babel-tangle-named-block-combination' may be easily set on a >> per-file bases using file local variables---basically adding a line like >> the following to the top of your Org-mode file. > > Somehow I couldn't get your new function to work. The variable is set to > append, and I removed all org-modes from my system except the latest > from git. I even ensured that this code gets executed: > > (append (mapconcat #'identity > named "\n")) > > However, the output I get is the same as before - it just uses the first > source block. > Could you try the attached example file? I first evaluated the following elisp code to set the combination variable's value to append. #+begin_src emacs-lisp (setq org-babel-tangle-named-block-combination 'append) #+end_src I then call org-babel-tangle in the attached Org-mode file to generate the attached elisp file.
* continued code blocks :PROPERTIES: :tangle: yes :comments: yes :END: #+source: foo #+begin_src emacs-lisp (message "foo:%S" 1) #+end_src #+begin_src emacs-lisp (message "un-named") #+end_src #+source: bar #+begin_src emacs-lisp (message "bar:%S" 1) #+end_src #+source: foo #+begin_src emacs-lisp (message "foo:%S" 2) #+end_src #+source: bar #+begin_src emacs-lisp (message "bar:%S" 2) #+end_src #+begin_src emacs-lisp :tangle no :results silent (with-temp-buffer (insert-file-contents "scraps.el") (eval-buffer)) #+end_src
combined-tangle-example.el
Description: application/emacs-lisp
> > Incidentally, why do we need "\n" as a separator? What if I wanted to > do (in Python) > > def func(a, b, <<func_args>>): > stuff > > In other words, I want to add more arguments later on. Wouldn't a \n > mess things up here? > Ah, this is a good point. I've just changed the code to avoid inserting superfluous newlines. Thanks! Cheers -- Eric > > > Thanks. > > -- Eric Schulte http://cs.unm.edu/~eschulte/