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 YP3bFuQH/WMPDgEAbAwnHQ (envelope-from ) for ; Mon, 27 Feb 2023 20:43:32 +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 CLd6FuQH/WPneQEAauVa8A (envelope-from ) for ; Mon, 27 Feb 2023 20:43:32 +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 D833825977 for ; Mon, 27 Feb 2023 20:43:31 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=TMnGZEIB; 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=1677527011; a=rsa-sha256; cv=none; b=g3AM6ATw4lM8jGIqv9HRL4PIFo38nR7VqRgDQIiSH+dgJhgD2aJx4RhmrpvJ+FKo7pcHXI qbcVvO66r1Lj0gyIkbnxta/XpFSfhiftVddbYaxaVJYkG7wn7hOB0YgJ9mw5YznOfGSA5y p66ouFzM/FmUVCPDI67DRmUxq00tYdKTkH9mIhua0KdPPTgdF+xrwCBJsw3vFGjhtdLMHn 5yhPuXGmklExIeznpGKfpsxnC0+m1X0GfLx0mIm/a2wVy3NRICt1N1i0okqESvDGi1qdAl RvLhyDJvuoLxE6OIStHP7ytFQa/l2/5K9L4UUDr35H45jR2W9NrnRzB+QFe96w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=TMnGZEIB; 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1677527011; 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=U1n4f6r+BsFW18buEP1Hon5gUA2O9HFwFGnmh9wcFIw=; b=A9XRnK1UR02j1VSvo+eL+ULhU6OsupdXH7fzOnv8nQ0QJh4MaFkKBHcQ6I6UipuphRyxWL PrXtk+lbTszmv4xTStvm0j6SGrYHyEoshRMph6NZsgUuyWrYUEYkF7vMaax9l7h866crIP gkfSBCFy34WkJnb4bcnAjzJclYG12tJHOtTE8gsC5m2DJ8k+az9eiGFByK3vMADzzhH59w XjFyHWN4xIjB/uPpx2wVHxwNb6Wfhsmja22PYX8pYeSzd0gSGPpPbhrryeE5JQ1o16tagk 7AQmPN+eWWMwvXQTTCzBuLbVEYAYm2wvLXBdaLEAi57gsY9uzenvJfcuRs+Stw== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWjOI-0002G5-UK; Mon, 27 Feb 2023 14:42: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 1pWjOH-0002EW-6z for emacs-orgmode@gnu.org; Mon, 27 Feb 2023 14:42:29 -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 1pWjOE-0005iS-CQ for emacs-orgmode@gnu.org; Mon, 27 Feb 2023 14:42:28 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 7F56A24061E for ; Mon, 27 Feb 2023 20:42:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1677526944; bh=7m1+izRu4XlFSup2Y0l8AruDvh2V/CF1EQ+S9vW8fNs=; h=From:To:Cc:Subject:Date:From; b=TMnGZEIBdn1QGFI5AZLyKTjU2hDM2WiUKAbnXZ3b6Xhr/tQqKLulvoJrsxSQ/DnSa Ozl6oqNcWjWQl9B/CfK/Pg2FrRzfZz9Zqvdje4VxPL9E0Q3BNFQ3WWhruATmHts6ai ceWJYFF+wzmqaH58akoP/vNA9mgd7YRcnyBTG4gLC4t1SSds0vrU+ULvCm7XSdMvGh INakgZ5ZIhq4i3qdXPjLo8AsOLZ6bMEnygyxwiqH9ifLCN15JwSzChOylW2DHeqwil 6t5QCdl27j+uclMMQbQyAdLeYSEY9mD3VyutMb4V2f/M9Wb0QzwXG62ECefwIke0D7 D6Hp+euEkYnAQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PQW9W54Bwz9rxD; Mon, 27 Feb 2023 20:42:23 +0100 (CET) From: Ihor Radchenko To: Ken Mankoff Cc: Max Nikulin , emacs-orgmode@gnu.org Subject: Re: [PATCH] lisp/ob-screen.el: Support ~:var~ header args for babel blocks In-Reply-To: <87fsarswar.fsf@t480.home> 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> <87fsarswar.fsf@t480.home> Date: Mon, 27 Feb 2023 19:43:06 +0000 Message-ID: <87pm9uyjw5.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: X-Migadu-Queue-Id: D833825977 X-Spam-Score: -9.97 X-Migadu-Spam-Score: -9.97 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: Tjk4Q74eeOfL Ken Mankoff writes: >> 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. Not each of these. AFAIU, :cmd header property in ob-screen defines which shell to use. Knowing shell name, you can deduce the function name to be used for variable assignments. See how it is done in `org-babel-expand-src-block'. > 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. The convention is for every possible #+begin_src lang to have org-babel-variable-assignments:LANG. ob-shell just tries to avoid unnecessary code duplication and instead of writing identical org-babel-variable-assignments:sh org-babel-variable-assignments:bash, org-babel-variables-assignents:zsh, ..., it generates them using a macro. > 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). AFAIU, you don't need to juggle with macros as ob-shell does. Something similar to `org-babel-expand-src-block' will do. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at