From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id IPIAM2WXEmSSVAAASxT56A (envelope-from ) for ; Thu, 16 Mar 2023 05:13:25 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id uJLwMmWXEmQVSwEAauVa8A (envelope-from ) for ; Thu, 16 Mar 2023 05:13: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 7A2433D04E for ; Thu, 16 Mar 2023 05:13:25 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pceyh-000377-FC; Thu, 16 Mar 2023 00:12:35 -0400 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 1pceyf-00036v-0u for emacs-orgmode@gnu.org; Thu, 16 Mar 2023 00:12:33 -0400 Received: from mail-qt1-x82c.google.com ([2607:f8b0:4864:20::82c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pceyb-000054-B4 for emacs-orgmode@gnu.org; Thu, 16 Mar 2023 00:12:30 -0400 Received: by mail-qt1-x82c.google.com with SMTP id r16so502829qtx.9 for ; Wed, 15 Mar 2023 21:12:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678939948; h=mime-version:message-id:date:in-reply-to:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=l2JguXoLykYt2rG/LdilQiilz3gW3MS3M8piKO4MZeU=; b=HzmZo95U/7hQ+YrsdFEgUG1iX8r9QsTk6klwtNfpaiKbdtCcyoQ18U75T6+TdQBj6U CHr33TV4boMyVz2pqyMpntfYNRa2TuKGQXvINoFbf1F5n5H8COUhS37eObwmaYzzN8kx nropuihRFyvtjWDVvv6CTaOJzDrc9OwMZ++KPxhOchwAEVQiFHhUHlpnv2DtJUggf3sO 7L1PQc6ZaAeGQvnwDzwqJcq9dcJ4q8lmgiJ5Lq0lginiukr73TVeVxVLCV28ZydoMzap ubuuk2XJjCpIh6tcrHqPIb2xsoMRNc1Ass/QqV9twGfkXzVFh2k8FzAV2qXGah7VqYSp XgMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678939948; h=mime-version:message-id:date:in-reply-to:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=l2JguXoLykYt2rG/LdilQiilz3gW3MS3M8piKO4MZeU=; b=d4h+89uR8/c7T5c5OwpNRiMvSZaq3TXGxNF1d9CmE/jdTZ7neALPx60+eOWNTmOp4k VPvM3mg380Q/zxEnRwa2boYFUnjNWZLgIAGYHwASRMsPrEWREaYOH+N29HykgIMoMuAJ RqGjNBEpwZIRFbzdcKiFI+/VW0kN87YXzncIGHRywIVPoWNI4wZc9wE6/g6/wub91vi9 aY+pA03UL/4T3Sw3y75OePQAua4v1EK8GIeCVliEmM9FkejsQzdQp77R2z5MZS2qUgpa 8MShPOTecyO1IN1i47kEcHi/OFGInB6XdsikI4uDR3kR/LBL2ag7Hw2Y3M9MfAR6fKRt rtMg== X-Gm-Message-State: AO0yUKUZynqWqOSxyuqCrLI3/gz+0PwEqCztOmIlj98YVlsizemMOE5X pg18kzxbD/0aOQyN1XWjXFOwVepHGq8= X-Google-Smtp-Source: AK7set/1Sc1nmgU0waWEg1Fp11TAO7UR0cIngSYeqXjMeBSttkvs1pcAIacPUlIhVspkOUqy2J2pyA== X-Received: by 2002:a05:622a:1709:b0:3ba:18c2:99e7 with SMTP id h9-20020a05622a170900b003ba18c299e7mr4168628qtk.45.1678939947931; Wed, 15 Mar 2023 21:12:27 -0700 (PDT) Received: from t480 (2603-7081-5f01-058e-100b-1238-d96e-2b65.res6.spectrum.com. [2603:7081:5f01:58e:100b:1238:d96e:2b65]) by smtp.gmail.com with ESMTPSA id e11-20020a05620a014b00b00746059d9c3fsm2161700qkn.35.2023.03.15.21.12.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 21:12:27 -0700 (PDT) References: <87pm9z8089.fsf@t480.home> <87y1om7w23.fsf@t480.home> <96a91a35-eeb6-55d3-683d-5d51ff6d496e@gmail.com> <877cw5aiab.fsf@t480.home> <87sfet7kul.fsf@t480.home> <0e841ec9-f770-4f4f-a5e6-eb15290ab8a7@gmail.com> <87k003swax.fsf@t480.home> <87a60yxec3.fsf@localhost> User-agent: mu4e 1.8.13; emacs 27.1 From: Ken Mankoff To: Ihor Radchenko Cc: Max Nikulin , emacs-orgmode@gnu.org Subject: Re: [PATCH] lisp/ob-screen.el: Support ~:var~ header args for babel blocks In-reply-to: <87a60yxec3.fsf@localhost> Date: Thu, 16 Mar 2023 00:12:26 -0400 Message-ID: <874jqluyfp.fsf@t480.home> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::82c; envelope-from=mankoff@gmail.com; helo=mail-qt1-x82c.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.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-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=HzmZo95U; 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=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1678940005; a=rsa-sha256; cv=none; b=foUdVfd6DF9Uuhzsuwqa+kZs77IYMnbZJ/DHlEDG7R5L24I5d5U/BccWcTl/HJVSB88DAD og3MAsrnTvfVZWscIsR79xdLbWHrlCwe/7nsfbxMgkNT+qGVa9KmB4n9JOkmTpkgNwetlx DJgJWuLVKGFng+yksyy0apZYYCpnun6wW7M3Tc7lpOXHE6G+qeQdNqAnDh3BLcKUxZAKVj 7j7NRLIxQPx1sbd2BVvAH+M/Uvaw+XVuugPnWuvZ37Oi/VIJH/i2Pz7dvdhggQ4qUPSwUi lmKB/qSPJk5wuvjVabdElJaHhC3oTNGTKgPaWmsiPp3HEYcmqn+4lRmr1Q8flg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1678940005; 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=l2JguXoLykYt2rG/LdilQiilz3gW3MS3M8piKO4MZeU=; b=j98SL8dxPvwSnnJpUrRvUwIpgBTEV720bx6a21MIychvB2/nYIKFiQIVHL7TaqCuZtW8wl 6JGVoekhCCnMUnW2Cg3q9jh7UX1b/Epg/WcCnJNN/pf5b8q5jLVAkDhazPhqjXmYv0CICE bbxhgOIEtBmtbZ2/PrWAo6mnuvpt6i+Qb0PqlZBgx0pFUydhvjozHaEtDeIwSovVh3gNvU 5tj5F2MMcE3yibHEEybGGhWnXJWHApznJXqSPT43IArr4cObInOI3b8UnztDKdYVXtXyI6 DZzS5CxGMSsJWj17AtddrXTc3DDckhG8UjA2qewI8v9sdgCmDTt+m2o+rcIgVw== X-Migadu-Spam-Score: -6.47 X-Spam-Score: -6.47 X-Migadu-Queue-Id: 7A2433D04E X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=HzmZo95U; 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=gmail.com X-TUID: YsMqgIAVHKHo Hi Ihor and Max, Just a follow-up note that I am unlikely to be able to complete this patch anytime soon. Re-alignment of priorities because my need for :var header support in Org Babel is mitigated by a different method of injecting variables into Org Babel sections: Use noweb. I find this more powerful than =:var=. The examples below show (1) setting a bash environment variable in screen, or (2) printing from a Python prompt after sshing to a remote computer. It is language agnostic. Because it uses PROPERTIES and not :var, it also lets me work in Org Column View mode. * Header :PROPERTIES: :foo: 42 :END: #+NAME: ex1-screen-bash #+BEGIN_SRC screen export foo="<>" #+END_SRC #+NAME: ex2-ssh-python #+BEGIN_SRC bash ssh somewhere python print("<>") #+END_SRC #+CALL: ex2-ssh-python() #+RESULTS: : foo The relevant section from my library-of-babel is: * Properties into header args :PROPERTIES: :hellomessage: hello :END: https://emacs.stackexchange.com/questions/41922/ #+NAME: get_property #+BEGIN_SRC emacs-lisp :var prop_name="" :results silent (org-with-point-at org-babel-current-src-block-location (org-entry-get nil prop_name t)) #+END_SRC ** Example Usage *** Header arg #+HEADER: :var prop_message=(org-entry-get nil "hellomessage" t) #+BEGIN_SRC emacs-lisp (message prop_message) #+END_SRC #+RESULTS: : hello *** Noweb #+BEGIN_SRC emacs-lisp :noweb yes (message "<>") #+END_SRC #+RESULTS: : hello #+BEGIN_SRC bash :noweb yes :results verbatim echo "<>" #+END_SRC #+RESULTS: : hello If hope this helps someone if they need it. -k.