Hot answers tagged

10

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 function has the following bit of code (setq result (nrepl-dict-get (nrepl-sync-request:eval expanded (cider-current-connection) (cider-current-...


7

(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 compilation time, then your code can't be compiled properly since the define-clojure-indent macro won't be known during compilation, leading to mis-compilation, ...


7

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): M-x list-packages will list all packages U will mark all packages to be updated x will perform all the updates. You need to ...


5

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 Brave and True book. My guess is that something in the customization files makes emacs compile the packages wrong. What I did: First of all, the config file ...


4

Just run-lisp. Afterwards, you can use e.g. C-c C-l (lisp-load-file) to eval a source file. C-c C-e (lisp-eval-defun) to eval a statement. Still, I can't imagine why someone wouldn't want to run SLIME.


4

@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 its evaluation, using (eval-and-compile (require 'clojure-mode)). The fact that require is evaluated by the byte-compiler when it is at top level is pointed out ...


3

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 systems written in Emacs Lisp, BBDB (which is just lots of code for serializing contact data to Lisp vectors) and Elfeed's solution (which actually resembles ...


3

C-M-x does the right thing in Clojure buffers for me after spawning a REPL. To look up what command is bound to it, use F1 k <key sequence> and you'd find out that it's cider-eval-defun-at-point.


3

Do you have clojure mode installed? Try M-x install-package clojure-mode if not and then run cider-jack-in.


3

The normal way to do this within a session is to record the actions as a keyboard macro, and then bind that macro to a key. You can also save the macro and binding to a file to use it across sessions. The details are provided in the Emacs manual.


2

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.readthedocs.org/en/latest/extended_workflow/#running-tests


2

First follow these instructions on the Readme so that boot knows about CIDER. Boot users can configure the tool to include the middleware automatically in all of their projects using a ~/.boot/profile.boot file like so: (require 'boot.repl) (swap! boot.repl/*default-dependencies* concat '[[cider/cider-nrepl "0.9.1"]]) (swap! boot.repl/*default-...


2

Although this is not pristine elisp, the following should work. (defun my-cider-eval-paragraph () (interactive) (save-excursion (mark-paragraph) (command-execute 'cider-eval-region))) Note this is exactly what you wrote, except the macro is called saVe-excursion.


2

(defun clojure-syntax-propertize-array-class (beg end) "Put word `syntax-table' property on \"[Lfoo.Bar;\"." (let ((word-syntax (string-to-syntax "w"))) (put-text-property beg end 'syntax-table nil) (save-excursion (goto-char beg) (while (re-search-forward (rx (and (group ?\[) ?L ...


2

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 its test file."


2

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/indent 1} [& body])


2

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 from MELPA where a fix to workaround Emacs versions 25+ has been implemented. Note: Do not use the version (0.10.0) in MELPA stable since it does not work.


2

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 function works in relation to normal mode. Since it's not likely a bonafide normal mode operation, there's no guarantee that it will be repeatable with evil-...


2

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 '(("\\(@\\)" 1 '(:foreground "red") prepend))))) This uses an anonymous face with red foreground, any face could of course be used.


2

#+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.


1

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 other words, turning on paredit-mode makes changes to clojure-mode keybindings and those changes stick even if you turn off paredit-mode. The really surprising ...


1

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-connection "pyls") :major-modes '(python-mode) :server-id 'pyls)) So you might need to check out the latest README on github for ...


1

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 find out about these things: C-h r. In the manual, use i to look something up in the index, using completion. For example, i key bindings (or i key bind TAB ...


1

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.


1

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.io/Blog/Clojure-Plotting-to-Org-inline-image-in-ob-clojure.html Here is a complete example: #+begin_src clojure :results file link :dir "data/images" :file "...


1

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 successfully with your init.el pasted above (replacing last defvar with package-install).


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 25 branch that break and un-break expand-region, such as demonstrated in the question here. Keeping up with them would be a big job for little benefit. ...


1

Outside of Cider, there is toggle-test, which can switch between source and test buffers in a language agnostic way.


1

An easier way is to just load your current file: (define-key clojure-mode-map (kbd "C-c C-l") 'cider-load-file) It's also possible to keep (use 'my-namespace.core :reload) in your file, navigate there with isearch and C-c C-e. Personally, I almost never use a REPL and evaluate either the whole buffer with C-c C-l or single expressions with e (via ...


1

Have you tried the already defined shortcut? C-c M-e It evaluates the form preceding point and outputs to REPL buffer. See other cider mode shortcuts here.


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