From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id sOcTLPryI2TDUwEASxT56A (envelope-from ) for ; Wed, 29 Mar 2023 10:12:42 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id oN/5K/ryI2S5YQEAauVa8A (envelope-from ) for ; Wed, 29 Mar 2023 10:12:42 +0200 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 2EB09101F for ; Wed, 29 Mar 2023 10:12:42 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1phQuR-0008AP-SI; Wed, 29 Mar 2023 04:11:55 -0400 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 1phQuQ-0008AH-82 for emacs-orgmode@gnu.org; Wed, 29 Mar 2023 04:11:54 -0400 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 1phQuO-0007mj-Eh for emacs-orgmode@gnu.org; Wed, 29 Mar 2023 04:11:54 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 877DA2403F3 for ; Wed, 29 Mar 2023 10:11:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1680077509; bh=oGRX0Gn/k+a1ewgqbW6p9AMnqp1iHDkwKEp2/V+2GhE=; h=Date:From:To:Cc:Subject:From; b=bGOODa8m1boUmPYWBpYdv8tFvXoCSu7YVWL+IWqXpXqgn3xw5NFL9nqSYpJdDj6HI mQtNB40SMYd1XYGflymtfVNcrDWyaVKQSRx9q6LoZr2eiyYAR/SEx7Klc1rr82ujLI XksxUJtAMKYtR9TwQpOZsnzCjj4Tp9mJSsNM7xlEDp2rbV/sNerdkVsVg1YHrOmVpJ 8tGJm16zTaGsBY0J1rvfoj38CUviMX6UI1mRzVdXRtClLicokQY7/YNSYSoMKBwDcn nQ1Okg7QBhjGr4b4MK1JExs+kwt0euNPol4Q80s1DeoBqfUjmitdZfv8EEKkm72vXN 6EtF/DcN1i5NQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PmfQs0Fm1z9rxG; Wed, 29 Mar 2023 10:11:49 +0200 (CEST) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_a59a38732ea04d9551d4925a69577e9b" Date: Wed, 29 Mar 2023 08:11:48 +0000 From: gerard.vermeulen@posteo.net To: Emacs orgmode Cc: dto@gnu.org Subject: [PATCH] In case of Sly, let org-babel-execute:lisp use Slynk instead of Swank Message-ID: <480536eb12bf49144384f4b1a85d8bdf@posteo.net> Received-SPF: pass client-ip=185.67.36.66; envelope-from=gerard.vermeulen@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: 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-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1680077562; a=rsa-sha256; cv=none; b=anNlcsN5pIZlAWVS5klp2bD0w7J9PmEIYqfmf8j+8C+Bxl2a8k8bIZ2XVlbBJ6wsdJfdo5 FljpUpBFvdtmxgkLlre9WghyGmLoPl/RnwORxFEgTXRy8BF0qEhHpDTkDXeG1vZv2fiymw F8ho7BKw4vY6TMr2zSivb2NxGGZSv+Ndz77TOxaGyLj3R5YdYpWuoiFgvdnu5ycX7RhjXa aroXZSZsuosmxYRfMTjYxxFdBuvFNvavbc2Go5TfWgCoMnBfEGVfQVb7WQWSJJHV4w7GNE QvYLOu8yxYKMc5SyKrE3RqvS3mARZDpGcwzQV/I5gSxqnSfnWKtdtYOydumXMg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=bGOODa8m; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1680077562; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=jGqHSO1FPyeSWeUGv0cbmizSbHNr2bKkbHEXsheUiVU=; b=afBO/ETm9WA5baPXMK8ccCuCfmcsXT5h6wuYiPnqQLbo7qYi6Ps5MWrfyUgB9j2nU5EqVx smHPH8mt0uW1qrSO+a6ipqLZTeBp/rVCwiWR8b8rWPsVr3KNBM50L1tMUp6ZmJb720Y/Fl 8DJLnvwCIQgsgQvKKs12G9PHztGiPM9ygdOCxx4U71RVTf8fhyJQaVCErfpBJivKhSLbC4 6LB4FjXmOXkdOXGWSlbxrW8dsFLHrtKUvKYxHwcpk3lw80QH7jbJIuR4PgVIvUbOaAzHDr 1sN5yM0FtOo1beDNf29TKYAp6b4jeBycLXK6EjjLxuuT4VvKL1q16QJdyxbLow== X-Migadu-Spam-Score: -5.24 X-Spam-Score: -5.24 X-Migadu-Queue-Id: 2EB09101F X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=bGOODa8m; dmarc=pass (policy=none) header.from=posteo.net; 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" X-TUID: bzfVADWpKi4z --=_a59a38732ea04d9551d4925a69577e9b Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Hello, The Emacs integrated development environments Slime and Sly communicate by means of similar RPC protocols with different server programs: Swank in case of Slime and Slynk in case of Sly. However, the code in org-babel-execute:lisp always expects to talk with Swank because of the hard-coded call to swank:eval-and-grab-output. After starting a Sly REPL, calls to swank:eval-and-grab-output do not talk with the Slynk server started by the Sly REPL. The attached patch "soft-codes" eval-and-grab-output to become swank:eval-and-grab-output when using Slime and slynk:eval-and-grab-output when using Sly. For more info: steps to test the patch are: 1. Open a Sly REPL with M-x sly 2. Look in the *sly-events for * ( is sbcl in my case) for slynk: prefixes 3. Type C-c C-c on the test block below 4. Look for an addition in *sly-events for * looking like (slynk:eval-and-grab-output "(let ((...)) (+ 1 1)\n)") #+name: test-ob-lisp-with-sly #+begin_src lisp -n :output results (+ 1 1) #+end_src #+RESULTS: test-ob-lisp-with-sly : 2 Best regards -- Gerard --=_a59a38732ea04d9551d4925a69577e9b Content-Transfer-Encoding: base64 Content-Type: application/octet-stream; name=0001-lisp-ob-lisp-fix-org-babel-execute-lisp-for-use-with.patch Content-Disposition: attachment; filename=0001-lisp-ob-lisp-fix-org-babel-execute-lisp-for-use-with.patch; size=4335 RnJvbSA5OTlkZWVlYmY0NzNjYzM5YjkwY2NiYWFjMDRkN2ZiMmVhNmFkNmMyIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBHZXJhcmQgVmVybWV1bGVuIDxnZXJhcmQudmVybWV1bGVuQHBv c3Rlby5uZXQ+CkRhdGU6IFdlZCwgMjkgTWFyIDIwMjMgMDk6MjE6MDggKzAyMDAKU3ViamVjdDog W1BBVENIXSBsaXNwL29iLWxpc3A6IGZpeCBgb3JnLWJhYmVsLWV4ZWN1dGU6bGlzcCcgZm9yIHVz ZSB3aXRoIFNseQoKKiBsaXNwL29iLWxpc3AgKG9yZy1iYWJlbC1leGVjdXRlOmxpc3ApOiBieSBk ZWZhdWx0LCBTbHkgYW5kIFNsaW1lCnRhbGsgd2l0aCBkaWZmZXJlbnQgUlBDIHNlcnZlciBwcm9n cmFtcyB3aXRoIGRpZmZlcmVudCBuYW1lcy4KU3BlY2lhbGl6ZSB0aGUgcHJlZml4IG9mIGV2YWwt YW5kLWdyYWItb3V0cHV0IHRvIFNsaW1lIChwcmVmaXggc3dhbms6KQpvciB0byBTbHkgKHByZWZp eCBzbHluazopLgotLS0KIGxpc3Avb2ItbGlzcC5lbCB8IDYxICsrKysrKysrKysrKysrKysrKysr KysrKysrLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KIDEgZmlsZSBjaGFuZ2VkLCAzMiBpbnNlcnRp b25zKCspLCAyOSBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9saXNwL29iLWxpc3AuZWwgYi9s aXNwL29iLWxpc3AuZWwKaW5kZXggMDNmMjNjODJkLi5jNDViZWMyMGUgMTAwNjQ0Ci0tLSBhL2xp c3Avb2ItbGlzcC5lbAorKysgYi9saXNwL29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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjZHIgKGFzc3EgOmRp ciBwYXJhbXMpKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGRlZmF1bHQtZGlyZWN0b3J5KSkpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IChmb3JtYXQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpZiBkaXIgKGZv cm1hdCBvcmctYmFiZWwtbGlzcC1kaXItZm10IGRpcikKLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIihwcm9nbiAlc1xuKSIpCi0gICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAoYnVmZmVyLXN1YnN0cmluZy1uby1wcm9wZXJ0aWVzCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgKHBvaW50LW1pbikgKHBvaW50LW1heCkpKSkpCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAoY2RyIChhc3NxIDpwYWNrYWdlIHBhcmFtcykpKSkp KSkKLSAgICAgKG9yZy1iYWJlbC1yZXN1bHQtY29uZCAoY2RyIChhc3NxIDpyZXN1bHQtcGFyYW1z IHBhcmFtcykpCi0gICAgICAgKG9yZy1zdHJpcC1xdW90ZXMgcmVzdWx0KQotICAgICAgIChjb25k aXRpb24tY2FzZSBuaWwKLSAgICAgICAgICAgKHJlYWQgKG9yZy1iYWJlbC1saXNwLXZlY3Rvci10 by1saXN0IHJlc3VsdCkpCi0gICAgICAgICAoZXJyb3IgcmVzdWx0KSkpKQotICAgKG9yZy1iYWJl bC1waWNrLW5hbWUgKGNkciAoYXNzcSA6Y29sbmFtZS1uYW1lcyBwYXJhbXMpKQotCQkJKGNkciAo YXNzcSA6Y29sbmFtZXMgcGFyYW1zKSkpCi0gICAob3JnLWJhYmVsLXBpY2stbmFtZSAoY2RyIChh c3NxIDpyb3duYW1lLW5hbWVzIHBhcmFtcykpCi0JCQkoY2RyIChhc3NxIDpyb3duYW1lcyBwYXJh bXMpKSkpKQorICAobGV0IChldmFsLWFuZC1ncmFiLW91dHB1dCkKKyAgICAocGNhc2Ugb3JnLWJh YmVsLWxpc3AtZXZhbC1mbgorICAgICAgKGBzbGltZS1ldmFsIChvcmctcmVxdWlyZS1wYWNrYWdl ICdzbGltZSAiU0xJTUUiKQorICAgICAgICAgICAgICAgICAgIChzZXRxIGV2YWwtYW5kLWdyYWIt b3V0cHV0ICdzd2FuazpldmFsLWFuZC1ncmFiLW91dHB1dCkpCisgICAgICAoYHNseS1ldmFsIChv cmctcmVxdWlyZS1wYWNrYWdlICdzbHkgIlNMWSIpCisgICAgICAgICAgICAgICAgIChzZXRxIGV2 YWwtYW5kLWdyYWItb3V0cHV0ICdzbHluazpldmFsLWFuZC1ncmFiLW91dHB1dCkpKQorICAgIChv cmctYmFiZWwtcmVhc3NlbWJsZS10YWJsZQorICAgICAobGV0ICgocmVzdWx0CisgICAgICAgICAg ICAoZnVuY2FsbCAoaWYgKG1lbWJlciAib3V0cHV0IiAoY2RyIChhc3NxIDpyZXN1bHQtcGFyYW1z IHBhcmFtcykpKQorICAgICAgICAgICAgICAgICAgICAgICAgICMnY2FyICMnY2FkcikKKyAgICAg ICAgICAgICAgICAgICAgICh3aXRoLXRlbXAtYnVmZmVyCisgICAgICAgICAgICAgICAgICAgICAg IChpbnNlcnQgKG9yZy1iYWJlbC1leHBhbmQtYm9keTpsaXNwIGJvZHkgcGFyYW1zKSkKKyAgICAg ICAgICAgICAgICAgICAgICAgKGZ1bmNhbGwgb3JnLWJhYmVsLWxpc3AtZXZhbC1mbgorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBgKCxldmFsLWFuZC1ncmFiLW91dHB1dAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICwobGV0ICgoZGlyIChpZiAoYXNzcSA6ZGlyIHBh cmFtcykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg KGNkciAoYXNzcSA6ZGlyIHBhcmFtcykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBkZWZhdWx0LWRpcmVjdG9yeSkpKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIChmb3JtYXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKGlmIGRpciAoZm9ybWF0IG9yZy1iYWJlbC1saXNwLWRpci1mbXQgZGlyKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIocHJvZ24gJXNcbikiKQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYnVmZmVyLXN1YnN0cmluZy1uby1w cm9wZXJ0aWVzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocG9pbnQt bWluKSAocG9pbnQtbWF4KSkpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNk ciAoYXNzcSA6cGFja2FnZSBwYXJhbXMpKSkpKSkpCisgICAgICAgKG9yZy1iYWJlbC1yZXN1bHQt Y29uZCAoY2RyIChhc3NxIDpyZXN1bHQtcGFyYW1zIHBhcmFtcykpCisgICAgICAgICAob3JnLXN0 cmlwLXF1b3RlcyByZXN1bHQpCisgICAgICAgICAoY29uZGl0aW9uLWNhc2UgbmlsCisgICAgICAg ICAgICAgKHJlYWQgKG9yZy1iYWJlbC1saXNwLXZlY3Rvci10by1saXN0IHJlc3VsdCkpCisgICAg ICAgICAgIChlcnJvciByZXN1bHQpKSkpCisgICAgIChvcmctYmFiZWwtcGljay1uYW1lIChjZHIg KGFzc3EgOmNvbG5hbWUtbmFtZXMgcGFyYW1zKSkKKwkJCSAgKGNkciAoYXNzcSA6Y29sbmFtZXMg cGFyYW1zKSkpCisgICAgIChvcmctYmFiZWwtcGljay1uYW1lIChjZHIgKGFzc3EgOnJvd25hbWUt bmFtZXMgcGFyYW1zKSkKKwkJCSAgKGNkciAoYXNzcSA6cm93bmFtZXMgcGFyYW1zKSkpKSkpCiAK IChkZWZ1biBvcmctYmFiZWwtbGlzcC12ZWN0b3ItdG8tbGlzdCAocmVzdWx0cykKICAgOzsgVE9E TzogYmV0dGVyIHdvdWxkIGJlIHRvIHJlcGxhY2UgIyguLi4pIHdpdGggWy4uLl0KLS0gCjIuNDAu MAoK --=_a59a38732ea04d9551d4925a69577e9b--