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 ms5.migadu.com with LMTPS id wILeFSIm+mOubgEAbAwnHQ (envelope-from ) for ; Sat, 25 Feb 2023 16:15:46 +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 eLnCFSIm+mOMHgAAauVa8A (envelope-from ) for ; Sat, 25 Feb 2023 16:15:46 +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 173F33C508 for ; Sat, 25 Feb 2023 16:15:46 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Io2vmOAn; 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=1677338146; a=rsa-sha256; cv=none; b=WnKvwDwlNz9nzog3GT9QfOoOeFNLY746Y/zMXOBiYKP7q5W+PzTy0psNvEmxLRemQzL5x8 MsMBuvg+kHIadSPKfG7hEhUnS31euTFd2s2hW+w8rBUf8Jx2DH7G6dGANVtReEtZRT0RVP AbsJPShciF0hZ8TWefwgMPc5eyuNMraSNRhEwJw288guxdGDgwoOhwQydX0V+Ri6H++Kn2 EMwfuTuVlnZwmF5YcbghPkW9TC6CO7uwnlbs0kAr+JrIlRIvUFMIgMHOCUyJi5JPc0zwMm KOe92L5KZyMKfKfIrmBlP7guAYvYI9OyBvrPgId7QsvhBnmC1jEzPcRlVUu7pw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Io2vmOAn; 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1677338146; 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=g4hHy7e2zNu2hBsig/mkGiDAa1vjoDQfliGmQz6DnV8=; b=Sx5Hb2NP1U8snlriSPrP1tOpi4XBnwn9e0EYCT13ymLhLHg2On4R1q6mnH8C8/JCCvyhOb RMQfMg8o9Bre0YQ0Qpjd43SvmPvGAXDyl4bwUgpo/m4zSJ1pWl2aDf9XRicXLpRJwI/Qm9 qwzKfyGCRaCHStwD82KFvk0i464p1tc5oubrzlIMV2SG7sKGab/7y2LY9IX+dy/dw3IyPQ V2YzbfYYJ9BAPJRyF/QYt3k8wW1DZhFMYwInrxjsTO0rPwSGwPXXWkb6kMYuNq9Vw1aZ72 5Ia+U/ZbutJNtmzxtlmdCU383ZOxpQ/j1XDjwA4zWXcuU07AxxpMhSOyc7kSgg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVwGJ-0007d9-QQ; Sat, 25 Feb 2023 10:14:59 -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 1pVwGH-0007d1-40 for emacs-orgmode@gnu.org; Sat, 25 Feb 2023 10:14:57 -0500 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVwGF-0006Ke-Fy for emacs-orgmode@gnu.org; Sat, 25 Feb 2023 10:14:56 -0500 Received: by mail-pf1-x431.google.com with SMTP id a7so1129599pfx.10 for ; Sat, 25 Feb 2023 07:14:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=g4hHy7e2zNu2hBsig/mkGiDAa1vjoDQfliGmQz6DnV8=; b=Io2vmOAnU+f/eJUutt3B2GadR5H1wUJpTS6u69h0L/LJwEyfDxb+2vc1PVaHqdCg7P FzOWqCA0Ka5g4YTnJ4ngUgeGGhl7q4mUfP2BsdwLN09Xb/dnlvIP7ttuse4QAeNUrB6B QkMl/bWeCmPNnTEmCLoDFm9SwCy+sfH2d6Wzh57ygpQHPZwZefNWXoMo88G80f3y0f5y O01CcPEQvWrU1Xa/oJ6MnQMtNcuJCXVM7FAwObligoOv6AK4GbH+FWhU4BkaPgsL1C8W jefr1BAJwcTpeSFOkesjcJQuOGygZ6rvvjmLL8x6L60Y0ct9o0dHCRg9asqN3/Jozj/5 z9Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=g4hHy7e2zNu2hBsig/mkGiDAa1vjoDQfliGmQz6DnV8=; b=KqKGzgE50PJioISr4e8l5zClNBfknC590oZINga6fFMNMGlihEw6tWReVjhl+HSDgz s/KuldFvaQkAoxHoLXVVkZ/LD3VyQdKT0lFAyNlYz/2ruIes4BTSaMVHgLAKr71HPSVd BRVh6vQbkmPt3eWjpc85uUyutwIswRX98xp9bOO3IZ9iN6cjoarLWnqUvL967V9tt92w 2BHCJpolIVYqT8d3pVIGAp5NJhBgux1elleX/syFAWwKge7p+dEsDRcEwW4mMX91aww2 opQws+QzzsYg9Ytf6aufGBJUBcGAjXQCUSs/qQ2HupYTttXCwYeRcK3K9eQgxipYrqZ5 Khog== X-Gm-Message-State: AO0yUKW91n6KQj6x87J8ssis5I3S9T87mci0POisWSaOlpSSQ9ugrv11 nnJkzU7DgzGwB4Z0GhVucBlaqLKbW0F7MYEdKUE= X-Google-Smtp-Source: AK7set+5TTv/eIoU2NaG8pGKxLOCvi+8O8uG3FhZNFWjZnNCMnqbiYXEQtT4pzo9VqKkAgkaSaymlg== X-Received: by 2002:aa7:9562:0:b0:5db:c07e:9e4d with SMTP id x2-20020aa79562000000b005dbc07e9e4dmr8140934pfq.6.1677338093745; Sat, 25 Feb 2023 07:14:53 -0800 (PST) Received: from t480 (97-113-138-203.tukw.qwest.net. [97.113.138.203]) by smtp.gmail.com with ESMTPSA id g11-20020aa7818b000000b0059072daa002sm1327378pfi.192.2023.02.25.07.14.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Feb 2023 07:14:53 -0800 (PST) References: <87pm9z8089.fsf@t480.home> <87y1om7w23.fsf@t480.home> <96a91a35-eeb6-55d3-683d-5d51ff6d496e@gmail.com> User-agent: mu4e 1.8.13; emacs 27.1 From: Ken Mankoff To: Max Nikulin Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] lisp/ob-screen.el: Support ~:var~ header args for babel blocks In-reply-to: <96a91a35-eeb6-55d3-683d-5d51ff6d496e@gmail.com> Date: Sat, 25 Feb 2023 07:14:52 -0800 Message-ID: <877cw5aiab.fsf@t480.home> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=mankoff@gmail.com; helo=mail-pf1-x431.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: X-Migadu-Queue-Id: 173F33C508 X-Spam-Score: -9.90 X-Migadu-Spam-Score: -9.90 X-Migadu-Scanner: scn0.migadu.com 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-Flow: FLOW_IN X-Migadu-Country: US X-TUID: sdVpMJ2Mepl0 --=-=-= Content-Type: text/plain Hi Max, On 2023-02-24 at 19:51 -08, Max Nikulin wrote: > On 25/02/2023 01:33, Ken Mankoff wrote: > I am unsure if Org markup is suitable for commit messages (~:var~) > since it may appear in Emacs commit logs. Fixed. > The code still depends on on ob-shell. Is there a reason why calling > `org-babel-variable-assignments:shell' is a worse variant than copy of > the whole function body? I didn't realize that was a dependency. I now use that function. This also means that arrays/tables/etc. are all supported by :var, although not in the default screen ":cmd sh" because sh doesn't support "declare", but it works with ":cmd bash". Improved patch attached. Thanks, -k. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-lisp-ob-screen.el-Support-var-header-args-for-babel-.patch >From 580499925644cdb9c2dd8c783ec03c095bec7a86 Mon Sep 17 00:00:00 2001 From: "Kenneth D. Mankoff" Date: Mon, 20 Feb 2023 21:40:39 -0800 Subject: [PATCH] lisp/ob-screen.el: Support var header args for babel blocks * ob-screen.el: (org-babel-execute:screen): Parse header params for `:var', then inject into screen session. * etc/ORG-NEWS: Document as New Feature --- etc/ORG-NEWS | 12 ++++++++++++ lisp/ob-screen.el | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 87ecd77cd..0da686354 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -106,6 +106,18 @@ selection. TODO state, priority, tags, statistics cookies, and COMMENT keywords are allowed in the tree structure. +*** ob-screen now supports :var header arguments + +The ~:var~ header arg is now supported. + +#+BEGIN_src org +,#+BEGIN_SRC screen :var x=42 +,echo $x +,#+END_SRC +#+END_src + + + * Version 9.6 ** Important announcements and breaking changes diff --git a/lisp/ob-screen.el b/lisp/ob-screen.el index 269538e79..bd8650f6b 100644 --- a/lisp/ob-screen.el +++ b/lisp/ob-screen.el @@ -55,8 +55,12 @@ In case you want to use a different screen than one selected by your $PATH") (message "Sending source code block to interactive terminal session...") (save-window-excursion (let* ((session (cdr (assq :session params))) + (var-lines (org-babel-variable-assignments:shell params)) (socket (org-babel-screen-session-socketname session))) (unless socket (org-babel-prep-session:screen session params)) + (mapcar (lambda (var) + (org-babel-screen-session-execute-string session var)) + var-lines) (org-babel-screen-session-execute-string session (org-babel-expand-body:generic body params))))) -- 2.34.1 --=-=-=--