From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id WGGDBLvet2WLfgAAe85BDQ:P1 (envelope-from ) for ; Mon, 29 Jan 2024 18:22:03 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id WGGDBLvet2WLfgAAe85BDQ (envelope-from ) for ; Mon, 29 Jan 2024 18:22:03 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Xi4J0eWV; 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=1706548922; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=CdwBCaeex7dmlJJRGqVfOBCwypcz5ahzyjc52MfwegY=; b=fx7IzxLL96ANkJRsMhQM6TiWUBQB2UZF7yDlxBs6x/XEfjIlcUem84BHp3fhi8fT83bMR/ vEoPMA6ZbKzaUfRE11usxOr5hS5TZY7i0irz75sLKHaePHOHvWNgftPmEGYkPAT0yM1vTb DkfZ7B6xDb715LQcFnyNs1rOuOFrXeAIm8Z4rLak6+bFbncLZ49A1prMdsfghRQ1wjK8c1 TvI7D9PNc2L/7HZJm9QWhlVPZKLODGzv55UGLBx51ue69GO3xP8gjpAbOd02d9OWqq9Qa7 qNttFeNZC7tEle35fKlWnsFtZfkiFVUQ488sCXhOLZu54J608yGAOEL2jCWEDw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Xi4J0eWV; 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=1706548922; a=rsa-sha256; cv=none; b=b/B7sElHTYcSeL9q6n1giW7XqQLiYlnFTYQRyxxSVGVhO1JI/KqFZ7zO5Q6DxUZTbG6Sh+ XNZqeBMr1EEI6/Z2RFQ1bz/v7VIJid9DogF8dkeEyNqUjxqQgQrjQr9TEpR/l25/R+Tvyh undYwLFv0gy2Rqb9ktN7tKZXkdQY+Dcv+K6YBLgjtRTE1Gg/g94YjJ6Vr2PjGePuarLBn+ vMhLTVYvv/rqHJh0TBxUgzP6SrENNFsa+VF6/Y2qpRCsPBsxOfedaw1IM5jWKMwmRCOgA9 j5V5GlB7sMIRRX4No5eku6jx3ktLB3/dPfrSu03nr9G6NA1T3+TQeDalQZ2fpg== 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 A0C1C17D35 for ; Mon, 29 Jan 2024 18:22:02 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUVK1-0008S8-FZ; Mon, 29 Jan 2024 12:21:25 -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 1rUVJy-0008LN-QS for emacs-orgmode@gnu.org; Mon, 29 Jan 2024 12:21:23 -0500 Received: from mail-qt1-x833.google.com ([2607:f8b0:4864:20::833]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUVJw-000310-IL for emacs-orgmode@gnu.org; Mon, 29 Jan 2024 12:21:22 -0500 Received: by mail-qt1-x833.google.com with SMTP id d75a77b69052e-429f53f0b0bso32135351cf.2 for ; Mon, 29 Jan 2024 09:21:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706548879; x=1707153679; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=CdwBCaeex7dmlJJRGqVfOBCwypcz5ahzyjc52MfwegY=; b=Xi4J0eWVkuCQjyuIKgbCU9GLYz3IWQBLhWphVaCxonqVLVdc7YBuvQEjSHcuQ/dcKH i7PNGziXCQ3/08tpwlrAmi93DVpR2eGUaH5aCUBcHaGhqQFIGe0t/7mI/ACca362ffy1 Pqn+8GhudU7iLtjUhQEzaMoP4LmEnEbL5xubVCAXEC9c79WGxKih4MDHWvwQ9SmrzD7E MncUnPtgylAW7nX7cRl0pC9Zed4dO2USuczfkc0b8fb0fsi4SeO11yuEEK8qmkQLR0wF zXvnZjJXdCnqi+47iYlFmAGpKwZYCu9XKBXScByrrHj3KxwN5BLuB45+GEB42i4ktWDt xkjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706548879; x=1707153679; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CdwBCaeex7dmlJJRGqVfOBCwypcz5ahzyjc52MfwegY=; b=wLx3cBaQvlsuNDzaJ2TSia18/h5zpPOTzOLcJXjPA3jm2ZLVVIg8JRJk5HTv8fwWYU +npcHdaM2uU3AkmWFMLA2RTY+Q92ZrsM1u4oJiVbvLPj4JgK6x9R1c9jp/nrcgL12Yu8 BVh+3UzvzOVYIXB9iJHPG//i5tOTCksbJ5ElAAmWHT5b9UpoEdQ1TDRCveGgW3PiNcdG hmwcK5Dj4fieTAEr9e2vzK+YME1VSIiPy9K6EhyUD2K0iDPPwAOMFFAfsornhz3cXrmJ R9DYsUsQCTQ1p6YykRU76xCfEJ2Ngl0KXx9WCZqlKNE6157ij6+i0lGrMT9hVz19Br4o xm3g== X-Gm-Message-State: AOJu0YxDo5C1eK2zQnOgXfR8Iy0qOm/W0LPfuiOGk46/fKBBUB84B5Cx uaMdVAaxUeZypjIttaW4I8bAjKGcMjrX1hXPSGzF4fxUVld/OHnhxbz+W13Qrug= X-Google-Smtp-Source: AGHT+IHzB3l2aLf9Ign0QJ5vrKyd2f3kcmj4/0/pl3NfEUf7iIP2344HOb1M91rzWuePeu/ilvXJBA== X-Received: by 2002:a05:622a:14c9:b0:42a:82b5:b796 with SMTP id u9-20020a05622a14c900b0042a82b5b796mr7011737qtx.129.1706548878474; Mon, 29 Jan 2024 09:21:18 -0800 (PST) Received: from tekunen ([2601:547:1500:6340::f92c]) by smtp.gmail.com with ESMTPSA id i11-20020a05622a08cb00b0042a9d64396esm1738515qte.74.2024.01.29.09.21.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 09:21:18 -0800 (PST) From: Hunter Jozwiak To: emacs-orgmode@gnu.org Subject: Re: Connecting to an Already Running Scheme REPL with org-babel In-Reply-To: <87il3cmg4o.fsf@localhost> (Ihor Radchenko's message of "Mon, 29 Jan 2024 13:19:19 +0000") References: <874jex3xxh.fsf@gmail.com> <87v87dm613.fsf@localhost> <87r0i03kgq.fsf@gmail.com> <87il3cmg4o.fsf@localhost> Date: Mon, 29 Jan 2024 12:21:12 -0500 Message-ID: <87zfwojbsn.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="===-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: pass client-ip=2607:f8b0:4864:20::833; envelope-from=hunter.t.joz@gmail.com; helo=mail-qt1-x833.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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 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-Migadu-Spam-Score: -10.08 X-Migadu-Scanner: mx13.migadu.com X-Spam-Score: -10.08 X-Migadu-Queue-Id: A0C1C17D35 X-TUID: D4txh7V1qpry --===-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: multipart/alternative; boundary="==-=-=" --==-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Ihor Radchenko writes: > Hunter Jozwiak writes: > >> Here is a patch that provides this functionality. > > Thank you! > >> Subject: [PATCH] org-mode: allow ob-scheme to accept a remote connection. >> >> * lisp/org/ob-scheme.el (org-babel-scheme-get-repl): introduce two >> optional variables host and port. If there are not given, just run > ^^^^^^^^^ arguments > >> * lisp/org/ob-scheme (org-babel-scheme-execute-with-geiser, >> org-babel-execute:scheme): take these optional arguments into >> account. > > ... and add two new optional arguments. > >> @@ -231,6 +235,8 @@ org-babel-execute:scheme >> geiser-scheme-implementation >> geiser-default-implementation >> (car geiser-active-implementations))) >> + (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`. > Also, please document the new header argument in the ob-scheme > documentation at > https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-scheme.html > (you can submit a patch against > https://git.sr.ht/~bzg/worg/tree/master/item/org-contrib/babel/languages/= ob-doc-scheme.org ) > Sure thing; I can do that after I finish this message. >> - (and (not (string=3D session "none")) session)))) ; session >> + (and (not (string=3D 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? I'm not familiar with= using :sessions. Here is what I tested so far: #+begin_example #+begin_src scheme :scheme guile :host localhost :port 37146 :session *imag= e* (use-modules (gnu) (guix) (guix gexp)) #+end_src #+begin_src scheme :host localhost :port 37146 :session *image* (use-service-modules sound) (use-package-modules linux) #+end_src #+begin_src scheme :scheme guile :session *other* (use-srfis '(26))=20 #+end_src #+end_example This particular test gave me two REPLS. In the =3D*image*=3D REPL, I have a= ccess to the packages and services I would need to build part of the curren= t project I am working on. The other REPL gives me access to the `cut` and= `cute` macros, and there isn't any plution between the two. Is there somet= hing else I'm missing here? --==-=-= Content-Type: text/html Content-Transfer-Encoding: quoted-printable

Ihor Radchenko <yantar92@posteo.net> writes:

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

Here is a patch that provides this functionality.

Thank you!

Subject: [PATCH] org-mode: allow ob-scheme to accept a remote connecti= on.

* lisp/org/ob-scheme.el (org-babel-scheme-get-repl): introduce two optional variables host and port. If there are not given, just run
^^^^^^^^^ arguments

* lisp/org/ob-scheme (org-babel-scheme-execute-with-geiser, org-babel-execute:scheme): take these optional arguments into account.

… and add two new optional arguments.

@@ -231,6 +235,8 @@ org-babel-execute:scheme geiser-scheme-implementation geiser-default-implementation (car geiser-active-implementations))) + (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`.
Also, please document the new header argument in the ob-scheme documentation at https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-scheme= .html (you can submit a patch against https://git.sr.ht/~bzg/worg/tree/master/item/or= g-contrib/babel/languages/ob-doc-scheme.org )

Sure thing; I can do that after I finish this message.
- (and (not (string=3D session "none")) session)))) ; session + (and (not (string=3D session "none")) session) host port))) ; ses= sion

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? I'm not familiar with= using :sessions. Here is what I tested so far:

#+begin_src scheme :scheme guile :host localhost :port 37146 :session *imag=
e*
  (use-modules (gnu)
               (guix)
               (guix gexp))
#+end_src

#+begin_src scheme :host localhost :port 37146 :session *image*
  (use-service-modules sound)
  (use-package-modules linux)
#+end_src

#+begin_src scheme :scheme guile :session *other*
  (use-srfis '(26))=20
#+end_src

This particular test gave me two REPLS. In the *image* REPL, I= have access to the packages and services I would need to build part of the= current project I am working on. The other REPL gives me access to the `c= ut` and `cute` macros, and there isn't any plution between the two. Is ther= e something else I'm missing here?

--==-=-=-- --=-=-=-- --===-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFLBAEBCAA1FiEE8JmX63p3mcKAxtRbc+osy8QJTuEFAmW33ogXHGh1bnRlci50 LmpvekBnbWFpbC5jb20ACgkQc+osy8QJTuE95wf/aocb/OY41lu4Gyu7eVKaxXMW Gsly+I/cDH19TkH5gs1CPYZJqcbrL1cGM9gu1bwVkhfO5lHEUlm/ml1OTbNRrJH/ +GwzvgzV2zUyu5+BsYQSe3UFIHyK02jDdidz5eIkEbF276v/S1K9ln7wiQaD2MeK 7JuPMx54X17UTySNF+uJCOY6RO+k/X5WveKXyZsr+qO2SbgBsL0GVJ7GOeVltjdM K9XjReoAlLfNoLH3VRUoB3GBVCHAzOO3Fe5itkSsq1aVaZqFqepomafd1d/dH4GL +BHbVA93h6KkI/FpR6EJzayS2JJwy8WNTPAQKbe59qFaezlHIIIxN8XH/2SWGw== =l8qw -----END PGP SIGNATURE----- --===-=-=--