Fork me on GitHub
#emacs
<
2020-04-19
>
bherrmann12:04:55

Emacs doesnt seem to understand me.... I placed this in my .emacs rc

(defun babashka-connect ()
  (cider-connect localhost 1667))

(define-key global-map "\C-cb" 'babashka-connect)
but typing CTRL-C then B, yields "Wrong type argument: commando, babashka-connect"

sogaiu13:04:57

does adding (interactive) to the appropriate place in the defun help at all?

sogaiu13:04:48

@bherrmann iiuc, to use a function with define-key it's usually (always?) supposed to be a command. adding (interactive) to the function should make it so.

sogaiu13:04:38

from emacs lisp ref: > A command is usually a function; if the function is written in Lisp, it is made into a command by an interactive form in the function definition

bherrmann13:04:37

@sogaiu Thanks, this does the trick in my .emacs

(defun babashka-connect ()
  (interactive)
  (cider-connect '(:host "localhost" :port "1667"))
  )
(define-key global-map "\C-cb" 'babashka-connect)

dpsutton18:04:13

Announcing inf-clojure 3.0.0-snapshot on melpa. - Revamps the internals of inf-clojure. - Makes startup, and choosing a supported repl easier and more intuitive. - (use-package inf-clojure) (add-hook 'clojure-mode #'inf-clojure-minor-mode) and then M-x inf-clojure - supported clojure, lumo, planck, and joker repls. Now extended to support cljs and babashka

babashka 16
🎉 24
❤️ 24
dpsutton18:04:52

if you already have CIDER present and you want to try it out, (remove-hook 'clojure-mode #'cider-mode) and then use the above. they fight over who gets to control the interactive maps

dpsutton18:04:13

Inf-clojure aims to be very simple and offer tooling that the repl itself exposes. A few commands are: - eval last sexp C-x C-e - show arglists for function C-c C-a - show var documentation C-c C-v - show source C-c C-s - insert top level form into repl C-c C-j d

jaide22:04:31

@dpsutton Awesome! I've been using it for lumo lately and it's been pretty good. If we have some issues to report where should we post them?

dpsutton22:04:38

Create an issue on GitHub and tag me? I’m the same username on GitHub. I’ll own it

👌 4