From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id MK+KGJmIsWMIhgEAbAwnHQ (envelope-from ) for ; Sun, 01 Jan 2023 14:20:25 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id mJVGGJmIsWMNpgAAauVa8A (envelope-from ) for ; Sun, 01 Jan 2023 14:20:25 +0100 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 3C23B2C9EF for ; Sun, 1 Jan 2023 14:20:24 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pByFK-0002Fl-Ld; Sun, 01 Jan 2023 08:19:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pByFC-0002Ea-Ns for emacs-orgmode@gnu.org; Sun, 01 Jan 2023 08:19:20 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pByF8-0002jE-66 for emacs-orgmode@gnu.org; Sun, 01 Jan 2023 08:19:16 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 02A162401D0 for ; Sun, 1 Jan 2023 14:19:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1672579152; bh=hOycWwHzLlues+s/BYx5et6Jv7FCNm0caqm+F+b9Wmg=; h=From:To:Cc:Subject:Date:From; b=hp15Fu7sDD95Y2Hhz8Aw/oPpIm7p0OlWB1g+nEjb3Hk0oTYiU6VFfoUlqaadI//Hn iJ5J0mjp0mZfMTpPmaX0TIdv9sZ9NLCjgrH0Hc5QpDQkHEBRYOGA33zQHhcoOaKuUQ J56E+QwdZ+nQB7b0g6P6YaUl5bNInzn/S8lbYEyZ+CkoCoVnn9WYoB0bRu/TZaiojy A+/2XNsES4a3TYEqNdcLRzOfNmFDd1FBzQGBwGmOIKV/gGkeY0WJo3kpUnzzeML8jT OIdAWLrAdJWqoem7UysN6GBKW7yIqP+LUVZvEhJWkPzGNtOHEZBSZr4aipNfkaPhcl uN3LrWkexlRvw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NlKMf2mvtz6tmG; Sun, 1 Jan 2023 14:19:10 +0100 (CET) From: Ihor Radchenko To: Adam Sneller Cc: emacs-orgmode@gnu.org Subject: Re: Persisting the current working directory in an org-babel session In-Reply-To: <78104F7C-B96D-4B8C-A83F-37D38B0BA9CF@earth2adam.com> References: <78104F7C-B96D-4B8C-A83F-37D38B0BA9CF@earth2adam.com> Date: Sun, 01 Jan 2023 13:19:41 +0000 Message-ID: <871qoe8k9e.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, 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.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1672579224; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=aeIGZ1QJH3X1zIDA/fTHmzfxCFVZp7tMGLMHvDIBoAA=; b=poNyRaNn4qbGqnT4SJliGEtqv/67bB1qTIonYXs5bfMiWsc46iL7kwgOVyr+J5Sdfmi6zu YCoPOHiu9i8AE+b8O9xwoZ81dNClYeH4dBqc5WyfvEFA3QS7DqyzlMB8hsuvnbiQogZRff thuyhnFExBcBNK/w4OgmvlKZxLoE0121WCEBYJHpTcWpoHh1VeGXmXTPfBDTrgMukTLuze d/eXzSGRF3vHqeFE/KN7bHripTuH2K4bqKVaEfKJWPkR2Ypbu8dmDH28BIzi4i5bMB5NDh afqag437AuPf+/giyIElWM9+s0ymQCkP8kJeBNwZnjMS5Ud048ZV1neOpRG2lw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=hp15Fu7s; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1672579224; a=rsa-sha256; cv=none; b=dv4DnlrMlp7xFiFczKDfSy0B+QBz5Y/m0y11bkg08yVU2qkRszevSt9QYMMC44LVvTMf1A sQSiCDd8mvkPDvXwhwe6c1H41TpSFvFKSYsO212O7SVNZqnDw/gkfd/grSocP8EcYX/ThH 9bNXo0Xr2YH8IueW+m/kfKu1pQ6JBkkZBVRui+1KfVNpkUM7+KTDWYJAfXzX2IpEO1qROL WU7DgmULA95OQo9wGqx4rILcyZV49bxC0e6DGv9NIn/YMshGCczJ0bAbbehUfLn3m8sJ0U P67CbgBPZdIIIs2XX2Bi8YdbNB9gUZnzzBIByxs3MUMGbHVvRqFjzAzTAhBdew== X-Spam-Score: -5.98 X-Migadu-Queue-Id: 3C23B2C9EF Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=hp15Fu7s; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -5.98 X-TUID: vLEi6PIyQQeT Adam Sneller writes: > For some reason, I am unable to make changes to my working directory persist, from one emacs-lisp SRC block to the next. > > For example, consider the following: > > * Literate programming in a single session > :PROPERTIES: > :header-args: :var DIR="/Users/adam/Desktop/test" > :END: > > #+BEGIN_SRC emacs-lisp :session *elisp* > (cd DIR) > #+END_SRC > > #+RESULTS: > : /Users/adam/Desktop/test/ > > > #+BEGIN_SRC emacs-lisp :session *elisp* > (cd ".") > #+END_SRC > > #+RESULTS: > : /Users/adam/org/ Confirmed. This is because `org-babel-execute-src-block' let-binds `default-directory'. So, your changes to it are only affecting lexical scope. Fixes welcome! -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at