emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Lawrence Bottorff <borgauf@gmail.com>
To: Nick Dokos <ndokos@gmail.com>
Cc: emacs-orgmode Mailinglist <emacs-orgmode@gnu.org>
Subject: Re: Babel: How to call code in one org file into another org file
Date: Sat, 31 Oct 2015 16:51:07 +0000	[thread overview]
Message-ID: <CAFAhFSUwigjtgpW_o8Uw46gcgYeW_KOvJmN4KpBaxW50bw6zWw@mail.gmail.com> (raw)
In-Reply-To: <87bnbf80ar.fsf@pierrot.dokosmarshall.org>

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

I guess I'm saying that the whole `org-babel-lob-ingest` into
`org-babel-library-of-babel` exercise should make code ready and available.
Otherwise (especially with the extra `org-babel-lob-ingest` in Local
Variable step I mentioned), what John Kitchin suggested with
`org-babel-load-file` is just as good, i.e., LOB seems hardly worth it. My
whole motivation is to avoid having to scroll through endless code blocks
all on the same level, rather, to have things more modular and distributed,
a bit like DDLs in MS-land.

On Sat, Oct 31, 2015 at 4:34 PM, Nick Dokos <ndokos@gmail.com> wrote:

> Lawrence Bottorff <borgauf@gmail.com> writes:
>
> > Yes, I experimented with this too -- and got it to work. But strangely,
> if you leave out the
> >
> > # eval: (org-babel-lob-ingest "./a.org")
> > # eval: (org-babel-lob-ingest "./b.org")
> >
> > lines and do a regular `org-babel-lob-ingest` (or  C-c C-v i) on those
> > two files -- it doesn't work. Rather bizarre behavior, IMHO.
> >
>
> I think you have some misconceptions about what org-babel-lob-ingest
> does. All it does is go through the file and add the named source
> blocks in that file to org-babel-library-of-babel: it does *not*
> evaluate the code blocks. So if the code block is e.g. a lisp code
> block with a defun in it, the function is *not* defined, until the
> code block is evaluated by org-babel: that's what org-sbe does.
>
> > Anyway, the dream behavior for LOB would be to simply add your files to
> your `org-babel-lob-files` in your Emacs init, start up an org file -- and
> be able to simply use all the LOB
> > files in your "live" `org-babel-library-of-babel` list library.
> >
>
> You can do that but again all that does is populate a list that
> only org-babel knows about. You'd still need to evaluate the code
> blocks in order to tell the inferior lisp process about what the
> code block define.
>
> --
> Nick
>
>
>

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

  reply	other threads:[~2015-10-31 16:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-30 20:21 Babel: How to call code in one org file into another org file Lawrence Bottorff
2015-10-30 20:53 ` John Kitchin
2015-10-30 20:55 ` Thomas S. Dye
2015-10-30 22:57   ` briangpowell .
2015-10-31  0:14   ` Lawrence Bottorff
     [not found]     ` <m21tcbx2iy.fsf@andrew.cmu.edu>
2015-10-31  2:12       ` Lawrence Bottorff
2015-10-31  2:15         ` Lawrence Bottorff
2015-10-31  3:08     ` Thomas S. Dye
2015-10-31  3:58       ` Lawrence Bottorff
2015-10-31 15:41         ` Nick Dokos
2015-10-31 16:17           ` Lawrence Bottorff
2015-10-31 16:34             ` Nick Dokos
2015-10-31 16:51               ` Lawrence Bottorff [this message]
2015-11-02  7:09                 ` Eric S Fraga
2015-11-02 13:36                   ` Nick Dokos
2015-10-31  9:57 ` Rasmus
  -- strict thread matches above, loose matches on Subject: below --
2015-10-31  2:24 John Kitchin
2015-10-31  2:33 ` Lawrence Bottorff

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=CAFAhFSUwigjtgpW_o8Uw46gcgYeW_KOvJmN4KpBaxW50bw6zWw@mail.gmail.com \
    --to=borgauf@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=ndokos@gmail.com \
    /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 public 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).