From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 aJ9dIriJRmN1WgAAbAwnHQ (envelope-from ) for ; Wed, 12 Oct 2022 11:32:40 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id eAx8IriJRmMT2gAA9RJhRA (envelope-from ) for ; Wed, 12 Oct 2022 11:32:40 +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 EFACC1D73E for ; Wed, 12 Oct 2022 11:32:39 +0200 (CEST) Received: from localhost ([::1]:54402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oiY6R-000111-69 for larch@yhetil.org; Wed, 12 Oct 2022 05:32:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33490) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiY3x-0000zz-9F for emacs-orgmode@gnu.org; Wed, 12 Oct 2022 05:30:05 -0400 Received: from [39.171.214.39] (port=19841 helo=Mac-mini.local) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oiY3u-0004H1-6s for emacs-orgmode@gnu.org; Wed, 12 Oct 2022 05:30:04 -0400 Received: by Mac-mini.local (Postfix, from userid 501) id 1C27B67C8161; Wed, 12 Oct 2022 17:29:52 +0800 (CST) References: <875ygtqw77.fsf@localhost> <87fsfvul02.fsf@localhost> <63460e17.050a0220.1ff7f.4bdeSMTPIN_ADDED_BROKEN@mx.google.com> <87o7uhshkn.fsf@localhost> User-agent: mu4e 1.8.9; emacs 29.0.50 From: "Christopher M. Miles" To: Ihor Radchenko Cc: numbchild@gmail.com, Chris Clark , emacs-orgmode@gnu.org Subject: Re: [PATCH] (v2) Fix void variable error `cider-buffer-ns` when specifying :backend header argument Date: Wed, 12 Oct 2022 17:29:08 +0800 In-reply-to: <87o7uhshkn.fsf@localhost> Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Host-Lookup-Failed: Reverse DNS lookup failed for 39.171.214.39 (deferred) Received-SPF: softfail client-ip=39.171.214.39; envelope-from=numbchild@gmail.com; helo=Mac-mini.local X-Spam_score_int: 58 X-Spam_score: 5.8 X-Spam_bar: +++++ X-Spam_report: (5.8 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, MSGID_MULTIPLE_AT=1, NML_ADSP_CUSTOM_MED=0.9, RCVD_IN_PBL=3.335, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665, SPOOFED_FREEMAIL_NO_RDNS=0.001 autolearn=no autolearn_force=no X-Spam_action: reject 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: , Reply-To: numbchild@gmail.com Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1665567160; h=from:from:sender:sender:reply-to: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; bh=1cAjftlHur5kNkPSO1DWiK8RAGTxhIhEkNKUbrVU/rc=; b=C+DAhdXIyWMXswX5GkxC53FPLMe8zU+8Me7g7TCVWOdK4J08aCvfdB5XCAJyhI9DJgADXj T7xt+JA7tXC267lyT0tgjPymZ/hXVjwYUIJ2FJSWl3ATiHSYzW8hlcTljs60zeRN0d3Mv2 F6zLKrgXtf0j6Atrdwv3B2JbO9++GCr8b5hTf7TE74aTn7vOQ+vFpNJGq2rYFLUaVydB17 xQxwHHVvrdmrHm8UA9TZ7V8duf2g0PuRdXmgv+3meOIIbP4bHsCNy3cHAHwAoH5mDGGKEm B+a8qcogugdL6Q0wYgZfn9E69IpVceurfqpsUQTzzIIj3oxt7cn3tH0XRxavyQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1665567160; a=rsa-sha256; cv=none; b=ahXPN28sDgQn/ddoMKPJH+0Wz8dPlmrCDk1qWa9yiofiO7UpGLr+wWtrqh0WBt3AUNb24J 9FPG0Vjz3wD7L+eMYPL5kpue9gi2a84GQSN8JYl8HoHPz9eYmoiiOXGgQ0B5Mwud4Hl49r XyWC4x+7VdFYeqRNWvvp7LB9Y98xUN34FJxiQcq3F/Cv3N/RcLqAw6KX7DhbvYVbctgwBK jPiEjl5vlr1Xf4pbXBwjzdRTWhiDdK8ApOQ+1MdxFkr2yNqGidEPaWd7qvQ70N4DbwwTmg /Tccxii4OcmYA0LxbHrpsdq+wLUqzhQzgXAr92IBpRQwAAUQEHbkg80Dq6mwMA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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-Migadu-Spam-Score: 0.90 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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-Migadu-Queue-Id: EFACC1D73E X-Spam-Score: 0.90 X-Migadu-Scanner: scn0.migadu.com X-TUID: Ng2G0kdQOc/f --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Ihor Radchenko writes: > "Christopher M. Miles" writes: > >> After updated to latest commit, I found error, >> >> Reproduce: >> >> When I specified the `:backend` header argument: >> >> #+begin_src clojure :backend babashka >> (+ 2 4) >> #+end_src >> >> I got error: >> >> #+begin_example >> void variable: cider-buffer-ns >> #+end_example > > Thanks for reporting! > >> Here is the patch fix upper issue. >> >> (let* ((vars (org-babel--get-vars params)) >> + (backend-override (cdr (assq :backend params))) >> (ns (or (cdr (assq :ns params)) >> - (if (eq org-babel-clojure-backend 'cider) >> + (if (and (not backend-override) >> + (eq org-babel-clojure-backend 'cider)) >> (or cider-buffer-ns >> (let ((repl-buf (cider-current-connection))) >> (and repl-buf (buffer-local-value > > What if backend-override is 'cider? > I suggest to let-bind > (org-babel-clojure-backend > (cond > (backend-override (intern backend-override)) > (org-babel-clojure-backend org-babel-clojure-backend) > (t (user-error "You need to customize `org-babel-clojure-backend' > or set the `:backend' header argument")))) > > Just like in `org-babel-execute:clojure'. You're right, updated now. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-lisp-ob-clojure.el-Fix-backend-override-not-work-wit.patch Content-Transfer-Encoding: quoted-printable From=201ecdcc596c8447fcf96ff400f544c0adc680c8fc Mon Sep 17 00:00:00 2001 From: stardiviner Date: Wed, 12 Oct 2022 17:27:58 +0800 Subject: [PATCH] lisp/ob-clojure.el: Fix :backend override not work with `org-babel-clojure-backend' * lisp/ob-clojure.el (org-babel-expand-body:clojure): When The source block specified header argument :backend, the global option `org-babel-clojure-backend' value is default 'cider, the `cider-buffer-ns` is not void error. =2D-- lisp/ob-clojure.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el index d6f860e98..0649469b3 100644 =2D-- a/lisp/ob-clojure.el +++ b/lisp/ob-clojure.el @@ -104,6 +104,13 @@ (defun org-babel-expand-body:clojure (body params) "Expand BODY according to PARAMS, return the expanded body." (let* ((vars (org-babel--get-vars params)) + (backend-override (cdr (assq :backend params))) + (org-babel-clojure-backend + (cond + (backend-override (intern backend-override)) + (org-babel-clojure-backend org-babel-clojure-backend) + (t (user-error "You need to customize `org-babel-clojure-backen= d' +or set the `:backend' header argument")))) (ns (or (cdr (assq :ns params)) (if (eq org-babel-clojure-backend 'cider) (or cider-buffer-ns =2D-=20 2.37.2 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable =2D-=20 [ stardiviner ] I try to make every word tell the meaning that I want to express without mi= sunderstanding. Blog: https://stardiviner.github.io/ IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAmNGiQ0ACgkQG13xyVro msO/6QgAyOFvqQMjl8EOJKdnSxV9tRRsCZFXzzSAX2QLN7SYXL9dNxAKgkCeHYoB KG65cAIcJVEV/G4lc4s5VGsyYdjYMd/SwZ+3SKHYE3StOlEkHZ1H64dF8psrsUkV XZ/yjz1AF+OZsfiDo+QntRS1/9PIOBumIFiRuDw/zYlpAtB5OzkxfOlA9Obq/hLU pSHH3EcXi/l2SxXXigyM8vFOQRdJw0kM+TsqdxzLlCzcU+cNQm26pVdW2sTlB53B CN4CA+FFXzUv3hdA65tMnrtapXv0W7DF18rzLBUnGnsIkpBIAnhSOxoIs0KSiRMA VWYOMEGsPwPYodzCtlNaU3pNxeWudQ== =sde6 -----END PGP SIGNATURE----- --==-=-=--