This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (4)
- # babashka (3)
- # beginners (79)
- # biff (4)
- # calva (17)
- # cider (18)
- # clj-kondo (21)
- # cljdoc (45)
- # cljs-dev (14)
- # cljsrn (9)
- # clojure (90)
- # clojure-europe (86)
- # clojure-italy (3)
- # clojure-nl (3)
- # clojure-portugal (1)
- # clojure-uk (9)
- # clojurescript (20)
- # code-reviews (23)
- # conjure (14)
- # cursive (12)
- # datascript (12)
- # emacs (5)
- # events (2)
- # fulcro (13)
- # gratitude (1)
- # holy-lambda (9)
- # lambdaisland (2)
- # malli (6)
- # nbb (1)
- # nextjournal (2)
- # nrepl (30)
- # off-topic (63)
- # pathom (1)
- # portal (24)
- # reagent (5)
- # reitit (13)
- # releases (2)
- # remote-jobs (1)
- # sci (90)
- # shadow-cljs (49)
- # spacemacs (5)
- # sql (13)
- # testing (20)
- # tools-build (17)
- # xtdb (27)
@meditans I guess it depends on how many possible options can we have in the end. If there are 5-6 destinations I think those boolean flags are not going to scale well and some defcustom like
cider-intereactive-eval-result-destination that's a list might be better (provided we want to combine those) or just has many possible options. In hindsight I think that showing the same results in multiple ways probably is not very useful to most people (as it happens today by default), so I'm open to reconsidering this.
Right! The list approach sounds like the most useful one to me. The remaining question I have on this functionality is: could we use this to also consider other outputs than emacs itself? Like, I have in my configuration:
What this does is
(after! cider-mode (defun cider-tap (&rest r) (cons (concat "(let [__value " (caar r) "]" " (tap> __value) __value)") (cdar r))) (advice-add 'cider-nrepl-request:eval :filter-args #'cider-tap))
tap>the result so that I can get it from portal, for example.
Could we put something like
'tap in the list of outputs to include this kind of functionality, or is it better left to another codepath?
As far as destinations, I think we would have
_BUFFER_ with the name of the buffer. Are there other possibilities?
Back in the day my main concern with going in the direction of only inline results by default was that none other Emacs mode was doing something like this by default and there was a long history of following the minibuffer-first approach for displaying results.
Btw, in the past I did something similar for the output https://docs.cider.mx/cider/usage/code_evaluation.html#change-the-output-destination
Can anyone tell me if I have to tweak some elisp vars for testing in deps.edn project?
I don't remember having any troubles in lein projects, but in this one, cider-test-run-ns-tests, and similar commands don't show anything, it says "Running tests", but no results, no failures, nothing. I have
it looks like something to do with setting up
what's the difference between that and
hmm. looks like you're right Victor.
I had to fix discrepancy in deps.edn and set the var like this
cider-clojure-cli-aliases replaced the other variable when the format of the clojure cli command line changed to using the -M execution option and put the aliases at the end of the command. I dont think the older alias is still used.
are you saying
cider-clojure-cli-global-options needs to be marked 'obsolete'?
it looks like messing with it (instead of setting cider-clojure-cli-aliases) can lead to bad combination of args where it won't jack-in
In short, probably.
I do not know of a valid use case for using
cider-clojure-cli-global-options unless you are using a pre 1.10.3-697 version of the Clojure CLI tool (and I think even then the newer Cider versions may complain)
I recommend only using
cider-clojure-cli-aliases and maybe setting the preferred build tool (if there is both leningen and deps.edn configs in the project)
There are some other lesser used options here https://practical.li/spacemacs/clojure-projects/project-configuration.html
((clojure-mode . ((cider-preferred-build-tool . clojure-cli) (cider-clojure-cli-aliases . ":env/dev:env/test"))))
cider-clojure-cli-global-options put the aliases at the start of the
clojure command using the often confusing
-A execution option, which is kind of irrelevant as Cider now uses the -M flag anyway.
-A execution flag may try and run your :main-opts settings if they are in the aliases specified, which will block cider running.
With the -M flag version of the
clojure command, you can add any Clojure CLI aliases you want and they are all chained together before the
:cider/nrepl alias, so any main opts in your own aliases will be ingnored in preference for cider/nrepl (which should have the :main-opts middleware to wire up everything to make cider jack in work (although I should check the code to be sure)
If in doubt, use cider connect 🙂