From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: org-babel-tangle-w-comments has no effect in R? Date: Fri, 2 Jul 2010 09:22:43 +0200 Message-ID: References: <87r5jnqke0.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0658719643==" Return-path: Received: from [140.186.70.92] (port=36432 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OUaaH-0003sN-92 for emacs-orgmode@gnu.org; Fri, 02 Jul 2010 03:22:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OUaaF-0007xo-Oz for emacs-orgmode@gnu.org; Fri, 02 Jul 2010 03:22:49 -0400 Received: from mail-px0-f169.google.com ([209.85.212.169]:56537) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUaaF-0007xY-G3 for emacs-orgmode@gnu.org; Fri, 02 Jul 2010 03:22:47 -0400 Received: by pxi17 with SMTP id 17so2812276pxi.0 for ; Fri, 02 Jul 2010 00:22:46 -0700 (PDT) In-Reply-To: <87r5jnqke0.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: emacs-orgmode --===============0658719643== Content-Type: multipart/alternative; boundary=001636456f0cf89db9048a627306 --001636456f0cf89db9048a627306 Content-Type: text/plain; charset=ISO-8859-1 On Thu, Jul 1, 2010 at 5:41 PM, Eric Schulte 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 > following > > (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. > Definitely. > > 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: 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. Cheers, Rainer > > Best -- Eric > > Rainer M Krug 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 > -- NEW GERMAN FAX NUMBER!!! 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 Stellenbosch South Africa Cell: +27 - (0)83 9479 042 Fax: +27 - (0)86 516 2782 Fax: +49 - (0)321 2125 2244 email: Rainer@krugs.de Skype: RMkrug Google: R.M.Krug@gmail.com --001636456f0cf89db9048a627306 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Thu, Jul 1, 2010 at 5:41 PM, Eric Sch= ulte <schult= e.eric@gmail.com> wrote:
Hi Rainer,

Hi Eric
=A0

There is one more requirement for tangling with comments, that is the
presence of a :comments header argument. =A0If 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'.
<= /blockquote>

That explains.
=A0

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

=A0(add-to-list 'org-babel-default-header-args:R '(:comments . &qu= ot;yes"))

OK - it is working.
What I actua= lly did, was to add
=A0
=A0=A0 #+BABEL: :comments yes

to the h= eaders of the file, so I can control it on a file basis.


Hope this helps.

Definitely.
=A0

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. =A0Also, 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 pe= r block basis)? i.e. I don't need the file name, as all blocks are comi= ng from one file. I know about

=A0 #+srcname: <name>

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

Also, would it be possible to include a link in the co= mment 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 real= ly easy.

Thanks for helping to sort some of these issues out!
<= br>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 programm= ing in R.

Cheers,

Rainer

=A0

Best -- Eric

Rainer M Krug <r.m.krug@gmail.com<= /a>> writes:

> Hi
>
> I am trying to use "tangle with comments". Based on a previo= us thread, I
> set org-babel-tangle-w-comments to t with
> =A0(setq org-babel-tangle-w-comments t)
> in my
emacs.org fil= e.
>
> 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 wron= g? Or
> are comments not supported in R in org-babel?
>
> I attach a small testfile.
>
> Cheers,
>
> Rainer



--
NEW GERMAN = FAX NUMBER!!!

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

Centre of Excellen= ce for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch UniversityMain Campus, Merriman Avenue
Stellenbosch
South Africa

Cell:= =A0 =A0 =A0 =A0 =A0 +27 - (0)83 9479 042
Fax: =A0 =A0 =A0 =A0 =A0 =A0+2= 7 - (0)86 516 2782
Fax: =A0 =A0 =A0 =A0 =A0 =A0+49 - (0)321 2125 2244
email: =A0 =A0 =A0 = =A0 =A0Rainer@krugs.de

Skype:= =A0 =A0 =A0 =A0 =A0RMkrug
Google: =A0 =A0 =A0 =A0 R.M.Krug@gmail.com

--001636456f0cf89db9048a627306-- --===============0658719643== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============0658719643==--