This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-24
Channels
- # announcements (5)
- # beginners (184)
- # calva (32)
- # cider (29)
- # clj-kondo (1)
- # cljdoc (29)
- # cljsrn (6)
- # clojure (44)
- # clojure-dev (36)
- # clojure-europe (9)
- # clojure-italy (18)
- # clojure-losangeles (1)
- # clojure-nl (3)
- # clojure-spec (7)
- # clojure-uk (30)
- # clojure-ukraine (1)
- # clojuredesign-podcast (8)
- # clojurescript (65)
- # code-reviews (21)
- # core-async (25)
- # cursive (51)
- # data-science (3)
- # datascript (2)
- # datomic (25)
- # emacs (14)
- # events (1)
- # figwheel-main (3)
- # fulcro (3)
- # graalvm (5)
- # jackdaw (17)
- # kaocha (14)
- # luminus (5)
- # off-topic (17)
- # pathom (7)
- # pedestal (2)
- # re-frame (71)
- # reagent (25)
- # shadow-cljs (83)
- # spacemacs (31)
- # sql (92)
- # tools-deps (23)
- # vim (102)
- # xtdb (5)
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 https://github.com/clojure-emacs/cider/issues/2396
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
@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
.
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 http://jr0cket.co.uk/2019/07/CIDER-jack-in-to-Clojure-CLI-projects-from-Spacemacs.html (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.
@doglooksgood Which bug is that?
I think there already a issue for this, but it's closed. the problem still exist
similar to https://github.com/clojure-emacs/cider/issues/2447 or https://github.com/clojure-emacs/cider/issues/2489
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.
https://clojurians.slack.com/archives/C0617A8PQ/p1563829853005500 @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 😛
@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)
Hello, I’m running cider-pprint-eval-defun-at-point but it’s not actually pprint’ing the results.
[: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"])]]
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?
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?
(ns app.views.ui.event-progress
(:require [clojure.pprint :refer [pprint]]))
(def order [:discover
:search
:expressbook
:proposal
:book])
(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))
(first)))
(defn event-progress
[{:keys [active-item]}]
(let [active-idx (find-index active-item order)]
[:div.event-progress
[:ul.event-progress__list
(vec (for [i (range 0 (count order))]
(let [key (get order i)
label (get labels key)]
[:li.event-progress_item
{:class (if (<= i active-idx) "event-progress__item--is_active")}
label])))]]))
(comment
(event-progress {:active-item :expressbook})
(find-index :proposal order))