From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id DQxzGxnHLV9HJgAA0tVLHw (envelope-from ) for ; Fri, 07 Aug 2020 21:26:49 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id KCnyFhnHLV8KdwAA1q6Kng (envelope-from ) for ; Fri, 07 Aug 2020 21:26:49 +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 1E201940902 for ; Fri, 7 Aug 2020 21:26:48 +0000 (UTC) Received: from localhost ([::1]:55774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k49sz-0005O2-RS for larch@yhetil.org; Fri, 07 Aug 2020 17:26:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39848) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k49s9-0005Nt-SE for emacs-orgmode@gnu.org; Fri, 07 Aug 2020 17:25:53 -0400 Received: from mx0b-00395d01.pphosted.com ([148.163.137.170]:18128) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k49s7-00019L-3i for emacs-orgmode@gnu.org; Fri, 07 Aug 2020 17:25:53 -0400 Received: from pps.filterd (m0173174.ppops.net [127.0.0.1]) by mx0b-00395d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 077LJmrh025486; Fri, 7 Aug 2020 14:25:47 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucsd.edu; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=campus; bh=vb5ebZ3YlTMd9fzjO/ts+ojpYcUEAli7RepxeHyElI0=; b=ry9we1SB6Sj45RJZzuLPa1tw8VJSWvIIVbJB4m1OT6T2uqdIV+TNFEd71yq2PSW00Bdm dc5CD1JwR4R0M7PFGEiQaXmez+GALhcvxjGd9TaOaW9y7l4D9skn3IWtxTxr9UbaYOlZ u9yOFWgOIB2qsU0ok3rj0Plf2qbebB/zKQ50+tvKMiKbRmWGfMfvFTws4DJL8MCk1Et+ g7MNAf5kVdWze9QCxC27tNJZ4xUZyJgfwWTWyLtP5fMQ7Yl2RFvUkCigG3nxYkXBOdKY E/6qaUrJYDE/ABMze09kozqgyjFCFWBEGBC3WcAk3CKChHr5WtklvVr+ee2CmxM95GqC 3g== Received: from secdlpezp04.ucsd.edu ([40.112.251.180]) by mx0b-00395d01.pphosted.com with ESMTP id 32p22psh3d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 07 Aug 2020 14:25:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kMI3YNt9PS+K6SfHEpvu7FFbFUvDeGhrHBX0R9AQkjNZM9ebq9zz+OQ/j0ZULTy9zC9cs/IFwgdDsGg7pjHiVeFZHibeafqcE5F1NtQwVA/Y04N1QpQ6N+OO3LvHi0+ztb0LpvR1KQi210m4UJJCOjYz7O2ALa6xC3RuusB+y4Yxo4j26GVSEuBr2XUImPRicVJtxT1a7kVfzcJHf0xntMwZgndlRnIvefbwd+ELz0pV5JLcFNSC8F5EOQ0lT9SLhN7O1kJ1iVMN5J0hBz2yar5/BlRAjymcRCdk+uqqwCM4b0TP326AnCwcfR+DED/nqjsQRgdQQT4VbdBjcEJ5DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vb5ebZ3YlTMd9fzjO/ts+ojpYcUEAli7RepxeHyElI0=; b=jZSNKpWh7SBSLN3sTKGYiMg8f65Zd0rjGAl6OpsdSTVOyJU/rWVJKJ5Y2Gu2i5WV3OoVASRPC8qf3H+zdxh6FBsn6+Y0szyxF9x1xdElKNhfdQMTRAb16pj91ioGCa+uob7Gj9BDRIoRzmzF7VIYRsZGtVrRivE02amyqTR6pbdNtwlm1aPABmENL2VUYNsj691NtFzlgKBmz1jEdS5aR0y6tTfNZlFddz/lcWJUaRGfY++XI67LXbe3EVeYIsirxO4tUXzmevye+umLXSSD1d0KkAM3KCUGSKn8X9y8Psz0thuuID7kZaGOxyHhtFH9HPogGm878f6ZtnlAj5ul6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=health.ucsd.edu; dmarc=pass action=none header.from=health.ucsd.edu; dkim=pass header.d=health.ucsd.edu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucsdhs.onmicrosoft.com; s=selector2-ucsdhs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vb5ebZ3YlTMd9fzjO/ts+ojpYcUEAli7RepxeHyElI0=; b=iwdiufak7z8dbA5UL3EW9MzSCpVcR8fpI+T3SFOyuXxXABvScn4wCApFuaErWrfDDYoTpK85gLuswF6BCNLaGlcy+oBmmWtpHjvaI9FxcRRLA7NN+JGIsSmj5OBUO/7mEisg78YKZfn+l3DEmlg1zjszb0yRu9jBjGWbW9b0wjk= To: "Thomas S. Dye" Subject: Re: Can you automatically noweb include? Thread-Topic: Can you automatically noweb include? Thread-Index: AQHWbNr6R8OcQzKZ+Uu+gYTk878nCKks9iuAgAAw14CAAAHkgA== Date: Fri, 7 Aug 2020 21:25:43 +0000 Message-ID: <943BE6FC-05D6-4AFD-9A97-512B626822E2@health.ucsd.edu> References: <3D721ED9-B51F-47D2-B2D4-7017FCA5F95C@health.ucsd.edu> <87k0yanohq.fsf@tsdye.online> In-Reply-To: <87k0yanohq.fsf@tsdye.online> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [2600:1702:1021:b0:fddf:f15a:1e25:aae] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 243a8350-6a46-4625-8077-08d83b187166 x-ms-traffictypediagnostic: BN6PR19MB1300: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Jj2pTXCVDm58tgTsnUryFM0sYdwKhx2x+C08KWJk2w8jIoXzU99yeRfXNZf2o/M8diF/8GXRALwDcWsYlBuYqDVrEz+McNi5w/Yy6WVy7Db0yOFijdkFdnAl7f2+bfvV2bH0yuMT49yXcS15cCRNd2xcFoNr+3vtaBy2X9WtQrwRHpfR2fuTdfIdltCXZ70isSfAOek8y0dh9NbhfRIal8su4gRvXmYm4n5udjSwE71B2QlWSg4DGT53LHzFswk7hAsNpNwpPpHQCuS8n1uigkauq7nHyYWcfbySHXU2K5wn10OrzFTfM+DNPf81W6Z7obGLj0OaXeBDAlX7ygrQ16s8faUv4pnG0OcMXiO9eHZxYwxZVQDBCvUbzY19Yukc3bgFR0Nw2xCjgNw8lQwv0A== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR19MB2882.namprd19.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(136003)(396003)(346002)(376002)(366004)(39860400002)(86362001)(64756008)(66446008)(6506007)(91956017)(66946007)(76116006)(66476007)(66556008)(53546011)(966005)(4326008)(8676002)(6486002)(83080400001)(786003)(6916009)(478600001)(2616005)(5660300002)(316002)(54906003)(6512007)(83380400001)(75432002)(33656002)(186003)(8936002)(71200400001)(2906002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: piaeA/crTVPXPjRv+KJNHY199Kjzod9+j0lJiDoGyHxaunPzVC0/fwEzDOnC3zkGzzoB9Ps4fSTNnEOT7r8oC6qyy2SPY0N6nqPVmO6BMjWmIrrzZos2IJObainKKhx6Hs7XE58xd4uoBlvWxovCNNUw9FyPr3xMiayxlVJrkmqH7T3TDeIdBYfTgkGYELOANDjxdjpNN3hJLdreJTe18GsS/a7TUb6eFdd4xVkxcx2jFot6M0nWIlcDf4WiEG9a2gzQ+8t75h2mxjy8UzAn5faPC/zYuxHLJ3V4smezSyw5oyBdhGM/e65npz36RJIyrHiquuBTAaCfw11+RR2wtwoTuBc3ka0gLtFDjYCyxY200ceX3PMb0E0+oH4C90DnoYZjqTKmh+8/zEdUAPg5L/L48NIa8lSLyRiR9D+9AuJxcdJDZzhNU7Ml81YBf3S4QRiM4MQ/2fQi0eLyj2JXYvD5tjq2zQjxS3B1ogl8sedFHr5JTaX0T3oLGbODc0xpgBxxPEDUHJSriAxnF0rvZluLuimTPFCdsEguxe/gLy/4J4oRt0vZoaWI4UiDfAtmPgzYRVOAJFTtZnRXCHClhVKhi2hCTPJh5UKvw/KrVUEdSAPKIo6VdIgHXvoVd5GiP2XP2inoQ+DQhBq3f8qC728c07ON1LEEJLYoqhBfSKXQ4F34xDIMTBVLSAb2yqd0TRyouwy6h22WB7oAStaVUQ== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: health.ucsd.edu X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN8PR19MB2882.namprd19.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 243a8350-6a46-4625-8077-08d83b187166 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Aug 2020 21:25:43.9472 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: e470d736-e7f7-41a8-8eab-dad544b2b579 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: FpEIq8m/Vzcb0/Mo6Rwvq1gJQJnhWTcEIZEWRnWklwzGogKm3QwcWC5TId3lNECck0gkKfkB5GzKxs8Am7lpHw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR19MB1300 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-08-07_20:2020-08-06, 2020-08-07 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 adultscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 phishscore=0 spamscore=0 bulkscore=0 malwarescore=0 mlxlogscore=999 priorityscore=1501 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008070148 Received-SPF: pass client-ip=148.163.137.170; envelope-from=ccberry@health.ucsd.edu; helo=mx0b-00395d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/07 17:25:48 X-ACL-Warn: Detected OS = Linux 3.1-3.10 X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, PDS_OTHER_BAD_TLD=1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=no 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: org-mode mailing list , William McCoy Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" Reply-to: "Berry, Charles" From: "Berry, Charles" via "General discussions about Org-mode." X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=ucsd.edu header.s=campus header.b=ry9we1SB; dkim=fail (rsa verify failed) header.d=ucsdhs.onmicrosoft.com header.s=selector2-ucsdhs-onmicrosoft-com header.b=iwdiufak; dmarc=none; 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: 2.99 X-TUID: 5GjoXd6JXV5b Good catch. Also it works if you put the property block at the very beginni= ng of the file. This sometimes helps: M-x org-lint RET which in this case reports "Incorrect contents for PROPERTIES drawer" which is a bit cryptic IMO, but does point to any issue with the property. HTH, Chuck > On Aug 7, 2020, at 2:18 PM, Thomas S. Dye wrote: >=20 > It works here if you remove the blank line between the headline and the P= ROPERTIES block. >=20 > William McCoy writes: >=20 >> Chuck, >>=20 >> Thanks very much for your response. I didn't know about those options. = When I >> use C-c C-v C-i, I get the following: >>=20 >> Lang: python >> Properties: >> :header-args nil >> :header-args:python nil >> Header Arguments: >> :cache no >> :exports code >> :hlines no >> :noweb no >> :results output replace >> :session none >> :tangle no >>=20 >> And C-c C-v C-v, shows that the import statements in the header do not g= et >> expanded into the code block. >>=20 >> So I am obviously doing something wrong. There appear to be no typos or >> misspellings and the org file containing the coded is exactly this: >>=20 >> * Test of prologue header >>=20 >> :PROPERTIES: >> :header-args:python+: :prologue "import numpy as np; import os" >> :END: >>=20 >> #+BEGIN_SRC python :results output >> print(np.__version__) >> #+END_SRC >>=20 >> #+RESULTS: >>=20 >>=20 >> My init file has no org babel header arguments defined. >>=20 >> I am using C-c C-v C-b or C-c C-v C-s to evaluate and I get >>=20 >> "Code block produced no output." in the mini-buffer. >>=20 >>=20 >> If I use C-c C-c directly on the code block itself I get: >>=20 >> Traceback (most recent call last): >> File "", line 1, in >> NameError: name 'np' is not defined >>=20 >> Is there something else I need to do to get babel to recognize the heade= r-args? >>=20 >> Thanks >>=20 >>=20 >> On 8/7/20 12:51 PM, Berry, Charles wrote: >>>=20 >>>> On Aug 7, 2020, at 8:39 AM, William McCoy wrote: >>>>=20 >>>> This use of :prologue appeared to me to be very useful. But for some = reason when I try it out it does not work for me. I just get a message tha= t the code block produced no output and that 'np' is not defined. Just to = check, when I put the import statements directly within my code block it wo= rks fine. >>>>=20 >>>> I am running: Org mode version 9.3.7 (9.3.7-16-g521d7f-elpa >>>>=20 >>>> Any idea what I'm doing wrong? >>>>=20 >>>>=20 >>> It is sometimes useful to use C-c C-v C-i to see what header args org h= as detected for a source block. Misspelled words sometimes wreak havoc and = invisible characters can cause real pain. >>>=20 >>>=20 >>> Also, it helps to use C-c C-v C-v to to see the expanded code block. Wh= en I do this with Kens' ECM, I get >>>=20 >>> import numpy as np; import os >>> print(np.__version__) >>>=20 >>> in the preview buffer. >>>=20 >>> HTH, >>>=20 >>> Chuck >>>=20 >>>=20 >>>> On 8/6/20 2:12 PM, Ken Mankoff wrote: >>>>> Actual example: >>>>>=20 >>>>>=20 >>>>> * Prologue test >>>>> :PROPERTIES: >>>>> :header-args:python+: :prologue "import numpy as np; import os" >>>>> :END: >>>>>=20 >>>>> #+BEGIN_SRC python :results output >>>>> print(np.__version__) >>>>> #+END_SRC >>>>>=20 >>>>> #+RESULTS: >>>>> : 1.18.4 >>>>>=20 >>>>>=20 >>>>>=20 >>>>>=20 >>>>> 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 do= cument level? >>>>>=20 >>>>> Please excuse brevity. Sent from tiny pocket computer with non-haptic= -feedback keyboard. >>>>>=20 >>>>> On Wed, Aug 5, 2020, 14:22 George Mauer wrote: >>>>> Use case: >>>>>=20 >>>>> I'm using ob-racket but this would apply just as well to a few other = workflows I have with python or js. >>>>>=20 >>>>> I would like to write a helper function in a src block and then autom= atically 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 everywh= ere so I don't have to type it out all the time (and have it screw up synta= x coloring/indentation). >>>>>=20 >>>>> Is this currently possible? Does anyone have any ideas for how to ext= end things so it is? >>>=20 >=20 >=20 > -- > Thomas S. Dye > https://tsdye.online/tsdye