unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Bob Heffernan <bob.heffernan@gmail.com>
To: Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Org mode & "literate programming": including files
Date: Tue, 6 Apr 2021 22:59:44 +0100	[thread overview]
Message-ID: <20210406215944.7mlxinyzlec46fao@bob-nuc> (raw)
In-Reply-To: <2f0f11ce-0616-9437-475d-d31165bb02a1@gmail.com>

On 21-04-06 23:18, Nikolay Kudryavtsev wrote:
> In org mode you can extract your source code from the org file into a proper
> language specific file. The general idea is that you write your library in
> org, then you tangle it into a proper scheme file and then just import that.
> See this part of the manual for more info (info "(org) Extracting Source
> Code") <https://orgmode.org/manual/Extracting-Source-Code.html#Extracting-Source-Code>.

Nikolay,

Thank you for your help.  Something like the following isn't
particularly elegant, but it works.  Perhaps as I learn more I'll be
able to clean it up.

#+name: lib
#+begin_src emacs-lisp :results silent
(car (org-babel-tangle-file "/home/bob/projects/literate/foo.org"))
#+end_src
#+begin_src scheme :var input=lib :results silent
(load input)
#+end_src
#+begin_src scheme
(f 1)
#+end_src

#+RESULTS[7f10...]:

: 2

> Also, while you can expect people on this list to have a reasonable amount
> of org knowledge, the best place to ask org questions is actually
> emacs-orgmode@gnu.org mailing list.

I'll bear this in mind.  Thanks.

Regards,
Bob



  reply	other threads:[~2021-04-06 21:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-06 18:38 Org mode & "literate programming": including files Bob Heffernan
2021-04-06 20:18 ` Nikolay Kudryavtsev
2021-04-06 21:59   ` Bob Heffernan [this message]
2021-04-07  3:54 ` Arthur Miller
2021-04-07  8:28   ` Bob Heffernan
2021-04-07 16:47     ` Arthur Miller

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.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=20210406215944.7mlxinyzlec46fao@bob-nuc \
    --to=bob.heffernan@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=nikolay.kudryavtsev@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.
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).