emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [BUG] Re: header argument :noweb-ref seems can't be resolved


From: Nicolas Goaziou
Subject: Re: [O] [BUG] Re: header argument :noweb-ref seems can't be resolved
Date: Tue, 19 Dec 2017 20:00:59 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Hello,

"Berry, Charles" <address@hidden> writes:

> I guess I was unclear. There are two ways to fix this.
>
> 1) let bind org-babel-current-src-block-location in
> org-babel-expand-noweb-references in the loop that scans for
> noweb-ref'ed src blocks. This fixes the bug, but contradicts the
> docstring for o-b-c-s-b-l, which says it is the location of the
> currently executing src block. Maybe not a big deal, since
> `org-babel-exp-src-block' can export blocks that are not actually
> executed which is another contradiction of the docstring. Maybe change
> the docstring.
>
> 2) rewrite org-babel-params-from-properties to add an optional arg
> `src-block-location' and use it when provided to govern where to look
> up properties. Modify `org-babel-get-src-block-info' accordingly to
> add that arg when calling o-b-p-f-p. This honors the use of
> o-b-c-s-b-l as the location of the executing src block, but inflates
> the code to accommodate just the `noweb-ref' case.
>
> I think `2' is better as it makes clearer where o-b-p-f-p is looking
> for properties when reading the code of org-babel-get-src-block-info.

Since :noweb-ref is the only property that absolutely needs to be
retrieved from definition, another option would be to write a specific
function for that.

It implies some duplicated efforts with `org-babel-get-src-block-info',
but it is faster when the source name doesn't match, which is the most
common case, and avoids all side-effects from
`org-babel-get-src-block-info'.

WDYT?

Regards,

-- 
Nicolas Goaziou

Attachment: 0001-ob-core-Correctly-find-Noweb-reference.patch
Description: fix noweb-ref


reply via email to

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