emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Connecting to an Already Running Scheme REPL with org-babel


From: Ihor Radchenko
Subject: Re: Connecting to an Already Running Scheme REPL with org-babel
Date: Tue, 30 Jan 2024 11:54:48 +0000

Hunter Jozwiak <hunter.t.joz@gmail.com> writes:

>>> +             (host (cdr (assq :host params)))
>>> +             (port (cdr (assq :port params)))
>>
>> Please declare these new scheme-specific header argument in
>> `org-babel-header-args:scheme'.
>> See `org-babel-header-args:C' for an example.
>> This is necessary for header argument completion to work.

> Okay. Is there a way to tighten these inputs further? I have them set to
> :any for the moment, but I wonder if there is a way to leverage the
> values for `geiser-repl-default-host` and `geiser-repl-default-port`.

Org-mode currently does not provide completion for header argument
values. (see `pcomplete/org-mode/block-option/src')

If Org were to support such completion, you could theoretically allow
special values for :host/:port like default:

#+begin_src scheme :host default :port default
...
#+end_src

to use `geiser-repl-default-host'/`...-port'.

Then, you could add these values as (default :any).

>>> -          (and (not (string= session "none")) session)))) ; session
>>> +          (and (not (string= session "none")) session)  host port))) ; 
>>> session
>>
>> This does not look right. Your change will disable session support
>> completely when host and port are not provided.
> Is there a way to test this and pinpoint the problem?

Hmm. I just realized that I am reading that line wrongly - host and port
are additional arguments passed to
`org-babel-scheme-execute-with-geiser', not a part of
(and (not ...) host port)

So, my only comment remaining is to put each argument in its own line,
like it is done for all the previous arguments:

(org-babel-scheme-execute-with-geiser
               full-body                       ; code
               (string= result-type "output")  ; output?
               impl                            ; implementation
               (and (not (string= session "none")) session) ; session
               host ; repl host name
               port) ; repl port

That will make the code more readable.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]