[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] New patches WAS Re: [PATCH] inline src block results can be remo
From: |
Nicolas Goaziou |
Subject: |
Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed |
Date: |
Mon, 19 Jan 2015 18:53:55 +0100 |
"Charles C. Berry" <address@hidden> writes:
Thanks for the patches. Here's another round of comments.
> OK. Now those cases (and some others) insert `*Inline error:' and a
> comment as to what the error is and ignore the actual value.
>
> Based on my own experience, I thought it best to allow Babel to run
> without stopping when there are problems with inline src blocks rather
> than stop with an error.
We already stop with an error for missing footnotes definitions or
missing macro templates. I'm not totally against your suggestion, but
I think it would be better to follow this.
> I hope the approach I took modifies `org-macro-expand'.
>
> The "as-is" template returns the macro element :value stripped of the
> leading "{{{<name>(" and the trailing "[\n]?)}}}". The template
> allows macros that mark text - possibly including commas - but do not
> modify it.
Actually I preferred the previous implementation because this one adds
another level of indirection, the (undocumented) "as-is" template.
"results" -> "$1" was more elegant.
We just need an `org-macro-protect-argument' function. I can do the
refactoring if you want.
> I am not sure why you mentioned org-element.el.
The snippet you were using comes from `org-element-macro-parser', in
"org-element.el". If two locations use the same snippet, it is better to
refactor it.
> (defun org-babel-insert-result
> (result &optional result-params info hash indent lang)
> "Insert RESULT into the current buffer.
> -By default RESULT is inserted after the end of the
> -current source block. With optional argument RESULT-PARAMS
> -controls insertion of results in the org-mode file.
> +By default RESULT is inserted after the end of the current source
> +block. The RESULT of an inline source block usually will be
> +wrapped inside a `results' macro and placed on the same line as
> +the inline source block. The macro is stripped upon
> +export. Multiline and non-scalar RESULTS from inline source
> +blocks are fragile and should be avoided. With optional argument
^^^
Two spaces needed.
> +RESULT-PARAMS controls insertion of results in the Org mode file.
> RESULT-PARAMS can take the following values:
"It can take"? Or, "The following values are allowed"...
> + (bad-inline-p
> + (when inlinep
> + (or
> + (and (member "table" result-params) "`:results table'")
> + (and (listp result) "list result")
> + (and (string-match-p "\n.+" result) "multiline result")
> + (and (member "list" result-params) "`:results list'")
> + )))
No parenthesis on their own line.
> +(defun org-babel-remove-inline-result ()
> + "Remove the result of the current inline-src-block.
> +The result must be wrapped in a `results' macro to be
> + removed. Extraneous leading whitespace is trimmed."
> + (let* ((el (org-element-context))
> + (post-blank (org-element-property :post-blank el)))
> + (when (member (org-element-type el) '(inline-src-block
> inline-babel-call))
`member' -> `memq'
Regards,
- [O] New patches WAS Re: [PATCH] inline src block results can be removed, Charles C. Berry, 2015/01/12
- Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed, Nicolas Goaziou, 2015/01/16
- Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed, Charles C. Berry, 2015/01/18
- Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed,
Nicolas Goaziou <=
- Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed, Charles C. Berry, 2015/01/19
- Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed, Nicolas Goaziou, 2015/01/20
- Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed, Charles C. Berry, 2015/01/21
- Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed, Nicolas Goaziou, 2015/01/22
- Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed, Charles C. Berry, 2015/01/24
- Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed, Aaron Ecay, 2015/01/24
- Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed, Charles C. Berry, 2015/01/25
- Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed, Charles C. Berry, 2015/01/29
Re: [O] New patches WAS Re: [PATCH] inline src block results can be removed, Aaron Ecay, 2015/01/16