emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Literate Programming - Continue a Source Block?


From: Eric Schulte
Subject: Re: [O] Literate Programming - Continue a Source Block?
Date: Mon, 13 Jun 2011 14:57:18 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Hi Neeum,

Neeum Zawan <address@hidden> writes:

> Eric Schulte <address@hidden> 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.

Attachment: combined-tangle-example.org
Description: Text Data

Attachment: 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/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]