GNU bug report logs -
#35847
org-babel clojure bug? nil prepended to all results?
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 35847 in the body.
You can then email your comments to 35847 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35847
; Package
emacs
.
(Tue, 21 May 2019 14:30:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Brian Beckman <bc.beckman <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Tue, 21 May 2019 14:30:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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
[Message part 2 (text/html, inline)]
bug reassigned from package 'emacs' to 'org-mode'.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Tue, 21 May 2019 15:11:02 GMT)
Full text and
rfc822 format available.
Reply sent
to
Bastien <bzg <at> gnu.org>
:
You have taken responsibility.
(Fri, 22 May 2020 12:15:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Brian Beckman <bc.beckman <at> gmail.com>
:
bug acknowledged by developer.
(Fri, 22 May 2020 12:15:02 GMT)
Full text and
rfc822 format available.
Message #12 received at 35847-done <at> debbugs.gnu.org (full text, mbox):
Hi Brian,
Brian Beckman <bc.beckman <at> gmail.com> 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 https://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 <at> gnu.org.
Thanks,
--
Bastien
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 20 Jun 2020 11:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 5 years and 57 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.