From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: (no subject) Date: Mon, 23 Jan 2012 13:31:36 -0700 Message-ID: <87aa5eqhxz.fsf@gmx.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:52144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RpQYM-0002ez-4V for emacs-orgmode@gnu.org; Mon, 23 Jan 2012 15:31:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RpQYK-0003KW-Lu for emacs-orgmode@gnu.org; Mon, 23 Jan 2012 15:31:46 -0500 Received: from mailout-us.gmx.com ([74.208.5.67]:43427) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RpQYK-0003KK-BP for emacs-orgmode@gnu.org; Mon, 23 Jan 2012 15:31:44 -0500 In-Reply-To: (Tom Regner's message of "Mon, 23 Jan 2012 13:00:47 +0100") 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: Tom Regner Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain I'd rather not change the default silently in this way. Could you provide a minimal example of the difference you describe? I just tried viewing the expanded form of the following code block and saw no difference between :noweb-ref and normal #+name: based expansions. --=-=-= Content-Type: text/x-org Content-Disposition: inline; filename=nowebs.org * examples #+name: first #+begin_src sh echo 1 #+end_src #+begin_src sh :noweb-ref second echo 2 #+end_src #+begin_src sh :noweb yes <> <> #+end_src --=-=-= Content-Type: text/plain Thanks, Tom Regner writes: > From aea3adc952de33aa9acad94fbd9baa717b7b1a1e Mon Sep 17 00:00:00 2001 > From: Tom Regner > Rcpt To: emacs-orgmode@gnu.org > Date: Mon, 23 Jan 2012 12:39:52 +0100 > Subject: [PATCH] ob.el Adhere to current :padline header during noweb dereferencing. > > At the moment using the :noweb-ref: property approach on subtrees results in the tangled code beeing broken > because the newlines before the #+end_src line are excluded from the output. This patch uses :padline > to check if a newline should be added. The default being yes, tangling with subtree mangling now produces correct > results; code depending on the (errorneous?) behaviour would be broken though. > --- > lisp/ob.el | 9 ++++++--- > 1 files changed, 6 insertions(+), 3 deletions(-) > > diff --git a/lisp/ob.el b/lisp/ob.el > index 47be708..398a997 100644 > --- a/lisp/ob.el > +++ b/lisp/ob.el > @@ -2211,13 +2211,16 @@ block but are passed literally to the \"example-block\"." > (nth 4 i)) > source-name) > (let* ((body (org-babel-expand-noweb-references i)) > - (full (if comment > + (padded (if (not (string= "no" (cdr (assoc :padline (nth 2 i))))) > + (concat body "\n") > + body )) > + (full (if comment > ((lambda (cs) > (concat (c-wrap (car cs)) "\n" > - body "\n" > + padded "\n" > (c-wrap (cadr cs)))) > (org-babel-tangle-comment-links i)) > - body))) > + padded))) > (setq expansion (concat expansion full)))))))) > expansion) > ;; possibly raise an error if named block doesn't exist -- Eric Schulte http://cs.unm.edu/~eschulte/ --=-=-=--