[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] lisp/ob-screen.el: Support ~:var~ header args for babel bloc
From: |
Ken Mankoff |
Subject: |
Re: [PATCH] lisp/ob-screen.el: Support ~:var~ header args for babel blocks |
Date: |
Sun, 26 Feb 2023 17:59:24 -0800 |
User-agent: |
mu4e 1.8.13; emacs 27.1 |
Hi Ihor,
On 2023-02-26 at 04:18 -08, Ihor Radchenko <yantar92@posteo.net> 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.
- [PATCH] lisp/ob-screen.el: Support ~:var~ header args for babel blocks, Ken Mankoff, 2023/02/24
- Re: [PATCH] lisp/ob-screen.el: Support ~:var~ header args for babel blocks, Ken Mankoff, 2023/02/24
- Re: [PATCH] lisp/ob-screen.el: Support ~:var~ header args for babel blocks, Max Nikulin, 2023/02/24
- Re: [PATCH] lisp/ob-screen.el: Support ~:var~ header args for babel blocks, Ken Mankoff, 2023/02/25
- Re: [PATCH] lisp/ob-screen.el: Support ~:var~ header args for babel blocks, Ken Mankoff, 2023/02/25
- Re: [PATCH] lisp/ob-screen.el: Support ~:var~ header args for babel blocks, Max Nikulin, 2023/02/25
- Re: [PATCH] lisp/ob-screen.el: Support ~:var~ header args for babel blocks, Ken Mankoff, 2023/02/25
- Re: [PATCH] lisp/ob-screen.el: Support ~:var~ header args for babel blocks, Max Nikulin, 2023/02/26
- Re: [PATCH] lisp/ob-screen.el: Support ~:var~ header args for babel blocks, Ken Mankoff, 2023/02/26
- Re: [PATCH] lisp/ob-screen.el: Support ~:var~ header args for babel blocks, Ihor Radchenko, 2023/02/26
- Re: [PATCH] lisp/ob-screen.el: Support ~:var~ header args for babel blocks,
Ken Mankoff <=
- Re: [PATCH] lisp/ob-screen.el: Support ~:var~ header args for babel blocks, Ihor Radchenko, 2023/02/27