This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-09
Channels
- # aws (4)
- # bangalore-clj (1)
- # beginners (94)
- # boot (19)
- # cider (42)
- # cljs-dev (21)
- # cljsrn (4)
- # clojure (142)
- # clojure-austin (10)
- # clojure-greece (25)
- # clojure-italy (14)
- # clojure-russia (14)
- # clojure-serbia (13)
- # clojure-sg (6)
- # clojure-spec (74)
- # clojure-uk (69)
- # clojurescript (236)
- # consulting (1)
- # cursive (26)
- # data-science (6)
- # datascript (2)
- # datomic (31)
- # editors (5)
- # emacs (24)
- # funcool (5)
- # hoplon (8)
- # jobs-rus (1)
- # luminus (12)
- # lumo (17)
- # off-topic (90)
- # om (45)
- # onyx (5)
- # pedestal (2)
- # powderkeg (12)
- # protorepl (2)
- # re-frame (30)
- # remote-jobs (2)
- # ring-swagger (17)
- # rum (46)
- # slack-help (1)
- # test-check (2)
- # yada (62)
Just sent my first Cider PR! https://github.com/clojure-emacs/cider/issues/1987
i'm trying to put together docs about how to get going so i'd love your feedback about what seemed confusing, what you would have saved you time, etc
Honestly, it was a trivial fix in this case, once I knew the problem. The part that took me time was figuring out the face that was being used, so initially I assumed there would be a cider variable for that. I tried cider-test-error-face etc to no avail. After I discovered it automatically configures itself according to theme, I just searched for enable-theme in the code-base and copy-pasted the relevant sections for disable-theme.
If I were to document the steps I used to achieve it, it would be as follows: 1- The background of the failing tests is ugly. 2- Discover which function is being called when I run the tests. 3- C-h k to discover the function is being called. C-c C-t n in this case for example calls cider-test-run-ns-tests 4- C-u M-x that function to first observe how it runs. 5- Find that it runs cider-test-render-assertion to render the assertions. 6- Find :background ,cider-test-items-background-color in that line. 7- Search for cider-test-items-background-color in the codebase. 8- Find that there are advice functions for setting cider-test-items-background-color on enable-theme. 9- Try the same advice with disable-theme. 10- Clone latest Cider. 11- Create a new branch and make the changes. 12- Add these lines so that it loads the github version, not the one from melpa. (add-to-list 'load-path "~/Github/cider") (require 'cider) 13- Verify the fix works after restarting emacs.
14- Create an issue. 15- Push the branch and create a PR. 16- Change the changelog to refer to the issue. (I had to do a push force here to squash my commits to one.)
Hi, #cider. I'd like to start using inf-clojure (on GNU/Linux, using lein, within a library project), but am missing a number of details about how to make it work. I have clojure-mode, clojure-mode-extra-font-locking, and inf-clojure installed. I've got Emacs running. I've got a terminal window open in my library project's directory. I can open emacsclient -nw src/john/data_util.clj
in the terminal window, and running M-x inf-clojure
splits the window and shows me that nREPL and REPL-y are both running, and I get a user=>
prompt. I can (require '[john.data-util :as jdu])
and run my library functions... but that's it.
So, I suppose the first thing I need to know is: if I edit my code, how can I reload it and try out my changes?
Actually, the zeroth thing is: how can I "Ctrl-p" to get a previously typed form in the repl? (so I don't have to re-type it)
(I see that I can navigate up in the repl window and copy/paste a previously-typed form...)
Regarding reloading, I've tried running the require
again, though that doesn't give me my changes.
> For a list of all available commands in inf-clojure-mode (a.k.a. the REPL) and inf-clojure-minor-mode you can either invoke C-h f RET inf-clojure-mode and C-h f RET inf-clojure-minor-mode or simply browse their menus.
@uvtc inf-clojure
does not have any notion of reloading code. It is the lowest possible form of interaction with a repl
so a reload in clojure is achieved with (require '[john.data-util :as jdu] :reload)
or (require '[john.data-util :as jdu] :reload-all)
that is the string you need to send...maybe inf-clojure
could do it automatically for you.
it is not there atm though
i think the question may be how to eval the buffer. reload the code in the colloquial sense rather than in clojure's notion of reload
oh sorry, so eval a buffer has a binding and is inf-clojure-eval-buffer
agree a wiki with all the commands would be awesome
they are basically here: https://github.com/clojure-emacs/inf-clojure/blob/master/inf-clojure.el#L124
@uvtc if you have any questions, richiardi here is the principal committer right now
Awesome. Thanks! Since my small library is currently only one file, does "require ... :reload" do the same thing as M-x inf-clojure-eval-buffer
?
@uvtc probably yes 😉
Ack! I need to run M-x inf-clojure-eval-buffer
in my code window, not the repl window. 🙂
Wow. This is nice! I can also open a separate terminal window, run the emacsclient and switch to that *inf-clojure*
buffer and work the repl from there. Whee!
Hm. This is weird: I hit Ctrl-D to exit/end the repl in the other terminal window (where I'd started emacsclient -nw
and switched to *inf-clojure*
buffer). It ended, but I couldn't do my usual C-# to finish the emacsclient session. I closed the terminal window. I had another file open in Emacs, and now the buffer is completely empty. It appears to be modified, and and tells me "No undo information in this buffer"... I can still see the file on disk, and its "#other-version.txt#" is there also and zero size...
Hm. Hitting a snag: I can get everything working with a given library project. But I'd like to then shut down the repl, close the file, and do the same with some other library project. I Ctrl-d to end the repl. I "C-x #" to close the emacsclient. cd
to another library project, open a file there, but when I try M-x inf-clojure
, it gives me file-not-found error:
FileNotFoundException Could not locate john/data_util__init.class or john/data_util.clj on classpath. Please check that namespac\es with dashes use underscores in the Clojure file name. clojure.lang.RT.load (RT.java:456)
(That was after working with inf-clojure repl with john/html-util, then trying to switch to john/data-util.)
uhm, it does not seem an inf-clojure
problem
all inf-clojure
does is to launch lein repl
(btw you can customize what it is that it launches)