From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wGQXN5DXNWE4ZAEAgWs5BA (envelope-from ) for ; Mon, 06 Sep 2021 10:55:44 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id iMvTMpDXNWH/ZgAAB5/wlQ (envelope-from ) for ; Mon, 06 Sep 2021 08:55:44 +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 2E5A5D054 for ; Mon, 6 Sep 2021 10:55:44 +0200 (CEST) Received: from localhost ([::1]:50506 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNAPm-0004sv-RW for larch@yhetil.org; Mon, 06 Sep 2021 04:55:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNAOx-0004sn-R6 for emacs-orgmode@gnu.org; Mon, 06 Sep 2021 04:54:51 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:33402) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNAOv-0005Qu-DP for emacs-orgmode@gnu.org; Mon, 06 Sep 2021 04:54:51 -0400 Received: by mail-wr1-x42a.google.com with SMTP id b10so8743433wru.0 for ; Mon, 06 Sep 2021 01:54:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=D1hC6MXgM+2WHiCXIOcRV0KDJorR/f/LEblaIGR1G5c=; b=eG6YihsbT5TdRnRSoafR/6kRXK51QHo5ffjgd/8e35HoSAHwBe4LqUasgWOGQeVtKw 4/nbdmSeJiMPR0oo+PCV4o1J2JHbQMp0FbEQm+rk8I1vmTXAE75+TrgVdGsiiXnKhA4J c/ojkAbcKOjcne1bmM73PZz189ATsW5+77ssEuB4HhYSjMkvTitzfG9yueEGAggatDkN T/m1yIe9Pe0+r+q9S3W4pYsm9GPdqmad4a6PthgJrwzPhyb786zyX9DTs5NE3i1bxqcD dqG8gqFPOs4qgYvqMbC35xwxncbiPbJrM62fTj8jyxCySg/UaYuTPTt4rzN70VkSw43W 6WdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :in-reply-to:message-id:mime-version:content-transfer-encoding; bh=D1hC6MXgM+2WHiCXIOcRV0KDJorR/f/LEblaIGR1G5c=; b=SH1JVOpDqnmRGRHSvVv1cmtszaMDUr4RnLN5d/Kz1XsP7I+VanxT2zxVka8YAmmS44 BwLd93vJJ/ZpcRjAleFofvjglt6R+KeJDYw+HTwIV56C9vF0TPo2yrBRLMVaUmXlDujf nZ/Omdv0VktKLxiSwAUX3Oa9q/02iOT0j7FXo6UWBI6WGeZWNMdB/FBWzdqHp8o3/rWB KEdKBg8zRNb6YVSotfofT3eaLLn4UDNRBz3mJa2hCUbiODAMOR3dDFB5+lMwfQnz67/g pmXIIlSbBtyBz70K5o+pXakipTLTqGN8vefXAJgR+p5V9ym+GQUsFk5P87zTqXmL5CB5 6huA== X-Gm-Message-State: AOAM530w3rdt8+JLNoAEQ1vVNk8dye0UBzspZ1oyN3d5KpL1rxAUcMRr ovQ9W4RF+jJt1j70XwCGNr4Eha1ndqtA X-Google-Smtp-Source: ABdhPJyzUiC+b8/SKwqZSv6orzQhoJsyK/PDk4WRXDdFeBAsOQWul546hNu97hwEXcV1AtkwvHlCWg== X-Received: by 2002:a5d:4568:: with SMTP id a8mr12008512wrc.200.1630918487030; Mon, 06 Sep 2021 01:54:47 -0700 (PDT) Received: from localhost (070-207.dynamic.dsl.fonira.net. [178.251.70.207]) by smtp.gmail.com with ESMTPSA id u8sm7527701wmq.45.2021.09.06.01.54.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 01:54:46 -0700 (PDT) References: <87fsukms4z.fsf@gmail.com> <676F013F-AC22-4853-9E13-C91B92C3B59A@health.ucsd.edu> User-agent: mu4e 1.6.5; emacs 27.2 From: Dominik Schrempf To: "Berry, Charles" Subject: Re: Org babel source blocks ignore buffer-local variables Date: Mon, 06 Sep 2021 10:53:37 +0200 In-reply-to: <676F013F-AC22-4853-9E13-C91B92C3B59A@health.ucsd.edu> Message-ID: <87lf4ajd7u.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=dominik.schrempf@gmail.com; helo=mail-wr1-x42a.google.com 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, 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@gnu.org" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630918544; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=D1hC6MXgM+2WHiCXIOcRV0KDJorR/f/LEblaIGR1G5c=; b=FpjSA2zwSnPiJaFz4yzk5IS5S+HKY08HHKAQEbVeBPMZpbf0qEZMSENC1KZWWC36HiFLTD h1Rhb0gHE+g6V1pJ9tafpeUiaSBxqexnb8c8oVOq6bmE98DW4eOoPi8yDRlq7eMCKqX4aY +eEwgIv8HMj9lJwRei0ZQKvIRAvD07csK3MjvLhjQ5rfZuUhRkD0eE1XxPQcvLkwU7cYEu rXZm1FPhcJ0H/1SeNNWdaMHpZzJO/ocqvmRIdN5ofO4g3GhpB2utOQUn0N6OtAmv2S+Ht/ BaOHLV7OFCStWZM3YMQhZ3AWTYd/mz0Sks7B3UJ5ZPq7bgwjr0/0zEm5EFYlzg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630918544; a=rsa-sha256; cv=none; b=pr7YbMmjdRbwxVBe2viC5kKz7aPRlyGMZleu7mcMaEpOzJRA3wccvaoLneXovlf/bJyGhn Kp/uHRaryCxAcf6P4Ji2H5pUnlmIKv4DI8CLB5omo0fJdBi1o9HpJJ54rL4k2Bg9QX8fV0 +2AgGs0h4o3QfNIdQ3VR1feZuE2hM0hc0EvnavvM1JarwapetQBxyQhlADzlD/tthW/+5L mGO2e8TbIiyJsEWjWTSJeIejZ9vPqUAzSA49RtdLkGYnFajq5sdSZkJ0D8sd1P5HU4kfd6 15UO2tD1pwoqPRpU9udu/NLU2WJFWk1JxS5SBzTfVaedJ9K3zqjSj4IIfn8EiA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=eG6Yihsb; 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-Migadu-Spam-Score: -3.11 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=eG6Yihsb; 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-Migadu-Queue-Id: 2E5A5D054 X-Spam-Score: -3.11 X-Migadu-Scanner: scn0.migadu.com X-TUID: opk22bH0njW2 Thank you, this solution works. May I ask about the reasons of such a distinction? Dominik "Berry, Charles" writes: >> On Sep 4, 2021, at 5:30 AM, Dominik Schrempf wrote: >>=20 >> Hello, >>=20 >> I use directory local environments with =3Denvrc=3D [1], and run into tr= ouble when >> using (Bash) Org Babel source code blocks. The buffer local environment = seems to >> be ignored (see the example at the bottom). >>=20 >> This seems to have been discussed in the course of a GitHub issue of >> =3Dinheritenv=3D [2], which is pulled in by =3Denvrc=3D. Also, on this m= ailing list, >> there was a short discussion [3]. >>=20 >> Do you have any thoughts on this? Is there an easy way to make Org Babel= source >> blocks honor buffer local setups? >>=20 >> Thank you! >> Dominik >>=20 >> #+name: Scratch >> #+begin_src sh :exports both :results output verbatim >> function path () { echo "$PATH" | tr ':' '\n'; } >> path >> #+end_src >>=20 >> #+RESULTS: Scratch >> #+begin_example >> /home/dominik/Evolutionary-Biology/Scripts/nix-flakes >> /home/dominik/Evolutionary-Biology/Scripts >> /home/dominik/bin/nix-flakes >> /home/dominik/bin >> /run/wrappers/bin >> /home/dominik/.nix-profile/bin >> /etc/profiles/per-user/dominik/bin >> /nix/var/nix/profiles/default/bin >> /run/current-system/sw/bin >> /nix/store/3l9lddwxz1mayaxvw8iy50ygzzfh1s1b-emacs-27.2/libexec/emacs/27.= 2/x86_64-pc-linux-gnu >> #+end_example >>=20 >> The Emacs =3Dexec-path=3D variable has the following value: >>=20 >> #+begin_quote >> exec-path is a variable defined in =E2=80=98C source code=E2=80=99. >> Its value is >> ("/nix/store/cnxncxyghj3gfpfvng6z4l8k4hfl48wq-ghc-8.10.6-with-packages/b= in/" "/nix/store/435paza0j48aa9vgvf6r2l12nrg4ld11-patchelf-0.12/bin/"=20 > > [snip] > > Indeed, ~exec-path~ and ~(getenv "PATH")~ can differ. > > If you want to set PATH for a shell src block, you can do something like: > > #+begin_src sh :results output verbatim :var PATH=3D(mapconcat 'identity = exec-path ":") > echo $PATH > #+end_src > > HTH, > > Chuck > >=20=20=20