[Top][All Lists]

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

Re: [Orgmode] org-babel-tangle-w-comments has no effect in R?

From: Rainer M Krug
Subject: Re: [Orgmode] org-babel-tangle-w-comments has no effect in R?
Date: Fri, 2 Jul 2010 09:22:43 +0200

On Thu, Jul 1, 2010 at 5:41 PM, Eric Schulte <address@hidden> wrote:
Hi Rainer,

Hi Eric

There is one more requirement for tangling with comments, that is the
presence of a :comments header argument.  If this argument is not set
for a code block then that code block *will not* be tangled with
comments regardless of the value of `org-babel-tangle-w-comments'.

That explains.

You can set this variable to default to true for R code blocks with the

 (add-to-list 'org-babel-default-header-args:R '(:comments . "yes"))

OK - it is working.
What I actually did, was to add
   #+BABEL: :comments yes

to the headers of the file, so I can control it on a file basis.

Hope this helps.


I think that moving forward it might make sense to remove the
org-babel-tangle-w-comments variable, as it's confusing to have two
points of control for comments during tangling.  Also, it looks like I
need to add the :comments header argument to the babel documentation.

Both points agreed.

In addition: is it possible to customize the format for all comments (on a per file basis and / or a per block basis)? i.e. I don't need the file name, as all blocks are coming from one file. I know about

  #+srcname: <name>

but is there a variable for the line number (I guess that is covered by the request posted in another thread) one could use?

Also, would it be possible to include a link in the comment block, so that clicking on that link actually opens the org-file file at the location of the source block? That would make editing the code really easy.

Thanks for helping to sort some of these issues out!

Pleasure - I use them and I profit when they are sorted out. In addition: I think org-mode and babel deserve it - they are great tools for programming in R.




Best -- Eric

Rainer M Krug <address@hidden> writes:

> Hi
> I am trying to use "tangle with comments". Based on a previous thread, I
> set org-babel-tangle-w-comments to t with
>  (setq org-babel-tangle-w-comments t)
> in my emacs.org file.
> The variable is actually set to 1 - I checked vie C-h - v
> But nothing is changing in the tangled file? Am I doing something wrong? Or
> are comments not supported in R in org-babel?
> I attach a small testfile.
> Cheers,
> Rainer


Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
South Africa

Cell:           +27 - (0)83 9479 042
Fax:            +27 - (0)86 516 2782
Fax:            +49 - (0)321 2125 2244
email:          address@hidden

Skype:          RMkrug
Google:         address@hidden

reply via email to

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