0
votes

This is a re-post. I tried asking this on the Emacs-live and Clojure mailing lists, but guess it wasn't relevant enough. My problem is:

  • I open emacs ( using emacs-live - initialization code in my "~/.live-packs/-pack/init.el" file )
  • I execute M-x nrepl-jack-in
  • In a repl, I create a var

    user> (def thing (+ 1 1))

    user> thing

  • Then on the thing var, I run C-c C-i. Emacs gives me the message: C-c TAB is undefined.

However, if I open up the scratch buffer, and, from the live-pack init.el file, manually run the code below A), I can then execute C-c C-i in my repl, and get a working result, as seen in B).

A)

(load-file "<some-directory>/nrepl-inspect/nrepl-inspect.el")
(define-key nrepl-mode-map (kbd "C-c C-i") 'nrepl-inspect)
(require 'nrepl-inspect)

B)

Type: class java.lang.Long 
Value: "2"
---
 Fields:
  "serialVersionUID" = 4290774380558885855
  "SIZE" = 64
  "value" = 2
  "TYPE" = long
  "MAX_VALUE" = 9223372036854775807
  "MIN_VALUE" = -9223372036854775808

Because all my other live-pack init.el code (mostly just ritz) executes successfully, I have to assume that the nrepl-inspect code is failing. Has anyone come across this before? How can I get this working, directly when emacs loads? Being new to emacs lisp, is there anyway to debug this problem?

Thanks

Tim

1
In your .emacs, you should ensure that nrepl-inspect is in your path, and (require nrepl-inspect), then add the key to the nrepl-mode-map. It is as simple as pasting the code you have above into your .emacs. (the load and require you do are redundant).noisesmith

1 Answers

1
votes

C-c C-i is the same thing as C-c TAB. Emacs is telling you that it is not bound to any command in the buffer where you are using it.

If you want it to do what it does in buffer *scratch* then start by seeing what it does in *scratch*: C-h k C-c TAB.

If you like, you can then bind any key you like, including C-c TAB to that command.