Fork me on GitHub

So I wanted to have cider start with an alias, and was able to do it with (setq cider-clojure-cli-global-options "-A:dev")as explained there But @bozhidar on this page mentions using the .dir-locals.el file to make this a project local thing... I wasn't able to make that part work


Here is what's in the file


i think the trouble might be with the mode, i tried clojure-mode and even nil


any idea on what the correct incantation might be ?


@carkh dir locals will be load when you are opening a file, you can check if it has a correct value by M-x describe-variable.


oh i was using already opened buffers that must be it then, thanks !


you can do re-open with C-x C-v


i'll unset the global thing and try it, and report back !


and it's working thanks again @doglooksgood


that's some crazy thing, 10 minutes ago i didn't know i've always needed that... emacs is still full of surprises


@carkh @doglooksgood you can also use revert-buffer to get .dir-locals.el to load. My experiences in setting this up are here (only difference for Emacs is the keybindings)


will cider find correctly pick the repl buffer from clojure(deps.edn) + cljs(figwheel-main). I remember you post a great video guide on using cider for clojure/script development on Emacs. I'm using shadow-cljs, in my case, cider can't get the correct repl buffer to eval s-expr or switch to.


after checking the issue of cider, I though this bug has been exists for a long time, I don't know if it's a bug only related to shadow-cljs.


I think there already a issue for this, but it's closed. the problem still exist similar to or In my case, when you have two repl, both can be seen in sesman, when try C-c C-z or C-c C-e. It will say there's no repl in current session.


function sesman-current-session won't return the correct session. Assuming you have two repl(clj and cljs), if you open CLJS repl buffer, then jump to a CLJ file, press C-c C-z, sesman-current-session will pick the CLJS session, the result is an error for there's no clj repl.

malabarba15:07:48 @cfleming No. When there's no argument on the first line cider indents the special arguments by 4 spaces. It just happens that in the example I used this happened to line up with the function name 😛


I guess it was a bad example 🙂


@malabarba Don’t you mean 2 spaces? 🙂


Well, it's indented by 2 spaces more than body arguments. Which adds up to 4. (if you count relative to the outside of the expression)


Ah, now I get what you mean. Sorry about that!

Eccentric J17:07:41

Hello, I’m running cider-pprint-eval-defun-at-point but it’s not actually pprint’ing the results.

Eccentric J17:07:01

[:div.event-progress [:ul.event-progress__list ([:li.event-progress_item {:class "event-progress__item--is_active"} "Discover"] [:li.event-progress_item {:class "event-progress__item--is_active"} "Find Venues"] [:li.event-progress_item {:class "event-progress__item--is_active"} "Get Quote"] [:li.event-progress_item {:class nil} "Review Proposal"] [:li.event-progress_item {:class nil} "Book Event"])]]

Eccentric J17:07:18

Is what it’s outputting when I would like line breaks and indentation so I can quickly examine it to make sure it’s correct.


when it has the parens in it it doesn't work (note ([:li ...) when i switch that to a vector it works. i guess if it throws an error it doesn't pprint?

Eccentric J17:07:16

Interesting! For more context, that data structure is returned by a function. How can I eval the function and have the results pprinted like the right side of your screen?

Eccentric J17:07:51

(ns app.views.ui.event-progress
  (:require [clojure.pprint :refer [pprint]]))

(def order [:discover

(def labels {:discover "Discover"
             :search "Find Venues"
             :expressbook "Get Quote"
             :proposal "Review Proposal"
             :book "Book Event"})

(defn find-index
  [target list]
  (->> list
       (keep-indexed #(if (= %2 target) %1))

(defn event-progress
  [{:keys [active-item]}]
  (let [active-idx (find-index active-item order)]
      (vec (for [i (range 0 (count order))]
             (let [key (get order i)
                   label (get labels key)]
                {:class (if (<= i active-idx) "event-progress__item--is_active")}

  (event-progress {:active-item :expressbook})
  (find-index :proposal order))

Eccentric J17:07:34

I’m trying to eval (event-progress {:active-item :expressbook}) and then see the results pprinted