emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ken Mankoff <mankoff@gmail.com>
To: gmauer@gmail.com
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Can you automatically noweb include?
Date: Thu, 6 Aug 2020 11:12:46 -0700	[thread overview]
Message-ID: <CAFdBzErng_=ONCCxc1ehOVxOXVtK5h95k_TxmCO3izxtea7aGA@mail.gmail.com> (raw)
In-Reply-To: <CAFdBzEr4L8tz3dO-qADm9QE4H0+pcGjG76WhNix+n__9hV05Tw@mail.gmail.com>

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

Actual example:


* Prologue test
:PROPERTIES:
:header-args:python+: :prologue "import numpy as np; import os"
:END:

#+BEGIN_SRC python :results output
print(np.__version__)
#+END_SRC

#+RESULTS:
: 1.18.4




On Wed, Aug 5, 2020 at 3:03 PM Ken Mankoff <mankoff@gmail.com> wrote:

> What about using :pre or :prologue and setting it at the header or
> document level?
>
> Please excuse brevity. Sent from tiny pocket computer with
> non-haptic-feedback keyboard.
>
> On Wed, Aug 5, 2020, 14:22 George Mauer <gmauer@gmail.com> wrote:
>
>> Use case:
>>
>> I'm using ob-racket <https://github.com/togakangaroo/ob-racket> but this
>> would apply just as well to a few other workflows I have with python or js.
>>
>> I would like to write a helper function in a src block and then
>> automatically have access to it in other src blocks further down the
>> document. I don't really want a stateful session (nor does ob-racket
>> support sessions) so I essentially want the equivalent of automatically
>> including it everywhere so I don't have to type it out all the time (and
>> have it screw up syntax coloring/indentation).
>>
>> Is this currently possible? Does anyone have any ideas for how to extend
>> things so it is?
>>
>

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

  reply	other threads:[~2020-08-06 18:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-05 21:21 Can you automatically noweb include? George Mauer
2020-08-05 22:03 ` Ken Mankoff
2020-08-06 18:12   ` Ken Mankoff [this message]
2020-08-07 15:39     ` William McCoy
2020-08-07 16:51       ` Berry, Charles via General discussions about Org-mode.
2020-08-07 18:24         ` William McCoy
2020-08-07 21:18           ` Thomas S. Dye
2020-08-07 21:25             ` Berry, Charles via General discussions about Org-mode.
2020-08-07 22:01               ` William McCoy
2020-08-08  4:15                 ` George Mauer
2020-08-08  4:18 ` Tom Gillespie
2020-08-08  4:20   ` Tom Gillespie
2020-08-08  4:47     ` Tom Gillespie
2020-08-08 19:42       ` George Mauer

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='CAFdBzErng_=ONCCxc1ehOVxOXVtK5h95k_TxmCO3izxtea7aGA@mail.gmail.com' \
    --to=mankoff@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=gmauer@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).