Questions tagged [clojure]
Clojure is a modern Lisp dialect for the Java Virtual Machine (with versions for the CLR and JavaScript).
52 questions
0
votes
0
answers
52
views
How to run cider-test-run-project-tests using deps.edn
I can run cider-test-run-project-tests just fine for leiningen projects, but when I try to run it for deps.edn projects, it says No assertions (or no tests) were run.
I have a minimal deps.edn setup, ...
0
votes
1
answer
49
views
Clojure mismatch completion behaviour
Current behavior:
Mismatch of completions. I want to have a completion similar to the REPL in the buffer. Not intentional; I want them to match (following the cider-repl completion behaviour).
My ...
1
vote
1
answer
67
views
Get current namespace with elisp
I'm trying to build a fn that generates a mock from a schema.
Once connected to the REPL in a Clojure project, I want to be able to generate a mock from a Plumatic schema. I'm using a lib that does ...
0
votes
1
answer
198
views
Configuring Clojure Mode to use Parinfer layer in Spacemacs
I am an experienced Clojure developer making the transition to using Spacemacs. I would like to use parinfer in my setup to manipulate my Clojure code structure, but I am struggling to get the ...
0
votes
1
answer
183
views
Couldn't run single clojure test instead getting warning "cider no test at point"
I'm using emacs as clojure development environment. My emacs config is here
I'm trying to run single test in my clojure project.
I've test file called core-test in the folder test/getting-started/core-...
0
votes
1
answer
51
views
How to fix the installation of package clj-refactor?
I am using Emacs on a macOS Monterey 12.5 (M1 hardware). This is my config file.
I am trying to install a package called clj-refactor for Clojure development.
Following the instructions on the ...
0
votes
1
answer
42
views
Issue when expanding clojure source blocks
I have defined expand and execute functions for 'text' source blocks as follows:
(defun org-babel-expand-body:text (body params)
(org-trim body))
(defun org-babel-execute:text (body params)
(org-...
0
votes
1
answer
453
views
Unable to import project with lsp/lsp-mode, persistent completing-read popup message
I recently had to redo my development setup, I'm using Clojure and clojure-lsp as lsp server, and every time I open a project file I get the message `"x" file is not part of any project"...
0
votes
1
answer
76
views
M-x cider-jack-in keeps starting server forever, but not really starting. How to integrate Emacs development to this Clojure project?
I am new to Clojure and I am using one of Eirc Normad's course to learn.
After following the instructions, I do a git clone of:
git clone https://github.com/lispcast/introduction-to-clojure.git
...
2
votes
2
answers
562
views
Key binding to run Clojure code in running cider REPL and specified namespace
I have cider working just fine in Emacs with my Clojure code. I am following a tutorial that uses Cursive as the IDE; in the tutorial they were able to define a key binding to a line of code in a ...
0
votes
1
answer
64
views
Trying to auto load these packages in Clojure files, they worked the first time but don't work anymore
I have the following function to auto start raindow-delimters and paredit
(defun my-lisp-hook ()
(enable-paredit-mode 1)
(rainbow-delimiters-mode 1))
(add-hook 'clojure-mode-hook 'my-lisp-hook)
...
0
votes
1
answer
229
views
parinfer-rust-mode doesn't get enabled automatically with clojure-mode via hook
The problem: upon opening a .clj file, the clojure-mode correctly starts. However, parinfer-rust-mode doesn't, despite being added to a clojure-mode-hook.
The setup (everything related to clojure from ...
2
votes
1
answer
140
views
hide-show display multiple lines while collapsed
Is it possible to have hide-show folding display multiple lines (probably 3) in the folded version? This would get us practically to having a codox-like view right inside a buffer.
What I'm trying to ...
0
votes
0
answers
62
views
lsp-clojure starts 3 times
lsp-clojure is executed 3 times when I start emacs so it ends up using about 2.5G of memory.
$ ps aux | fgrep java
benwiz 7920 82.8 8.7 6107672 1068712 ? Ssl 08:11 1:18 java -Xmx2g -...
0
votes
1
answer
144
views
Clojure nrepl: 'cider-jack-in returns error: "Spawning child process: Invalid argument"
Running GNUEmacs 26.3 on Windows 10, trying to set up environment per instructions for 'Clojure for the Brave and True' from here:
https://github.com/flyingmachine/emacs-for-clojure/
I was able to ...
1
vote
0
answers
32
views
CIDER inspector unable to refresh a modified atom
With the CIDER inspector I'm able to view the contents of an atom. I can do C-u C-u C-c M-i and input the atom with an @ prefix and the value displays correctly. Now, if I keep the inspector window ...
1
vote
0
answers
65
views
Conditional CIDER breakpoint not working in recursive functions
I'm using CIDER for Clojure programming. I've been playing around with the CIDER debugger lately. I wanted to use the conditional breakpoint facility with some simple recursive function, such as ...
1
vote
1
answer
196
views
Evaluating `org-babel-clojure` blocks returns nill & result
Why the results is 'nil5'? Can't be just 5?
#+begin_src clojure :results
(+ 1 4)
#+end_src
#+RESULTS:
: nil5
Also:
#+begin_src clojure
(print "Hello World!")
#+end_src
#+RESULTS:
: nilnil
I was ...
2
votes
1
answer
46
views
Show @ symbol in different color in clojure mode
I want to show @ symbols (meaning dereference) in red in clojure-mode. How do I do that?
2
votes
1
answer
236
views
Prelude: How to add smartparens key bindings to C-c prefix?
I am using Emacs with Prelude. When I hit C-c prefix in a clojure buffer, I would like to show a smartparens key bindings. Like in screenshot below I would like to to add entry for smartparens key ...
3
votes
0
answers
125
views
Speedbar tag hierarchy in Clojure - organize manually with comments?
If I run speedbar and call (speedbar-add-supported-extension ".clj") in init.el, then I see my Clojure files in the speedbar, and I can expand them to show the function definitions inside, like this:
...
1
vote
2
answers
2k
views
M-x cider-jack-in, nrepl won't start
I am completely new to Emacs so apologies if this is a stupid question. I am following the Emacs configuration as outlined in Clojure for the Brave and True. Unfortunately, when trying to start the ...
5
votes
1
answer
1k
views
CIDER, how to fix "No cljs REPLs in current session" error
I'm editing a ClojureScript file, and I have a working ClojureScript REPL in another buffer. But when I try to evaluate a form in my file ui.cljs, with C-c C-c, I get a beep an a message in the mini-...
3
votes
1
answer
321
views
When using `lisp-state`, how can we repeat an action like slurp, and bind a key to easily perform the repeat?
In vim, I frequently used the "." shortcut for repeating the last command. I found this extremely useful especially when working with clojure tools to do things like slurp-ing and barf-ing to refactor ...
2
votes
2
answers
647
views
Can't type unbalanced closing curly brace in Clojure mode
When I open a Clojure file, and I'm not using Paredit, I expect to be able to type unbalanced parentheses and brackets. I can type any of these characters: ()[]{, balanced on not. But if I try to type ...
2
votes
2
answers
1k
views
How to use clojure-lsp in Emacs?
I downloaded clojure-lsp (https://github.com/snoe/clojure-lsp) and tried to add it as a client in my init.el:
(use-package lsp-mode
:ensure t)
(use-package lsp-ui
:ensure t
:config
...
2
votes
0
answers
294
views
How to make Lisp state a default instead of normal?
I'm learning Clojure and Emacs at the same time 🤕 I use Spacemacs with Evil.
Recently I've learned about Lisp state and I find it very handy. The only problem is that whenever I switch to insert ...
2
votes
1
answer
112
views
Halting Clojure debugger after pressing the Continue Command
I use Emacs with Cider to debug Clojure Code. After setting a breakpoint using the default debugging framework, there appears the list of debugging options one might execute shown in this Figure
I ...
1
vote
1
answer
327
views
Datomic for emacs/elisp
Does emacs/elisp have something equivalent or similar to Clojure's datomic?
What I tried: google emacs datomic
fyi by datomic I'm referring to this: https://en.wikipedia.org/wiki/Datomic
3
votes
1
answer
266
views
Evaluating `org-babel-clojure` blocks returns all form evaluations
I'm trying to set up babel for use with Clojure according to http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-clojure.html#org85bc1ec and I can evaluate code but when I evaluate a block with ...
1
vote
1
answer
213
views
How do I add the following key bindings to my Emacs startup script?
I'm learning Clojure.
Every day, I open up Emacs and key in the following commands:
C-x 3 ; create a new window on the right
M-x cider-jack-in ; open up a REPL
C-x o ; switch to my left window
C-x ...
4
votes
7
answers
3k
views
cider-jack-in: Symbol's function definition is void: clojure-project-dir with closure-mode installed
M-x (cider-jack-in)
cider-jack-in: Symbol's function definition is void: clojure-project-dir
lein run
"Hello World!"
cat ~/.lein/profiles.clj
{:user {:plugins [[cider/cider-nrepl "0.14.0"]...
12
votes
4
answers
2k
views
Clojure code evaluation in org-mode produces no output
I am trying to run clojure code from my org file in order to do some literate programming.
What is not working:
When I execute the source code block I get No output produced.
Sample src code block
...
4
votes
1
answer
703
views
How to generate inline plot result for ob-clojure?
Question: How to generate inline plot image result in Org-mode babel clojure src block?
I tried some ways:
First way: use :results file :file "clojure-babel-figure-result.png"
#+BEGIN_SRC clojure :...
4
votes
2
answers
384
views
Deep eager macroexpansion
This works:
(require 'clojure-mode)
(when (member 'clojure-mode my-packages)
(define-clojure-indent
(-> 1)
(->> 1)))
This gives the error Wrong type argument: listp, 1:
(when (...
2
votes
0
answers
775
views
Show all library functions in autocomplete with Cider
When I have imported the reagent.core library as reagent and I type (reagent/ I want to see all possible functions from that library I can use, preferably with documentation. Unfortunately I get only ...
1
vote
1
answer
481
views
popup package not found when installing ac-cider package
When I try to install ac-cider via package-install or via init.el I get the message http://melpa-stable.milkbox.net/packages/popup-20160531.425.el: Not Found:
This is the code in my init.el:
(require ...
4
votes
1
answer
532
views
Custom indentation for clojure macros in *.clj files
I'd like to know if there is a way to define the indentation for a custom macro within the clojure source file. It is possible to define the indentation using clojure-mode, but as far as I can tell, ...
1
vote
2
answers
499
views
er/expand-region not working as previously under Emacs 25.1
I've got er/expand-region behaving very strangely and I don't understand what I did wrong (besides upgrading to Emacs 25.1.50).
If I've got this in an elisp file:
(defun foo (p) (* 2 2) p)
(that ...
5
votes
1
answer
1k
views
cider-jack-in: Symbol's function definition is void: clojure-project-dir
When I run cider-jack-in the following error appears. Symbol's function definition is void: clojure-project-dir I am very new to Emacs and this is totally stumping me. Let me know if you need more ...
7
votes
2
answers
1k
views
How can I quickly switch between source namespace and test namespace?
In Cider, I can use C-c , to run the tests for the current namespace. This will work whether I'm currently in the source namespace or the test namespace itself (and indeed, this magic behavior is ...
0
votes
1
answer
192
views
Is there an eval-defun alternative for Clojure mode?
When I define a function in Emacs Lisp mode, you can evaluate it with moving the pointer to the
last parenthese of a function, and do C-xC-e. Aka calling eval-last-sexp.
I thought this is somewhat a ...
5
votes
0
answers
2k
views
How can I properly reload my code from the REPL?
I have a src/example/foo.clj file:
(ns example.foo)
(defn my-fn []
(println "Hello, world!"))
I can open it in Emacs and spin up a REPL using C-c M-j and play with it. I don't want to type long ...
2
votes
1
answer
379
views
Reloading Clojure nrepl automatically
The way that I'm reloading the nrepl in Clojure seems too bulky.
When I load a Clojure project and nrepl, I:
Create a keyboard macro to input and return something like (use 'my-namespace.core :...
2
votes
2
answers
148
views
How do I perform a sequence of actions with a single keybinding?
i am using cider. I want to do the following: when I finish editing in a source buffer, I want to compile the source and execute it in the repl, all with a single key-binding.
In cider-mode, ...
0
votes
1
answer
115
views
remove delimiter and comment typing from [Ljava.lang.String; in clojure-mode
Parsing parentheses: smie vs syntax table gives one example of how to use syntax-propertize-function but I wonder if someone could help me with another example. I'm working with clojure-mode. Here's ...
2
votes
3
answers
635
views
How to set cider using boot middle ware?
In Emacs with cider and lein installed, I can M-x cider-jack-in to start clojure repl. I installed boot and would like to switch from lein to boot. How to set cider to use boot middle ware?
(I don't ...
1
vote
0
answers
207
views
org mode with clojure - can't get export to work
I'm a relative emacs newbie and have set up my emacs (24.4.1) to work with clojure.
The gist of it is that I am now using the latest org-mode from git and loading it in my init.el (I am using prelude ...
3
votes
2
answers
399
views
Evaluate paragraph in cider
I'm new to Emacs (after 10+ years of Vim) and want to use it primarily for clojure.
Coming from Lighttable, one thing I absolute liked was the way it evaluated just the right sections of code no ...
1
vote
1
answer
593
views
How to set up Emacs with Clozure CL but without SLIME
I want to manually set up my own Emacs CL environment on Mac OS X 7 without the SLIME package i.e. it will only use Clozure CL.
To put it other way, I want to use the Emacs CL just like I use the "...