From: tsd@tsdye.com (Thomas S. Dye)
To: Eric Schulte <eric.schulte@gmx.com>
Cc: Achim Gratz <Stromeko@nexgo.de>, emacs-orgmode@gnu.org
Subject: Re: [PATCH] Add :special header argument
Date: Sun, 08 Jan 2012 11:31:03 -1000 [thread overview]
Message-ID: <m139bpubjc.fsf@tsdye.com> (raw)
In-Reply-To: <87hb06yniw.fsf@gmx.com> (Eric Schulte's message of "Sun, 08 Jan 2012 12:58:31 -0700")
[-- Attachment #1: Type: text/plain, Size: 1629 bytes --]
Eric Schulte <eric.schulte@gmx.com> writes:
> Achim Gratz <Stromeko@nexgo.de> 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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Drawer option --]
[-- Type: text/x-patch, Size: 915 bytes --]
From 3c8a9500b3efcf7211946968cb5661f70808be1d Mon Sep 17 00:00:00 2001
From: Thomas Dye <dk@poto.local>
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
[-- Attachment #3: Type: text/plain, Size: 41 bytes --]
--
Thomas S. Dye
http://www.tsdye.com
next prev parent reply other threads:[~2012-01-08 21:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-08 16:12 [PATCH] Add :special header argument Thomas S. Dye
2012-01-08 18:24 ` Achim Gratz
2012-01-08 19:58 ` Eric Schulte
2012-01-08 21:31 ` Thomas S. Dye [this message]
2012-01-12 2:14 ` [PATCH] :wrap header documentation Thomas S. Dye
2012-01-12 2:44 ` Eric Schulte
2012-01-12 4:09 ` Thomas S. Dye
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m139bpubjc.fsf@tsdye.com \
--to=tsd@tsdye.com \
--cc=Stromeko@nexgo.de \
--cc=emacs-orgmode@gnu.org \
--cc=eric.schulte@gmx.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).