This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # beginners (19)
- # boot (118)
- # capetown (4)
- # cider (37)
- # cljs-dev (69)
- # cljsjs (23)
- # clojure (212)
- # clojure-austin (10)
- # clojure-india (3)
- # clojure-italy (2)
- # clojure-mke (1)
- # clojure-nl (1)
- # clojure-russia (5)
- # clojure-spec (52)
- # clojure-uk (86)
- # clojurescript (31)
- # core-async (9)
- # cursive (123)
- # datomic (91)
- # emacs (22)
- # events (3)
- # hoplon (68)
- # klipse (4)
- # lambdaisland (10)
- # leiningen (2)
- # off-topic (14)
- # om (14)
- # onyx (44)
- # perun (14)
- # proton (20)
- # re-frame (15)
- # reagent (10)
- # ring-swagger (9)
- # specter (18)
- # untangled (3)
- # vim (26)
- # yada (4)
How do I load and run a top level form in the repl like Timothy Baldridge does here: http://www.youtube.com/watch?v=enwIIGzhahw&t=1m24s. I don’t see the option to do it in the docs https://cider.readthedocs.io/en/latest/interactive_programming/
He steps through the file, loading and evaluating forms in a single step. I can load into the repl and hit Enter, but it means switching buffers which I want to avoid.
(defun cider-insert-last-sexp-in-repl (&optional arg) "Insert the expression preceding point in the REPL buffer. If invoked with a prefix ARG eval the expression after inserting it." (interactive "P") (cider-insert-in-repl (cider-last-sexp) arg))
(defun cider-insert-in-repl (form eval) "Insert FORM in the REPL buffer and switch to it. If EVAL is non-nil the form will also be evaluated." (while (string-match "\\`[ \t\n\r]+\\|[ \t\n\r]+\\'" form) (setq form (replace-match "" t t form))) (with-current-buffer (cider-current-connection) (goto-char (point-max)) (let ((beg (point))) (insert form) (indent-region beg (point))) (when eval (cider-repl-return))) (cider-switch-to-repl-buffer))
I use this one:
(defun cider-eval-sexp-at-point-in-repl () (interactive) (let ((form (cider-sexp-at-point))) ;; Strip excess whitespace (while (string-match "\\`\s+\\|\n+\\'" form) (setq form (replace-match "" t t form))) (set-buffer (cider-get-repl-buffer)) (goto-char (point-max)) (insert form) (cider-repl-return)))
@dpsutton there is a
(cider-switch-to-repl-buffer), maybe you just need to take it away?
don't regret it. vim is quite handy. and when you're just shortly in a machine, knowing vim is quite nice.
emacs isn't an editor though; (as Im still usin evil binding keys); I've just never realized that "my IDE is programmable"
Im having a weird issue where the the repl is not recognizing the file I opened it with. The prompt says user instead of the project name so every time I try to use a symbol defined in the file I keep getting the symbol undefined error.
suppose I need to write my own inferior lisp mode, where can I get the documentaiton in inferior lisp and comint ? all I'm getting is https://www.gnu.org/software/emacs/manual/html_node/emacs/External-Lisp.html , which is very weak on documentation
@dorianc.b you need to switch to that namespace, and possibly load that namespace if nothing else in your startup us
I guess it depends on how you have it set up, but cider doesn’t normally switch the repl to the open file. (unless that’s a new thing)
@bozhidar : I wanted something lightweight than cider, so I was looking for inferior-lisp clojure minimal bindings. Then, I found https://github.com/clojure-emacs/inf-clojure It turns out you own both of the top 2 most popular emacs/clojure interactive dev projects.
@norman thanks, using load buffer and set ns worked. For some reason the repl wasn't automatically loading the right namespace.
If you do nothing, the repl should go to the user namespace. Things like a :main in your project would influence that
Off the top of my head, there’s nothing else that would cause the repl to automatically go to another namespace
Have you guys ever encountered the following error in cljs:
Tue Jan 24 13:30:53 PST 2017 [ server-loop ] WARN - opcode mismatch: pre: 1, now: 0
I am evaluating
(update-in @app-state [:node :colors] (constantly ))