Skip to main content
Share Your Experience: Take the 2024 Developer Survey
10 votes
Accepted

Clojure code evaluation in org-mode produces no output

I'm seeing he same issue. In a little digging, I think I've identified the problem. However, not sure who this should be reported to. The problem is in the org-babel-execute:clojure function. This ...
Tim X's user avatar
  • 567
8 votes

cider-jack-in: Symbol's function definition is void: clojure-project-dir with closure-mode installed

In my case it was using a few old packages. The easiest way was to just upgrade all the packages. I was using the default download from the book Clojure for the Brave and True. Steps (within Emacs): ...
georger's user avatar
  • 181
7 votes

Deep eager macroexpansion

(require <foo>) is treated specially when it's at top-level (it causes the compiler to require the file also, rather than only do the require at run-time). If the require is not performed at ...
Stefan's user avatar
  • 26.5k
5 votes
Accepted

How can I quickly switch between source namespace and test namespace?

Projectile provides a projectile-toggle-between-implementation-and-test function with exactly this behavior. As stated in the docs, you can use C-c p t to "Toggle between an implementation file and ...
Sam Estep's user avatar
  • 459
5 votes

cider-jack-in: Symbol's function definition is void: clojure-project-dir with closure-mode installed

For anyone who is still stumbling onto this error, I just managed to fix mine. The problem arises when trying to update the packages that are found in the emacs configuration for the Clojure for the ...
maxorcist's user avatar
  • 173
5 votes
Accepted

Datomic for emacs/elisp

Considering that Datomic is a commercial-grade database system with a Datalog query language, good scalability and time traveling capabilities, this is rather unlikely. I'm only aware of two database ...
wasamasa's user avatar
  • 22.2k
4 votes
Accepted

Evaluating `org-babel-clojure` blocks returns nill & result

#+begin_src clojure :results pp (+ 1 4) #+end_src #+RESULTS: : 5 #+begin_src clojure :results output (print "Hello World!") #+end_src #+RESULTS: : Hello World! So we have to specify the output.
slk500's user avatar
  • 471
4 votes
Accepted

Deep eager macroexpansion

@Stefan explained why you see what you see: Your require statement is not at top level of the file. A solution to the byte-compiler not evaluating your (non top-level) require statement is to force ...
Drew's user avatar
  • 77.9k
3 votes
Accepted

Custom indentation for clojure macros in *.clj files

CIDER offers that functionality. Instead of using an extra declaration form, one puts the indentation info into the function's metadata: (defmacro comment "Ignores body, yields nil" {:style/...
wasamasa's user avatar
  • 22.2k
3 votes

How can I quickly switch between source namespace and test namespace?

Outside of Cider, there is toggle-test, which can switch between source and test buffers in a language agnostic way.
Wilfred Hughes's user avatar
3 votes
Accepted

cider-jack-in: Symbol's function definition is void: clojure-project-dir

Do you have clojure mode installed? Try M-x install-package clojure-mode if not and then run cider-jack-in.
Chakkakuru's user avatar
2 votes

Running all tests in a leiningen project?

there is an option to run all the tests in all the projects namespaces M-x cider-test-run-project-tests or C-c C-t C-p Here is the link to additional options for running tests http://cider....
Chakkakuru's user avatar
2 votes

er/expand-region not working as previously under Emacs 25.1

I think this is related to some breaking changes in Emacs 25.0.* https://github.com/magnars/expand-region.el/issues/160 I'm still running 25.0.* and solved the problem by installing expand-region ...
Jacob's user avatar
  • 121
2 votes

Can't type unbalanced closing curly brace in Clojure mode

The problem only occurs after you've turned paredit on and off: this is because clojure-mode adds a hook to paredit-mode, and that hook adds some paredit-mode keybindings to the clojure-mode map. In ...
Tyler's user avatar
  • 22.4k
2 votes

When using `lisp-state`, how can we repeat an action like slurp, and bind a key to easily perform the repeat?

In Vim, the . key repeats the last change made in normal mode. The slurping scenario you describe is some random function that is beyond evil. Your guess is as good as mine in regards to how that ...
Lorem Ipsum's user avatar
  • 4,517
2 votes
Accepted

Show @ symbol in different color in clojure mode

Based on the examples in section Customizing Search-Based Fontification of the elisp manual, I would propose this: (add-hook 'clojure-mode-hook (lambda () (font-lock-add-keywords nil ...
JeanPierre's user avatar
  • 7,475
2 votes
Accepted

Key binding to run Clojure code in running cider REPL and specified namespace

As I understand it, you basically want to run a command in the REPL. That is, I think you're saying you want to press C-M-S-g and have it execute (go) in the REPL. Emacs interacts with processes ...
Lorem Ipsum's user avatar
  • 4,517
1 vote

Issue when expanding clojure source blocks

I got what I wanted to work by changing the text expand function to (defun org-babel-expand-body:text (body params) (replace-regexp-in-string (regexp-quote "\n") "\\n" (org-trim ...
JMurp's user avatar
  • 11
1 vote

Clojure nrepl: 'cider-jack-in returns error: "Spawning child process: Invalid argument"

Try M-x cider-connect if you've already started a REPL via leiningen yourself. cider-jack-in tries to start a repl-server and connect to it. For some reason, this fails, maybe because of the already ...
schaueho's user avatar
  • 141
1 vote
Accepted

Prelude: How to add smartparens key bindings to C-c prefix?

Sounds like you want to define a new prefix key, say C-c z, for cider-mode, binding it to a smart-parens keymap. Assuming that smart-parens-mode-map is that keymap, and assuming that cider-mode-map ...
Drew's user avatar
  • 77.9k
1 vote

CIDER, how to fix "No cljs REPLs in current session" error

There is a detailed comparison of the different cljs repls to date in lambdaisland Borrowing from this rich and reputable source here is the bits of code you need to have configured for running ...
manandearth's user avatar
  • 2,128
1 vote

Can't type unbalanced closing curly brace in Clojure mode

You can insert unbalanced parentheses with C-q (quoted-insert). If you really don't want Clojure Mode to bind { and } to ParEdit keys, here is a work-around: (add-hook 'clojure-mode-hook (...
xuchunyang's user avatar
  • 14.6k
1 vote

How to use clojure-lsp in Emacs?

There are now instructions for configuration with emacs lsp-mode. The following is taken from what's currently there. You will need to start by putting the clojure-lsp executable on your path. (...
ProjectFrank's user avatar
1 vote

How to use clojure-lsp in Emacs?

It turns out that lsp-mode is currently being reworked. That means that the syntax for registering servers works different now: (lsp-register-client (make-lsp-client :new-connection (lsp-stdio-...
Arne's user avatar
  • 409
1 vote

Evaluating `org-babel-clojure` blocks returns all form evaluations

To get the result of the last sexp in a block use the following argument in the header: :results value pp. To evaluate using cider withing the code block, bind cider-eval-last-sexp within org in ...
manandearth's user avatar
  • 2,128
1 vote
Accepted

How do I add the following key bindings to my Emacs startup script?

Use global-set-key to create or change a global key binding. Use define-key to create or change a local (mode-specific) key binding, that is, a binding in a particular keymap. Use the Emacs manual to ...
Drew's user avatar
  • 77.9k
1 vote

cider-jack-in: Symbol's function definition is void: clojure-project-dir with closure-mode installed

Working with old .emacs.d stuff is too tiring. I've started working with Prelude. It is developed by the maintainer of CIDER and clojure-mode.
Chip's user avatar
  • 51
1 vote
Accepted

How to generate inline plot result for ob-clojure?

By pass in target directory as path into Clojure code, and use java.io.File.renameTo to move generate plot image file to target dir. Here is the complete story background: https://stardiviner.github....
stardiviner's user avatar
  • 1,938
1 vote

popup package not found when installing ac-cider package

It seems that your package archive metadata is corrupted. Try renaming your .emacs.d temporally and re-run with your init.el. mv ~/.emacs.d ~/.emacs.d-tmp; emacs -Q -l path/to/init.el I can setup ...
lurdan's user avatar
  • 1,071
1 vote

er/expand-region not working as previously under Emacs 25.1

The latest official Emacs release is 24.5, and the developer of expand-region is not supporting development versions (i.e., 25+). This is not unreasonable, as there are frequent changes in the Emacs ...
Tyler's user avatar
  • 22.4k

Only top scored, non community-wiki answers of a minimum length are eligible