From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id AOKuN2dILF/UNAAA0tVLHw (envelope-from ) for ; Thu, 06 Aug 2020 18:13:59 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id gPVlM2dILF/LRAAAbx9fmQ (envelope-from ) for ; Thu, 06 Aug 2020 18:13:59 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5E0759403EC for ; Thu, 6 Aug 2020 18:13:59 +0000 (UTC) Received: from localhost ([::1]:46122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k3kOs-0008Lt-97 for larch@yhetil.org; Thu, 06 Aug 2020 14:13:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k3kOL-0008LU-GQ for emacs-orgmode@gnu.org; Thu, 06 Aug 2020 14:13:25 -0400 Received: from mail-yb1-xb31.google.com ([2607:f8b0:4864:20::b31]:36757) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k3kOJ-0007Xv-Oa for emacs-orgmode@gnu.org; Thu, 06 Aug 2020 14:13:25 -0400 Received: by mail-yb1-xb31.google.com with SMTP id n141so24001091ybf.3 for ; Thu, 06 Aug 2020 11:13:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Zoo+QlgtMe/mbzQa57YD8I5hOoR64NcWaOFwqnd5cQc=; b=a9/YbBKD1LE4RTiOtQUWycfeq/0aN0oVqyVIkZNjSw46G9g/g2yPRjs9nm1qaLRZUD k9b7DWCLSB4A6+pZmiMgBYQ2Ix4APhGBjsslyhtweus66SjATgBZIaBTNheAfPEvcnoW y51Q03inby4vbctnPbTFGN7SdPh7HMpxpAfiz7xT9r8sxmxiiekvJ+dMqWH+NBm2H7z3 lpvZRVlwEQRm/4iwiGRGYmeJXPSzRKjYs2ij91H5KnSETrFcGxJofQiyPWqvmX4lUV3i /jSEnD4oboLLmUufTNr5GkALoXMXSe5bCTRtrz+iq9KqAmAWxPhIY1dzbfgeomyBNc3E +CVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Zoo+QlgtMe/mbzQa57YD8I5hOoR64NcWaOFwqnd5cQc=; b=rnz2as6H41W3znmjwSjmD/yU4qf5Xuhr46QX1pnxn/Zu10kAJ4pTgwmdb7mbJgjQWq /jrCvUrxy5vkCHnJlqde9Hyaggrpiup9nPtrCQE/WYz634/ofrXJOsnPvWwf2UbzEsDI UCTQ8v06AUXafSruE4NNEUigil9wrY1vFrMTNT5VeLJ4IR7SWG9lHJCo5NGQZU9bBLHB c3pBvBXNejnXHUgmAlQdTrtqMBVceYIM1VLDQd69py6/wzy0OqCWofyI1UnHsPRtR/3W TYR8C9pbWIh1iByPjpGUNahMoZETF59f3Cj+3AAfbF5VRdGhyNrR2ZSyP6wiWeRrcupD sBew== X-Gm-Message-State: AOAM5339vwji5/UPkFoOzsyJAizDQ8LRAslvcBlRxO778YgiNxNc2UdP mhepE6bk5B14fO8eCcMqBei5RHuyEs3YT98SKIs= X-Google-Smtp-Source: ABdhPJx0BarjEFD7bE7SPOvyfRN4+7rP5NPDF5/KAz/Gj9ScAu6zzQ8is2EJI8p8qRgC02TCnaX+6hhwtVotkhd8QUM= X-Received: by 2002:a25:8b81:: with SMTP id j1mr13663742ybl.458.1596737602485; Thu, 06 Aug 2020 11:13:22 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ken Mankoff Date: Thu, 6 Aug 2020 11:12:46 -0700 Message-ID: Subject: Re: Can you automatically noweb include? To: gmauer@gmail.com Content-Type: multipart/alternative; boundary="00000000000098852e05ac397166" Received-SPF: pass client-ip=2607:f8b0:4864:20::b31; envelope-from=mankoff@gmail.com; helo=mail-yb1-xb31.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=a9/YbBKD; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: 0.79 X-TUID: 2Yl/7ZRCAYLy --00000000000098852e05ac397166 Content-Type: text/plain; charset="UTF-8" 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 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 wrote: > >> Use case: >> >> I'm using 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? >> > --00000000000098852e05ac397166 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Actual example:


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

#+BEGIN_SRC python :re= sults output
print(np.__version__)
#+END_SRC

#+RESULTS:
: 1= .18.4




=
On Wed, Aug 5, 2020 at 3:03 PM Ken Ma= nkoff <mankoff@gmail.com> wr= ote:
What about using :pre or :prologue and setting it at the header or d= ocument level?

Please excuse brevity. Sent from tiny pocket com= puter with non-haptic-feedback keyboard.

On Wed, Aug 5, 2020, 14:22 G= eorge Mauer <gmaue= r@gmail.com> wrote:
Use case:

I'm using ob-racket=C2=A0but this would apply just as well to a few o= ther workflows I have with python or js.

I would l= ike to write a helper function in a src block and then automatically have a= ccess to it in other src blocks further down the document. I don't real= ly want a stateful session (nor does ob-racket support sessions) so I essen= tially want the equivalent of automatically including it everywhere so I do= n't have to type it out all the time (and have it screw up syntax color= ing/indentation).

Is this currently possible? Does= anyone have any ideas for how to extend things so it is?
--00000000000098852e05ac397166--