Fork me on GitHub

@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:

(after! cider-mode
  (defun cider-tap (&rest r)
    (cons (concat "(let [__value " (caar r) "]"
                  " (tap> __value)
          (cdar r)))

  (advice-add 'cider-nrepl-request:eval
              :filter-args #'cider-tap))
What this does is 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 'minibuffer, 'overlay, _BUFFER_ with the name of the buffer. Are there other possibilities?


I think it's fine for this to be part of the same codepath.


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.


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 cider-test-show-report-on-success t.


Probably your cider-clojure-cli-aliases has to activate a test alias


I have that, still nothing thinking-face


it looks like something to do with setting up cider-clojure-cli-global-options, what's the difference between that and cider-clojure-cli-aliases?


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 ":dev:test"


cider let us know if the docs could be clearer somewhere


FYI 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.

👍 1

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)

((clojure-mode . ((cider-preferred-build-tool . clojure-cli)
                  (cider-clojure-cli-aliases . ":env/dev:env/test"))))
There are some other lesser used options here


I think 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. The -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 🙂