emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] inline src block results can be removed


From: Charles C. Berry
Subject: Re: [O] [PATCH] inline src block results can be removed
Date: Fri, 14 Nov 2014 09:43:16 -0800
User-agent: Alpine 2.00 (OSX 1167 2008-08-23)


Nicolas,

More patches (as you can see). Now ox.el, ob-core.el, and ob-exp.el are patched.

A few examples of how they render various src_<lang>[headers]{code} setups are also attached.

Discussion inline below.


On Thu, 13 Nov 2014, Nicolas Goaziou wrote:

Hello,

"Charles C. Berry" <address@hidden> writes:

I like the flexibility that macros would allow.

I like it too. Macros are much better than export snippets for the task.

I don't think the usual #+MACRO works here, as the definition would be
found in `org-macro-templates' by the first call and existing stuff
would be expanded instead of being left for babel to remove it. But
setting it up as a document keyword should work, right?

Don't know if there are other gotchas.

Maybe a limited collection of formats could be set up to support basic
markup options and the macro could choose amongst them with a second
arg set by a babel header arg.

I think {{{results()}}} should remain a dumb wrapper itself and not try
to do some formatting (i.e., a simple, hard-coded macro). Formatting
should be on the side of Babel and, possibly, its arguments. Let's not
duplicate features.


Point taken.

Also, the user can customize org-babel-inline-result-wrap to always get verbatim or otherwise wrap the contents of the macro.

I am not quite sure how to marry this to header args. Maybe the :wrap
header arg should be hijacked for inline src blocks to specify a macro
for the results.

Macro can be the default output. If you don't want a macro, use raw
header. IOW, there is no need for a specific header arg.

I mean, does anyone actually use stuff like src_R[:wrap latex]{1+2}?
The current result cannot be parsed as an export block, AFAICS.

It could evaluate to @@latex:3@@. Parsing can also be solved if
necessary.

 `:wrap latex' results in @@latex: ... @@.

 `:results latex' results in
:     @@LaTeX:
:     <results>@@

which is a bit unsightly, but can be parsed and removed.

I have not touched
 - :RESULTS drawers
 - lists
 - tables

---

I appreciate your coaching/feedback.

Aaron Ecay's suggestion to use a macro was a good one. Thanks Aron.

Best,

Chuck

Attachment: 0001-lisp-ob-core.el-Replace-inline-results-macro-call-or.patch
Description: ob-core.el patch

Attachment: 0002-lisp-ob-exp.el-Enable-removable-inline-src-results.patch
Description: ob-exp.el patch

Attachment: 0003-lisp-ox.el-Enable-removable-inline-src-results.patch
Description: ox.el patch

Attachment: inline-examples.org
Description: examples of inline src calls and output


reply via email to

[Prev in Thread] Current Thread [Next in Thread]