From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 6MfGH46DjWHIMwAAgWs5BA (envelope-from ) for ; Thu, 11 Nov 2021 21:56:46 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id UI1hG46DjWFjYQAAB5/wlQ (envelope-from ) for ; Thu, 11 Nov 2021 20:56:46 +0000 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 D64686E9F for ; Thu, 11 Nov 2021 21:56:45 +0100 (CET) Received: from localhost ([::1]:53726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mlH7k-000315-4C for larch@yhetil.org; Thu, 11 Nov 2021 15:56:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlH71-00030s-8r for emacs-orgmode@gnu.org; Thu, 11 Nov 2021 15:55:59 -0500 Received: from [2607:f8b0:4864:20::336] (port=41969 helo=mail-ot1-x336.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mlH6z-0001KO-Jr for emacs-orgmode@gnu.org; Thu, 11 Nov 2021 15:55:58 -0500 Received: by mail-ot1-x336.google.com with SMTP id o15-20020a9d410f000000b0055c942cc7a0so10711477ote.8 for ; Thu, 11 Nov 2021 12:55:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version; bh=w/O5kBJN+SvSusBvjxq+mCOaKNugrvSFt5ePNq9jC1s=; b=TrfqP6F0yEobZdK5M8RvqHwBWXoVCL1cJwGGDPnUegJpmLgwBlpwvMZ5eHHm+qygri KZ81DSR+KrtRHTPXy+drJDDEboeJCo3Ch6fWDCsdmnrB5KKRVNzq1+p7D186af45TXyX l12eL9Eaj7VIVOWOIRXtuoGfoJZSvOhR97pdtAqt+Ngk1CDjkU2gjhwoY8CEvH2lt96y svqJKb+qVH4Zfi3fSBB3WeQR4hRr68bEFYugFS3DLVcouh0zaga9B0tpu4KBkdSIyiH6 UlyrmfV9RAn5aR2o7vc98oUZH9wC1fWV0CnB9CUyqn09392mIfnhWr/IFnQ3BpTYdVgL o57w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:in-reply-to:references :user-agent:date:message-id:mime-version; bh=w/O5kBJN+SvSusBvjxq+mCOaKNugrvSFt5ePNq9jC1s=; b=7fdNF//FIR0mcNFBPlxqYU2HWR10CuNStZSF6vcKvTF9O2pJio33rom8h/RZA6P9bw fCDbXKAUrsUbAuaR21UMpt9S9QP+s6uLk6kpWPCl3DNC1JjljjtRe3UPPVzvt3Anuntf xxonJOBFzcxZJWMeD5OYHHbPOsYNBbhZZjEweDgDXND8wHND2swvpj8i0Kn2hBAzvO4/ li80VzV2JRVMfr+Xp1OuBZnDFI0qGfdL2JfSHvoISbambU61WuEPvZ2fjjjqHaXYxDwp SE2VLvx8U9MCsocBH1/BFRts8Tmnk8CYkMfqL481vhRZrZnFB+QonCMtI9UscbMvzzuF zGtw== X-Gm-Message-State: AOAM533EOnupo5YOWz6J7JFSV6xNYqH3JlEjuOKoFVcbvlNpUbO22XVE PJqCiVpUT9eLHSIJQQc5m9nk2wjq14k= X-Google-Smtp-Source: ABdhPJx4nREquAYIqHAf1Tx38ZqOlk4H2WwryeZZTqlfWXGcuLksZZW9UsUaNHLM8JUzGzmYU0F9NQ== X-Received: by 2002:a05:6830:1392:: with SMTP id d18mr8007276otq.374.1636664154774; Thu, 11 Nov 2021 12:55:54 -0800 (PST) Received: from dell2 ([2806:105e:8:6639:c9a8:f28:1704:2e77]) by smtp.gmail.com with ESMTPSA id s9sm898170otg.42.2021.11.11.12.55.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Nov 2021 12:55:54 -0800 (PST) From: Rafael To: emacs-orgmode@gnu.org Subject: Re: emacs-jupyter does not send result form babel block In-Reply-To: (John Kitchin's message of "Wed, 8 Sep 2021 09:54:40 -0400") References: <86h7f0t7mp.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Date: Thu, 11 Nov 2021 14:55:52 -0600 Message-ID: <86mtmav2cn.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::336 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::336; envelope-from=rvf0068@gmail.com; helo=mail-ot1-x336.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1636664205; 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=w/O5kBJN+SvSusBvjxq+mCOaKNugrvSFt5ePNq9jC1s=; b=nAT74cwAnxAsSmfiQSqov8u9LiPN7HDTrPEyOoWeeKAE0xyZX99OvjjKlWMnAbwFjhg6Jb 9+GygSv2+oW2UhnytPViFWfwVaLRMHgbm9ycTuN9H4wfM64LSowb1QxaufiDZKotYiwANF 57UwmJlgItU6eNCZn1jScKNTnGVJFV6irLCz5/ECzlKdP916wj7J87OJU9891fGJNdVaSx HSahDI78THe4dYDcgbtUBp+Bhaev0Ppk0hO1dG7ApNCylgnytsNbWzv0lC9QmQgdfI2B2a +W40cJEQJZR/4GM1AKVasmknqDww7fIvzz3nkcvy9HoaqR2kkNEkd81ff+FEMw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1636664205; a=rsa-sha256; cv=none; b=nWBxbMv1vNDbCbFi1lbBMiK7k9W44EnQ7Cx0qg7ipAjNgRUpRh3kD+HySF590OJRtRhEuM hnAhpChDDa8ciDumV2BFaPex1iDp9NoT1EHWEpQEK/1zqH9VB1zX8PngPJ2DUriSfjIhlL UDcMo8Z32y+y8x/P6zjseDgvSHKD/KvtTjdMxdJtMub9MYh4vJe6Z2VJeLjjAGqZH7phs+ mH3mtx7gc9p10+QQnUzd2LnSSIYzSgZN0y66d3jG3n4HRhh/70DIzsrVkF84OiRc6YvzK4 eMKxpkfQHeJSUc8/+UaelKWjW+xYd85bPnVFeh4h5d9xRRtZz6K4gX4M+sOfqQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=TrfqP6F0; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -4.03 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=TrfqP6F0; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: D64686E9F X-Spam-Score: -4.03 X-Migadu-Scanner: scn1.migadu.com X-TUID: r7RhYwYBp6dX John Kitchin writes: >> On Sat, Sep 4, 2021 at 4:22 PM Rafael wrote: >> >>> >>> I am using emacs-jupyter (https://github.com/nnicandro/emacs-jupyter), >>> and I have just noticed that results from a block are not sent to >>> another block. I think it has to do with this issue >>> https://github.com/nnicandro/emacs-jupyter/issues/222. Can somebody >>> suggest a workaround? (I actually want to use the output from a kernel >>> different from python, but since the problem happens also with the python >>> kernel I'm using it as an example). >>> >>> #+name: atest >>> #+begin_src jupyter-python :session test >>> 1+1 >>> #+end_src >>> >>> #+RESULTS: graphst >>> : 2 >>> >>> #+begin_src python :var adjs=atest >>> adjs >>> #+end_src >>> >>> #+RESULTS >> : nil >> >> > > I think this is a bug in jupyter-org-client.el in this function: > > (defun jupyter-org--add-result (req result) > (cond > ((jupyter-org-request-silent-p req) > (unless (equal (jupyter-org-request-silent-p req) "none") > (message "%s" (org-element-interpret-data result)))) > ((jupyter-org-request-async-p req) > (jupyter-org--clear-request-id req) > (jupyter-org--do-insert-result req result)) > (t > (push result (jupyter-org-request-results req))))) > > The problem is that when the jupyter block is executed to define the > variable in the python header, it is run with a "silent" results param. The > function above is responsible for adding the results to the > jupyter-org-request struct, and here when it sees the results are silent, > it does not do that, so the results are nil, which is why you see what you > see. > > I don't think that behavior is correct. It isn't quite right to just remove > the first block though, at least in this case. The result in this function > is already structured as a fixed-width results element intended to be > interpreted as a results string, and not the numeric value returned. So the > fix is probably upstream from this. > > I am not sure what the fix is for this. The code path from C-cC-c to > executing the code, handling the request to the kernel, getting results and > to the output is very hard to follow for me. I would post an issue at > https://github.com/nnicandro/emacs-jupyter/issues. Thanks for your answer and sorry for not following up. There is already an issue about this which has been open since March 2020, see https://github.com/nnicandro/emacs-jupyter/issues/222.