emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* reference a remote named block in #+CALL: line
@ 2021-11-02 10:19 Matt Price
  2021-11-02 18:11 ` Berry, Charles
  2021-11-02 19:01 ` Michael Welle
  0 siblings, 2 replies; 3+ messages in thread
From: Matt Price @ 2021-11-02 10:19 UTC (permalink / raw)
  To: Org Mode

[-- Attachment #1: Type: text/plain, Size: 783 bytes --]

I am getting used to calling library-of-babel functions with local data
structures as input variables, e.g. in this line:

#+CALL: list2table(data=common-issues-list, order="rows") :results  table
 raw

where `common-issues-list` is a named org-mode list in the current file,
e.g.

#+NAME: common-issues-list
- some
- things
- here

In this particular case, I'd like to maintain a single data structure and
use it in a bunch of places (it's a document I re-use in several courses,
all of which are published online with different metadata stored in
headings). Is there a syntax for referring to #+NAME'd elements in remote
files?

Sorry if I'm missing something that is explained in the docs -- I am not
finding this in what I think of as the obvious places.

thanks as always,

Mat

[-- Attachment #2: Type: text/html, Size: 1060 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: reference a remote named block in #+CALL: line
  2021-11-02 10:19 reference a remote named block in #+CALL: line Matt Price
@ 2021-11-02 18:11 ` Berry, Charles
  2021-11-02 19:01 ` Michael Welle
  1 sibling, 0 replies; 3+ messages in thread
From: Berry, Charles @ 2021-11-02 18:11 UTC (permalink / raw)
  To: Matt Price; +Cc: Org Mode

Matt,

> On Nov 2, 2021, at 3:19 AM, Matt Price <moptop99@gmail.com> wrote:
> 
> I am getting used to calling library-of-babel functions with local data structures as input variables, e.g. in this line:
> 
> #+CALL: list2table(data=common-issues-list, order="rows") :results  table  raw 
> 
> where `common-issues-list` is a named org-mode list in the current file, e.g. 
> 
> #+NAME: common-issues-list
> - some
> - things
> - here
> 
> In this particular case, I'd like to maintain a single data structure and use it in a bunch of places (it's a document I re-use in several courses, all of which are published online with different metadata stored in headings). Is there a syntax for referring to #+NAME'd elements in remote files?
> 
> Sorry if I'm missing something that is explained in the docs -- I am not finding this in what I think of as the obvious places.  
> 

AFAIK, there is nothing like this.

However, it looks like it would be easy to modify `org-babel-lob-ingest' by adding another argument giving the name (or a list of names) of src blocks that you want added to `org-babel-library-of-babel' by replacing the `when source-name' with something like `when (member source-name only-these-names)' so only src blocks you want to invoke are ingested.

HTH,

Chuck





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: reference a remote named block in #+CALL: line
  2021-11-02 10:19 reference a remote named block in #+CALL: line Matt Price
  2021-11-02 18:11 ` Berry, Charles
@ 2021-11-02 19:01 ` Michael Welle
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Welle @ 2021-11-02 19:01 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Matt Price <moptop99@gmail.com> writes:

> I am getting used to calling library-of-babel functions with local data
> structures as input variables, e.g. in this line:
>
> #+CALL: list2table(data=common-issues-list, order="rows") :results  table
>  raw
[...]
> In this particular case, I'd like to maintain a single data structure and
> use it in a bunch of places (it's a document I re-use in several courses,
> all of which are published online with different metadata stored in
> headings). Is there a syntax for referring to #+NAME'd elements in remote
> files?
that's what I use with tables (but that should not matter):

#+CALL: list2table(data=data.org:common-issues-list, order="rows") :results  table raw

Regards
hmw


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-02 19:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-02 10:19 reference a remote named block in #+CALL: line Matt Price
2021-11-02 18:11 ` Berry, Charles
2021-11-02 19:01 ` Michael Welle

Code repositories for project(s) associated with this inbox:

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).