From debbugs-submit-bounces@debbugs.gnu.org Tue May 21 10:29:43 2019 Received: (at submit) by debbugs.gnu.org; 21 May 2019 14:29:43 +0000 Received: from localhost ([127.0.0.1]:40481 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hT5lu-0005Lc-TA for submit@debbugs.gnu.org; Tue, 21 May 2019 10:29:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41348) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hT4fL-00034f-CL for submit@debbugs.gnu.org; Tue, 21 May 2019 09:18:51 -0400 Received: from lists.gnu.org ([209.51.188.17]:44383) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hT4fG-0003qT-9L for submit@debbugs.gnu.org; Tue, 21 May 2019 09:18:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT4fE-000239-F3 for bug-gnu-emacs@gnu.org; Tue, 21 May 2019 09:18:46 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hT4fD-0003l5-2x for bug-gnu-emacs@gnu.org; Tue, 21 May 2019 09:18:44 -0400 Received: from mail-ua1-x934.google.com ([2607:f8b0:4864:20::934]:35174) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hT4fC-0003iv-Q6 for bug-gnu-emacs@gnu.org; Tue, 21 May 2019 09:18:43 -0400 Received: by mail-ua1-x934.google.com with SMTP id r7so6604205ual.2 for ; Tue, 21 May 2019 06:18:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=twdFPReOgK6AtQt0rk/BUEjVo0A7xeK0D9JO3WFrA/0=; b=SrG0ZQrCAKgznhkxApdKnWT/7th+gSNJGpuzWUhpzgFrWrz8FDLQx3mnD506bIRB/J wpr5F/AMW73kUha4vdNbkQ1UFmDSBc9p/YyK40ZMAeDexfdQzLxMZ2BZvNujqKg5H5Id XuFosfqcQYz8sXHOGNIJCfbej7FcXr7QzQ/Rs7u7AAC86VvrI3v5TYFFJV63dQqp+Fae oX7EVOuVnnIzloM6KAAZ7niee8SY4Mw63CIJp1GLt+j8w0yFJbbICpxPKhcP93hTgZyd trHObQnI/uAxoYhVH9wT6q8HM2aJCWXNtos0+PIrcwPDUvDYCkdoRkNZFbkFiiA6aaYP bILg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=twdFPReOgK6AtQt0rk/BUEjVo0A7xeK0D9JO3WFrA/0=; b=Irs9kaUkv4lZ8y45Fa8wzo1zUfFn0XefgRd/sHEaR0NO6ze7E1PqSbyLvz2KxVoOD/ 493QamDiQzfuKRBfGW0vO7gIuW0sfP/+J4hlW3F47bjvexWoGho23Uwi5KNsN4yAkRdV WHMo6L8xuL4AX1N6bQoyQeUYhj8RdQSRXd0lAXnGkGceC81rANMUwg9XO7dKe/hVcc3S +jvkcUQX+/NLvblJ74UJcmO1XN0VexyV0wi6sn0uR+2pNpsWzNqgVBjWNS7a2es2hUD9 8lhhKEWNDvpVeliKOey4jKUUYGTCImbuiHwPRteXGyAsgMnDlmIBHC12j9mBnhtz0FVX CqcA== X-Gm-Message-State: APjAAAUb7PTStGA2yYkszssCQiH20nowz994I2+CmsmSBxchGrBXxT8J fUZ+6emLwD4Fo0XSPlVRwciAe2h2+p0nm3HNeTe3nNZKcz0= X-Google-Smtp-Source: APXvYqwL9CPuIB6gKRbV4Ob8nQ9RoLB2jrgyZdh5FXuXgLYorSAuXML+5YCysndR6pz1G5ssy3ABYJvf+URN5oxvda4= X-Received: by 2002:a9f:3731:: with SMTP id z46mr10290424uad.16.1558444721128; Tue, 21 May 2019 06:18:41 -0700 (PDT) MIME-Version: 1.0 From: Brian Beckman Date: Tue, 21 May 2019 06:18:28 -0700 Message-ID: Subject: org-babel clojure bug? nil prepended to all results? To: bug-gnu-emacs@gnu.org, Brian Beckman Content-Type: multipart/alternative; boundary="000000000000014981058965b062" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::934 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 21 May 2019 10:29:41 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --000000000000014981058965b062 Content-Type: text/plain; charset="UTF-8" I originally submitted this to the nrepl / cider group in github because my workaround entailed a (most likely bogus) change to nrepl, but they closed it and told me to submit it here. My original submission is copied below. The response of the nrepl maintainer can be found at https://github.com/nrepl/nrepl/issues/146 ## Expected behavior in org-babel, I expect the following ``` #+begin_src clojure (* 6 (+ 6 2)) #+end_src #+RESULTS: : 48 ``` ## Actual behavior ``` #+begin_src clojure (* 6 (+ 6 2)) #+end_src #+RESULTS: : nil48 ``` ## Steps to reproduce the problem Make sure your emacs init.el (or other startup fixture like .spacemacs) has org-babel support for Cider and Clojure, as with the following ``` (require 'ob-clojure) (org-babel-do-load-languages 'org-babel-load-languages '( (C . t) (awk . t) (clojure . t) )) ``` Make a lein new app foo so that you have a project.clj file. Create any old .org file in the foo project directory. Put the code snippet above in the .org file. Do M-x cider-jack-in with the cursor in that code block. Do C-c C-c with cursor in the code block to evaluate the code block. See the prepended "nil?" It's the same with every other code block. Every result gets a prepended "nil." ## my workaround I changed `elpa/cider-20190321.2129/nrepl-dict.el::nrepl--merge` as follows to get my stuff to work. No idea whether this is a robust or worthwhile change. ``` (defun nrepl--merge (dict1 dict2 &optional no-join) "Join nREPL dicts DICT1 and DICT2 in a meaningful way. String values for non \"id\" and \"session\" keys are concatenated. Lists are appended. nREPL dicts merged recursively. All other objects are accumulated into a list. DICT1 is modified destructively and then returned. If NO-JOIN is given, return the first non nil dict." (if no-join (or dict1 dict2) (cond ((null dict1) dict2) ((null dict2) dict1) ((stringp dict1) (concat dict1 dict2)) ((nrepl-dict-p dict1) (nrepl-dict-map (lambda (k2 v2) (nrepl-dict-put dict1 k2 (nrepl--merge (nrepl-dict-get dict1 k2) ;; bbeckman bug? CHANGED RIGHT HERE ***** (if (and (string= k2 "value") (stringp v2) (string= v2 "nil")) "" v2) (member k2 '("id" "session"))))) dict2) dict1) ((and (listp dict2) (listp dict1)) (append dict1 dict2)) ((listp dict1) (append dict1 (list dict2))) (t `(,dict1 ,dict2))))) ``` ## Environment & Version information ``` : Emacs version: GNU Emacs 26.2 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.4) : of 2019-04-12 : org version: 9.2.2 ``` ### Clojure version 1.10.0 ### Java version openjdk version "11.0.3" 2019-04-16 OpenJDK Runtime Environment (build 11.0.3+7-Ubuntu-1ubuntu218.10.1) OpenJDK 64-Bit Server VM (build 11.0.3+7-Ubuntu-1ubuntu218.10.1, mixed mode, sharing) ### Operating system Ubuntu 18.04 --000000000000014981058965b062 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I originally submitted this to the nrepl / cider group in gith= ub because my workaround entailed a (most likely bogus) change to nrepl, bu= t they closed it and told me to submit it here. My original submission is c= opied below. The response of the nrepl maintainer can be found at=C2=A0https://github.com/nrepl/nrepl/issues/146
=

=
## Expected behavior

in org-babel, I expect the following
```#+begin_src clojure
(* 6 (+ 6 2))
#+end_src

#+RESULTS:
: = 48
```
## Actual behavior
```
#+begin_src clojure
(* 6 (+ 6 = 2))
#+end_src

#+RESULTS:
: nil48

```
## Steps to rep= roduce the problem

Make sure your emacs init.el (or other startup fi= xture like .spacemacs) has org-babel support for Cider and Clojure, as with= the following

```
=C2=A0 (require 'ob-clojure)
=C2=A0 (or= g-babel-do-load-languages
=C2=A0 =C2=A0'org-babel-load-languages
= =C2=A0 =C2=A0'(
=C2=A0 =C2=A0 =C2=A0(C =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 . t)
=C2=A0 =C2=A0 =C2=A0(awk =C2=A0 =C2=A0 =C2=A0 =C2=A0 . t)=C2=A0 =C2=A0 =C2=A0(clojure =C2=A0 =C2=A0 . t) ))
```
Make a lein n= ew app foo so that you have a project.clj file.
Create any old .org fil= e in the foo project directory.
Put the code snippet above in the .org = file.
Do M-x cider-jack-in with the cursor in that code block.
Do C-= c C-c with cursor in the code block to evaluate the code block.
See the = prepended "nil?" It's the same with every other code block. E= very result gets a prepended "nil."

## my workaround
I changed `elpa/cider-20190321.2129/nrepl-dict.el::nrepl--merge` as follo= ws to get my stuff to work. No idea whether this is a robust or worthwhile = change.

```
(defun nrepl--merge (dict1 dict2 &optional no-joi= n)
=C2=A0 "Join nREPL dicts DICT1 and DICT2 in a meaningful way.String values for non \"id\" and \"session\" keys are = concatenated. Lists
are appended. nREPL dicts merged recursively. All ot= her objects are
accumulated into a list. DICT1 is modified destructively= and
then returned.
If NO-JOIN is given, return the first non nil dic= t."
=C2=A0 (if no-join
=C2=A0 =C2=A0 =C2=A0 (or dict1 dict2)
= =C2=A0 =C2=A0 (cond ((null dict1) dict2)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 ((null dict2) dict1)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((stringp di= ct1) (concat dict1 dict2))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((nr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0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(string=3D v2 "nil")= )
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 "" v2)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (member k2 '("= ;id" "session")))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 dict2)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dict1)
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((and (listp dict2) (listp dict1)) (append dict= 1 dict2))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((listp dict1) (append dict= 1 (list dict2)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (t `(,dict1 ,dict2))= )))

```

## Environment & Version information

```: Emacs version: GNU Emacs 26.2 (build 2, x86_64-pc-linux-gnu, GTK+ Versi= on 3.24.4)
: =C2=A0of 2019-04-12
: org version: 9.2.2

```
#= ## Clojure version
1.10.0

### Java version

openjdk version= "11.0.3" 2019-04-16
OpenJDK Runtime Environment (build 11.0.3= +7-Ubuntu-1ubuntu218.10.1)
OpenJDK 64-Bit Server VM (build 11.0.3+7-Ubun= tu-1ubuntu218.10.1, mixed mode, sharing)
=C2=A0
### Operating system<= br>
Ubuntu 18.04
--000000000000014981058965b062-- From debbugs-submit-bounces@debbugs.gnu.org Tue May 21 11:10:44 2019 Received: (at control) by debbugs.gnu.org; 21 May 2019 15:10:44 +0000 Received: from localhost ([127.0.0.1]:40574 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hT6Pc-0006SH-0K for submit@debbugs.gnu.org; Tue, 21 May 2019 11:10:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38487) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hT6Pa-0006S6-Q6 for control@debbugs.gnu.org; Tue, 21 May 2019 11:10:43 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47437) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT6PV-0003lo-8a for control@debbugs.gnu.org; Tue, 21 May 2019 11:10:37 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1hT6PT-0006ev-8J for control@debbugs.gnu.org; Tue, 21 May 2019 11:10:36 -0400 Subject: control message for bug 35847 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Tue, 21 May 2019 11:10:35 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) reassign 35847 org-mode From debbugs-submit-bounces@debbugs.gnu.org Fri May 22 08:14:55 2020 Received: (at 35847-done) by debbugs.gnu.org; 22 May 2020 12:14:55 +0000 Received: from localhost ([127.0.0.1]:58264 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jc6Zj-0006F5-7B for submit@debbugs.gnu.org; Fri, 22 May 2020 08:14:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:32834) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jc6Zh-0006Ev-Fk for 35847-done@debbugs.gnu.org; Fri, 22 May 2020 08:14:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46752) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jc6Zc-0000JE-85; Fri, 22 May 2020 08:14:48 -0400 Received: from [2a01:e35:2fe1:f780:f435:78db:3945:8914] (port=60966 helo=guerry) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1jc6Zb-0008Vt-S7; Fri, 22 May 2020 08:14:48 -0400 Received: by guerry (Postfix, from userid 1000) id 9FFF11A603E5; Fri, 22 May 2020 14:14:46 +0200 (CEST) From: Bastien To: Brian Beckman Subject: Re: bug#35847: org-babel clojure bug? nil prepended to all results? Organization: GNU References: Date: Fri, 22 May 2020 14:14:46 +0200 In-Reply-To: (Brian Beckman's message of "Tue, 21 May 2019 06:18:28 -0700") Message-ID: <87h7w8go95.fsf@bzg.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 35847-done Cc: 35847-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Brian, Brian Beckman writes: > I originally submitted this to the nrepl / cider group in github > because my workaround entailed a (most likely bogus) change to nrepl, > but they closed it and told me to submit it here. My original > submission is copied below. The response of the nrepl maintainer can > be found at=C2=A0https://github.com/nrepl/nrepl/issues/146 ob-clojure.el has been going through a major rewrite since last year, and I cannot reproduce this issue. I am closing this report now. If you still see the issue, please report it to emacs-orgmode@gnu.org. Thanks, --=20 Bastien From unknown Sat Aug 16 23:43:40 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 20 Jun 2020 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator