This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
I am trying to setup my PC with a global deps.edn
alias which is activate for any cider repl started on this PC from Emacs.
I am aware of cider-clojure-cli-aliases
and cider-clojure-cli-parameters
, but they don't solve it.
At least not when, I want both , a system-wide-alias and project specific cider-clojure-cli-aliases``
set via
.dir-locals.el
Any solution for this ?
From memory, this wasn't possible, although it would totally make sense that it did š
I managed it by monkey patch
cider-clojure-cli-jack-in-dependencies
and hardcode
(if cider-clojure-cli-aliases
;; remove exec-opts flags -A -M -T or -X from cider-clojure-cli-aliases
;; concatenated with :cider/nrepl to ensure :cider/nrepl comes last
(let ((aliases (format "%s" (replace-regexp-in-string "^-\\(A\\|M\\|T\\|X\\)" "" (concat ":user:" cider-clojure-cli-aliases)))))
(if (string-prefix-p ":" aliases)
aliases
(concat ":" aliases)))
"")
Maybe an extension point would be nice. It would be rather "safe", as a wrong value would only return in a "warning" about unused alias
A backwards-compatible change (similar to other recent changes) would be to:
ā¢ introduce a cider-clojure-cli-global-aliases
var
ā¢ introduce a cider-clojure-cli-aliases
function
(elisp is a lisp-2, cider-clojure-cli-aliases can be both a var and a function)
ā¢ make the defun concat both vars, and also perform other cleanup like removing flags
I think @U051BLM8F didn't want to introduce a lot of tooling-specific vars which may be part of the reason why things are a bit limited atm. After some discussion we'd welcome a PR as hinted
but yes, tool specific ...
For "leiningen" this is solvable without Cider support. For cli-deps not.
https://github.com/clojure-emacs/cider/pull/3623
but only introducing the variable, not sure we need a "customizable" function:
This could allow to "change order", no sure we need this.
I think it's always:
globals:locals:nrepl/cider
Hi, I have something like this
(comment
(sexp0 ...)
(sexp1 ...)
(sexpN ...) ;; cursor is here
)
how to evaluate everything from sexp0
to sexpN
?
Now I'm wrapping everything in do
and evaluate whole do
, but I wonder if I can avoid this wrapping?You could bind a key to something like
(cider-interactive-eval (replace-regexp-in-string "^\(comment" "(do" (cider-defun-at-point))
nil
(cider-defun-at-point 'bounds))
(I just quickly hacked that now - may have small issues but it's a starting point)Closest official thing we have is https://docs.cider.mx/cider/usage/code_evaluation.html#evaluating-code-inside-comments but 1) it doesn't solve the "do" problem, and 2) it's pretty flawed, as far as I've perceived. The approach per my snippet seems simpler than the current one - changing what to eval as a string is simpler than manipulating Clojure sexp traversal with Elisp. We could evolve my snippet to something official, eventually