From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [babel] `org-babel-tangle-w-comments' controls comment insertion in tangled code Date: Fri, 28 May 2010 09:57:06 -0600 Message-ID: <878w746mul.fsf@gmail.com> References: <87sk5c8497.fsf@gmail.com> <4BFFE4A7.9070300@ccbr.umn.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=50934 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OI1vs-0003pB-0S for emacs-orgmode@gnu.org; Fri, 28 May 2010 11:57:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OI1vq-0000Yx-DG for emacs-orgmode@gnu.org; Fri, 28 May 2010 11:57:11 -0400 Received: from mail-pz0-f199.google.com ([209.85.222.199]:34748) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OI1vq-0000Yl-5L for emacs-orgmode@gnu.org; Fri, 28 May 2010 11:57:10 -0400 Received: by pzk37 with SMTP id 37so855913pzk.27 for ; Fri, 28 May 2010 08:57:09 -0700 (PDT) In-Reply-To: <4BFFE4A7.9070300@ccbr.umn.edu> (Erik Iverson's message of "Fri, 28 May 2010 10:43:35 -0500") 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: Erik Iverson Cc: Org Mode Hi Erik, explanation below Erik Iverson writes: > Eric Schulte wrote: >> Hi, >> >> The insertion of automatically generated comments in tangled source code >> is now controlled by the new `org-babel-tangle-w-comments' variable. >> Setting this variable to non-nil will allow org-babel to insert comments >> for those languages with comment support. > > Can you briefly elaborate on what this means? I'm used to seeing, > when I tangle an R file, something like: > > ## [[file:~/private/R-org-babel/test.org::*cube%20lets%20go%20to%20the][block-2]] > > cube <- function(x) { > # a test comment > x * x * x * x > } > ## block-2 ends here > what was previously exported as will now be exported as --8<---------------cut here---------------start------------->8--- cube <- function(x) { # a test comment x * x * x * x } --8<---------------cut here---------------end--------------->8--- unless the `org-babel-tangle-w-comments' variable is set to a non-nil value. > > So, you mean that all three of the comments would no longer appear by > default? Or you mean that only my inline function comment would not > appear? > The outer two comments of ## [[file:~/private/R-org-babel/test.org::*cube%20lets%20go%20to%20the][block-2]] and ## block-2 ends here will not appear. Your own comments inside of the source-code block will still appear. Is that clear? Thanks for pointing out the insufficient explanation. > > One more idea I had was that it might be interesting to be able to > maintain properties for headlines that indicate the headline/body > should be included as a comment in a specific source file. The reason > I say this is that even if I write my code in org-mode, and in effect > comment the code using org-mode constructs like headlines and free > text, someone who just wants the tangled file might want to see > comments, for example, function headers or something like that. > > Any thoughts on that? Yes, that sounds like a good idea. Maybe we should allow either exporting just the headlines of the org-mode file or exporting the entire org-mode file -- possibly after an ASCII export -- this would have the effect of prefixing every line in the org-mode file behind a comment *except* for the tangled source-code blocks. Implementation wise I'm not sure how easy/difficult this would be, but I definitely think it's worth looking into. Have I understood your suggestion? Best -- Eric