Skip to content

Commit 4c4e148

Browse files
committed
Merge pull request #1 from dbushenko/master
Section ##Usage added
2 parents b0a9393 + 3231123 commit 4c4e148

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,31 @@ or by adding this bit of Emacs Lisp code to your Emacs initialization file(`.ema
4343
If the installation doesn't work try refreshing the package list:
4444

4545
<kbd>M-x package-refresh-contents [RET]</kbd>
46+
47+
## Usage
48+
49+
First you have to install javap-mode because it will be used to display JVM-bytecode.
50+
51+
Next. Since nrepl-decompile depends on nrepl, it has to be installed and running. Start nrepl session like this:
52+
53+
<kbd>M-x nrepl-jack-in [RET]</kbd>
54+
55+
Let's say, we've got the following namespace in the Clojure project: myns.core. Compile it, pressing in its buffer:
56+
57+
<kbd>C-c C-k</kbd>
58+
59+
Switch to this namespace in the nrepl buffer.
60+
61+
```lisp
62+
(in-ns 'myns.core)
63+
```
64+
65+
Now you may decompile any function in the current namespace using command "nrepl-decompile-func". For instance, if you have function myns.core/main, then you may decompile it like this:
66+
67+
<kbd>M-x nrepl-decompile-func [RET] main [RET]</kbd>
68+
69+
If you want to decompile a function from the other namespaces, you may use command "nrepl-decompile-ns-func". For example, decompiling function myotherns.core/other-main would look like this:
70+
71+
<kbd>M-x nrepl-decompile-ns-func [RET] myotherns.core/other-main [RET]</kbd>
72+
73+
After the command was invoked, the buffer *decompiled* apears showing the bytecode of the function.

0 commit comments

Comments
 (0)