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: Nicolas Goaziou
Subject: Re: [O] [PATCH] inline src block results can be removed
Date: Mon, 17 Nov 2014 00:23:37 +0100

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

> For now, I'd be willing to make patches that will allow removal of the
> inline src block results that do *not* involve these header args:
>
> - :file <fn>
> - :wrap <wrapper>
> - :results latex html drawer org code
>
> which I can do barely touching `org-babel-insert-result' and this
> simplifies matters a lot.

IMO, we're too much focused on the implementation details. We ought to
agree on what should be done first. For example, considering
`org-babel-insert-result' and its RESULT-PARAMS argument, I think the
following makes sense:

  | Param   | Example output                    |
  |---------+-----------------------------------|
  | default | {{{results(42)}}}                 |
  | file    | {{{results(file:something.pdf)}}} |
  | list    |                                   |
  | raw     | 42                                |
  | drawer  |                                   |
  | org     | {{{results(src_org{...})}}}        |
  | html    | {{{results(@@html:...@@)}}}       |
  | latex   | {{{results(@@latex:...@@)}}}      |
  | code    | {{{results(src_xxx{...})}}}        |

Basically, it should be possible to remove any kind of result using
"results" macro, with the exception of "raw".  "list" and "drawer" can
be ignored since there is no inline equivalent.

Another option for "drawer" is to also use export snippets. So,
basically, "drawer something" would generate
{{{results(@@something:...@@)}}}.

> I propose to do this by using the patches of ox.el and ob-exp.el from
> my last post. For ob-core.el, I would
>
> - leave defcustom org-babel-inline-wrap as "=%s=" (or use defconst - I
>    do not have a strong opinion either way).

`org-babel-inline-wrap' as a defcustom is fine if you hardcode
{{{results(...)}}} wrapping at a higher level.

> - modify `org-babel-examplify-region' along these lines
>    #+BEGIN_SRC emacs-lisp
>      (insert
>       (replace-regexp-in-string
>        "," "\\,"
>        (format
>         (concat "{{{results("
>                 org-babel-inline-result-wrap
>                 ")}}}"
>                 (prog1 (buffer-substring beg end)
>                   (delete-region beg end))))
>        nil t))
>
>    #+END_SRC

But this is unrelated to "examplify". Wrapping should probably be
a dedicated function systematically called on results from an inline
block.

> If it is felt that more retooling of `org-babel-insert-results' is really 
> needed, I can get to it early next year. In fact, I'll be out of email 
> range from late this month till then, so any problems I create now will 
> have to wait till then for me to work on them.

It's going to be difficult not to alter `org-babel-insert-results' since
the plan is to change completely how inline source blocks are handled.

There's no rush, however. Non-removable results from inline source
blocks have been there for a long time.


Regards,



reply via email to

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