From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Literate Programming - Continue a Source Block? Date: Fri, 10 Jun 2011 13:09:58 -0600 Message-ID: <877h8tv6yh.fsf@gmail.com> References: <87pqmokh6d.fsf@fester.com> <80k4cw22uf.fsf@somewhere.org> <87fwnkjqoh.fsf@fester.com> <87mxhsnmcf.fsf@gmail.com> <877h8wj9za.fsf@fester.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:51355) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QV75t-00038F-5z for emacs-orgmode@gnu.org; Fri, 10 Jun 2011 15:10:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QV75q-0005bF-Ny for emacs-orgmode@gnu.org; Fri, 10 Jun 2011 15:10:08 -0400 Received: from mail-px0-f179.google.com ([209.85.212.179]:33490) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QV75q-0005Zn-7t for emacs-orgmode@gnu.org; Fri, 10 Jun 2011 15:10:06 -0400 Received: by pxi2 with SMTP id 2so1722270pxi.38 for ; Fri, 10 Jun 2011 12:10:05 -0700 (PDT) In-Reply-To: <877h8wj9za.fsf@fester.com> (Neeum Zawan's message of "Wed, 08 Jun 2011 14:20:57 -0700") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Neeum Zawan Cc: emacs-orgmode@gnu.org >> >> I like the concision of the "=original-name" syntax used by noweb, but I >> would lean towards the use of a ":noweb-append" type header argument as >> suggested above because currently the names of blocks in Babel carry no >> semantic content and I'd prefer to leave it this way. > > I suppose it may also break compatibility in case someone out there uses > the =symbol. > > Had it been thought of earlier, I would have preferred the default > behavior being append if you have multiple blocks of the same name, and > an explicit option *not* to append but to overwrite, but your idea makes > the most sense with respect to preserving backward compatibility. > > In addition to append, there probably should be another option for > overwriting instead of appending (neither is possible right now). > I've just pushed up a patch which implements optional block combination during tangling. Specifically a new customization variable named `org-babel-tangle-named-block-combination' is introduced which can take the following values nil the default, no behavior is changed append the bodies of all blocks of the same name are appended during tangling first only the body of the first block of any given name is kept during tangling last only the body of the last block of any given name is kept during tangling > > Also, just on the side, I'm not sure it's documented anywhere what > happens if you have multiple source code blocks of the same name. At the > moment, it seems only the first is used (I would have expected the > last). > Yes, currently block names are intended to be unique, and some of the Babel functionality (e.g., named block evaluation) make this assumption. The behavior of multiple blocks with the same name is undefined behavior. I've expanded the relevant documentation. > >> Thanks for the motivating example and the thorough explanation of >> behavior. >> >> I'll certainly put this on my long-term development queue, however, that >> does not guarantee an implementation in the near future. If anyone is >> interested in this functionality and is up for writing some elisp I am >> happy to offer advice and code pointers immediately. > > Wish I knew elisp. Anyway, hopefully someone will get it done one day. > Hopefully this gets at the behavior you're after. I'd be interested to hear any thought you have on this new functionality. Cheers -- Eric -- Eric Schulte http://cs.unm.edu/~eschulte/