From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id kmAIJboO/GMBHAAAbAwnHQ (envelope-from ) for ; Mon, 27 Feb 2023 03:00:26 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id GMJ+JLoO/GNIGAAA9RJhRA (envelope-from ) for ; Mon, 27 Feb 2023 03:00:26 +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 7B24AB172 for ; Mon, 27 Feb 2023 03:00:25 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=iTr8RDHy; 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=1677463225; a=rsa-sha256; cv=none; b=oyDp0PWMK9r2lwfp5aCqj22+8Ob4thoj0VQItivzE5JZwjd8JPfheIQCh5dFBb1e4QwOUX TQxKegr+LzC5/Jd0oLoAQzBT2HhEA1GyEUUXOCs6Ms7sgRJafOCDOlLN7oYkhTnIpaLxAV AZ+3CwQiCLEsxtgBhDai/WFPRDTQVPzfjsKEJfvJU5Wsyc7BMXWinX8yqOTFeum1t54UeZ GWS+xRuynT+nQgi9ZGW9jDjSH/4/wUyDMTaVIeYwH3FzBcJhXEpoJjLpvrbfJ2qdpdE3No KKO1lEPQHb2CjZwpqPEYoYEIbUrrXCkUne2Qwe+gysdJQCsP3zjbsTlHz9E10w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=iTr8RDHy; 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=1677463225; 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=6Lkwtibnv9R3mzoDkY2jMJpWNonV8v7VvOz6KgO/+WU=; b=qJFz80C07jMfi/XKimyA9KWZn7IGQinkfiBPfM0dcSsPhmXlcC/tAhEQIIhcndVv/LINhu pvX3pvNrF3W/NOsD6M0qFBJLAKvULUPB0nOeDMxwRITOlo3q+Bz3Pvxn2esNL+kUJFI0fN FOe/xq4h+2KsoplpY3Zl6PxSMc1LZx8btRPv3CUbxYi5rsmKRqtFHBq/X6IebQlfnrFTbr /66pmPAc/AtyuRRXBIRP6Nfk3GfKMfTOKdeGDcRKwgcZ/9J5Rt7KXBzFpVI8/FxyTQRGlB O3zfuyDWPsCXQc+pZavQ1k5UidfH/Nz6KtnNxIEXVwtPC7F53rcZKKDQUdCY0A== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWSna-000802-OR; Sun, 26 Feb 2023 20:59:30 -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 1pWSnY-0007ze-RZ for emacs-orgmode@gnu.org; Sun, 26 Feb 2023 20:59:28 -0500 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWSnX-0003HV-9m for emacs-orgmode@gnu.org; Sun, 26 Feb 2023 20:59:28 -0500 Received: by mail-pj1-x1030.google.com with SMTP id k21-20020a17090aaa1500b002376652e160so4766456pjq.0 for ; Sun, 26 Feb 2023 17:59:26 -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=6Lkwtibnv9R3mzoDkY2jMJpWNonV8v7VvOz6KgO/+WU=; b=iTr8RDHy3SPdmsFiU4n+iby6UoESY2gFKIJFIlS+Hp/1FUykOjGvNESiGg08ImzBWZ 4pzgqQYRbjgTgQ7MnzsT1QDgqreE1t/dR+exOeX5Er0e77M3I8DrrdoFSEGJKH+zc+ve SFGE30phzgcUZkRMQpWYX8S4VOj/UI8wSHw3pOS+feHZGoSOkuO0G4D15txs+mrj29xj lbo6CXxHUqVJftb1bw97JxSdOT3Pc9bKSIm6+BRbHVfUVDu7HTAquQDtkhA+K2ndkAMp LZV30ZaLMr8i9J/Ew/qcZH/TsH0SO1tHZUDzOMpkdx7xpGsjb4SaVjkREHO1cWXubZqk j+Xg== 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=6Lkwtibnv9R3mzoDkY2jMJpWNonV8v7VvOz6KgO/+WU=; b=Hvf81kpVjuf6kFzXei0LUS/sP25QFdzSIoN1vasHNaaqZYSLZXXZI5HCTPngswynal IxUxe+N699fCtt8HVaGKkJkDcSGUdzGUniMYhuhBJdNdaTyZ50El/i1bCOXEyP2vUV9S ISEvlaSiA6SX7BlnZoxKSe9kBzasRmzmPn6b5SexNDu6AH4xA5NBa7LfLS8O4VjfIn7Y yyAHQuNJfBfSWCKZzqt24yoqpkrOPpBo3RHyhyhylpMB6Fl/sqe0ZUk3dHtxUCEZhLmy S6sJXrrlYcMDJqtdTHVuUnJoTAu5RAFlz3cHIU73zlTodGzYMfKFwMQYds86IMMd4Qin IUqQ== X-Gm-Message-State: AO0yUKXGCyogdCAoYJ0PqtpCrg5bzb98c2diJJJhS7o8mkCJdIxFPX32 ok+9PL4s/Mp2qrYsjPo1BC5kAdrLvjNTx1Aq/js= X-Google-Smtp-Source: AK7set9nGTL1xgNQ3mKywJyauJ5IcUA8fpyAYHTOfkAw/mDUnEA1ToCjfwnyjXsyCSk73OcxCRbjxw== X-Received: by 2002:a17:902:c40b:b0:19a:5958:15e7 with SMTP id k11-20020a170902c40b00b0019a595815e7mr8436496plk.15.1677463165507; Sun, 26 Feb 2023 17:59:25 -0800 (PST) Received: from t480 (97-113-138-203.tukw.qwest.net. [97.113.138.203]) by smtp.gmail.com with ESMTPSA id i19-20020a170902eb5300b0019ab151eb90sm3258468pli.139.2023.02.26.17.59.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 17:59:25 -0800 (PST) References: <87pm9z8089.fsf@t480.home> <87y1om7w23.fsf@t480.home> <96a91a35-eeb6-55d3-683d-5d51ff6d496e@gmail.com> <877cw5aiab.fsf@t480.home> <87sfet7kul.fsf@t480.home> <87lekkzkl5.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: <87lekkzkl5.fsf@localhost> Date: Sun, 26 Feb 2023 17:59:24 -0800 Message-ID: <87fsarswar.fsf@t480.home> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=mankoff@gmail.com; helo=mail-pj1-x1030.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: 7B24AB172 X-Spam-Score: -10.01 X-Migadu-Spam-Score: -10.01 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: haDQNF9z50AC Hi Ihor, On 2023-02-26 at 04:18 -08, Ihor Radchenko wrote: >> +;; Reuse the variable assignment code from ob-shell >> +(defalias 'org-babel-variable-assignments:screen >> + 'org-babel-variable-assignments:shell) > > This will work, but you are relying on implementation detail of > ob-shell.el. A more safe approach would be calling > org-babel-variable-assignments:LANG depending on the :cmd header arg. > For :cmd bash - org-babel-variable-assignments:bash, for :cmd fish - > org-babel-variable-assignments:fish. > > To archive this, you can define a full > org-babel-variable-assignments:screen function that does what I > described. You're pushing my lisp skills here. Which is fine, but I might need some help. In ob-shell I see (defcustom org-babel-shell-names '("sh" "bash" "zsh" "fish" "csh" "ash" "dash" "ksh" "mksh" "posh") Should I create a function that, using case statement or something similar, checks for each of these and calls that flavor? I think I could do that. But if I also see org-babel-shell-initialize in ob-shell that looks like it creates defaliases for each of these to (org-babel-execute:shell) and #'org-babel-variable-assignments:shell. I'm not sure how that is very different from what I've done. I'm not sure what to do here, nor how to do what you suggest (yet - I've only read it so far, not spent a lot of time experimenting and searching, so I may be able to implement what I think is a solution to what you wrote, but I doubt it'll be what you expect). -k.