all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Charles C. Berry" <ccberry@ucsd.edu>
To: Aaron Ecay <aaronecay@gmail.com>
Cc: mcg <giepen.m@googlemail.com>,
	Andreas Leha <andreas.leha@med.uni-goettingen.de>,
	emacs-orgmode@gnu.org, Ista Zahn <istazahn@gmail.com>,
	Nicolas Goaziou <mail@nicolasgoaziou.fr>
Subject: Re: [PATCH] inline src block results can be removed
Date: Wed, 12 Nov 2014 15:47:07 -0800	[thread overview]
Message-ID: <alpine.OSX.2.00.1411121407470.1339@charlessmacbook> (raw)
In-Reply-To: <87egt81acy.fsf@gmail.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2147 bytes --]

On Wed, 12 Nov 2014, Aaron Ecay wrote:

> Hi Chuck,
>
> 2014ko azaroak 12an, "Charles C. Berry"-ek idatzi zuen:
>>
>> Inline src blocks cannot update their results --- causing some of us
>> heaadaches [1].
>>
>> These patches fix that by placing the result of an inline src block in an
>> export snippet with a faux :back-end called 'babel'.
>>
>> So C-c C-c with point on src_R{1+2} will insert `@@babel:3@@'. Updating
>> the contents of the inline src block and retyping C-c C-c will update the
>> snippet. On export, these snippets are rendered using the verbatim
>> transcoder, e.g. \texttt{3} for latex backends.
>>
>> Support for most backends is provided.
>>
>> org-babel-execute-buffer will also update such snippets.
>
> Instead of using an export snippet, which requires per-backend changes,
> you could wrap results in a macro, e.g. {{{results(2)}}}.
>
> Users could customize this macro per-buffer (with the usual #+macro
> keyword) to provide their own formatting of inline results.  You
> could provide the fallback interpretation in the second call to
> ‘org-macro-replace-all’ in ‘org-export-as’ (currently responsible
> for expanding a few macros like {{{author}}} and {{{date}}}).
>
> What do you think of this idea?
>

Aaron,

I like the flexibility that macros would allow.

Some care needs to be taken with commas, but not a big deal.

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 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.

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.

Chuck

  reply	other threads:[~2014-11-12 23:50 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-12  0:49 [PATCH] inline src block results can be removed Charles C. Berry
2014-11-12  1:10 ` Andreas Leha
2014-11-12  6:58   ` Charles C. Berry
2014-11-12 19:34 ` Aaron Ecay
2014-11-12 23:47   ` Charles C. Berry [this message]
2014-11-13 17:48     ` Nicolas Goaziou
2014-11-13 19:06       ` Andreas Leha
2014-11-14 17:43       ` Charles C. Berry
2014-11-14 20:39         ` Nicolas Goaziou
2014-11-14 23:04           ` Aaron Ecay
2014-11-16  0:10             ` Nicolas Goaziou
2014-11-15 20:22           ` Charles C. Berry
2014-11-16 23:23             ` Nicolas Goaziou
2014-11-24  9:48               ` Daniele Pizzolli
2014-11-24 10:18                 ` Andreas Leha
2015-01-13  0:48               ` New patches WAS " Charles C. Berry
2015-01-16 22:41                 ` Nicolas Goaziou
2015-01-19  3:22                   ` Charles C. Berry
2015-01-19 17:53                     ` Nicolas Goaziou
2015-01-19 19:31                       ` Charles C. Berry
2015-01-20 23:30                         ` Nicolas Goaziou
2015-01-22  3:07                           ` Charles C. Berry
2015-01-22 23:08                             ` Nicolas Goaziou
2015-01-24 22:47                               ` Charles C. Berry
2015-01-25  1:14                                 ` Aaron Ecay
2015-01-25  5:01                                   ` Charles C. Berry
2015-01-29 20:31                               ` Charles C. Berry
2015-01-17  3:22                 ` Aaron Ecay
2015-01-17 22:20                   ` Nicolas Goaziou
2015-01-18 19:13                     ` Aaron Ecay
2015-01-18 22:34                       ` Nicolas Goaziou
2015-01-18 22:55                         ` Aaron Ecay
  -- strict thread matches above, loose matches on Subject: below --
2014-11-24 11:12 Daniele Pizzolli
2014-11-25  8:04 ` Daniele Pizzolli
2014-11-25  9:52   ` Andreas Leha

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.OSX.2.00.1411121407470.1339@charlessmacbook \
    --to=ccberry@ucsd.edu \
    --cc=aaronecay@gmail.com \
    --cc=andreas.leha@med.uni-goettingen.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=giepen.m@googlemail.com \
    --cc=istazahn@gmail.com \
    --cc=mail@nicolasgoaziou.fr \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.