From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: [PATCH] Add :special header argument Date: Sun, 08 Jan 2012 11:31:03 -1000 Message-ID: References: <87ipkm3vda.fsf@Rainer.invalid> <87hb06yniw.fsf@gmx.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:52723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rk0Ke-0004Sp-AX for emacs-orgmode@gnu.org; Sun, 08 Jan 2012 16:31:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rk0Kc-0001Qt-NU for emacs-orgmode@gnu.org; Sun, 08 Jan 2012 16:31:12 -0500 Received: from oproxy9.bluehost.com ([69.89.24.6]:41878) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Rk0Kc-0001Qp-G5 for emacs-orgmode@gnu.org; Sun, 08 Jan 2012 16:31:10 -0500 In-Reply-To: <87hb06yniw.fsf@gmx.com> (Eric Schulte's message of "Sun, 08 Jan 2012 12:58:31 -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: Eric Schulte Cc: Achim Gratz , emacs-orgmode@gnu.org --=-=-= Eric Schulte writes: > Achim Gratz writes: > >> tsd@tsdye.com (Thomas S. Dye) writes: >>> The attached patch defines a new header argument, :special, which wraps >>> the results of Org babel source block execution in a #BEGIN_ ... #+END_ >>> block. The block name is taken from a new variable >>> org-babel-wrap-special, which is initialized as "results". >> >> What is the rationale for feeding the block name via a configuration >> variable rather then a value to the header argument ":special"? >> >> >> Regards, >> Achim. > > Attached is an alternate patch and an example of its use. This patch > introduces a ":wrap" header argument which accepts an optional value > used to specify the name of the block with which to wrap results. If > this looks workable we could push it up once it gets some documentation > and tests. > > Cheers, > > > #+Title: demonstrating the new :wrap header argument > > #+begin_src emacs-lisp :wrap schulte > '((1 2) > (3 4)) > #+end_src > > #+results: > #+BEGIN_schulte > | 1 | 2 | > | 3 | 4 | > #+END_schulte Hi Eric, Thanks for the :wrap header argument. It works for me. The attached patch on top of your patch looks for :wrap drawer, and puts the result in a drawer, rather than wrapping the results in #+begin ... #+end. What I'm trying to do is make :results wrap obsolete. Also, note that with the :wrap header argument, :results org and :results latex are both redundant. I'm not sure how you want to handle this--whether to leave them in place or remove them. I'll volunteer to work on the documentation. All the best, Tom --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-lisp-ob.el-Add-drawer-option-to-wrap.patch Content-Description: Drawer option >From 3c8a9500b3efcf7211946968cb5661f70808be1d Mon Sep 17 00:00:00 2001 From: Thomas Dye Date: Sun, 8 Jan 2012 11:19:39 -1000 Subject: [PATCH] * lisp/ob.el: Add drawer option to :wrap --- lisp/ob.el | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/lisp/ob.el b/lisp/ob.el index b51cc51..923fd6d 100644 --- a/lisp/ob.el +++ b/lisp/ob.el @@ -1757,7 +1757,11 @@ code ---- the results are extracted in the syntax of the source (cond ((assoc :wrap (nth 2 info)) (let ((name (or (cdr (assoc :wrap (nth 2 info))) "results"))) - (wrap (concat "#+BEGIN_" name) (concat "#+END_" name)))) + (if (equal name "drawer") + (wrap ":RESULTS:" ":END:") + (wrap (concat "#+BEGIN_" name) (concat "#+END_" name)) + ) + )) ((member "html" result-params) (wrap "#+BEGIN_HTML" "#+END_HTML")) ((member "latex" result-params) -- 1.7.5.4 --=-=-= -- Thomas S. Dye http://www.tsdye.com --=-=-=--