Hi,
I decided that it would be worthwhile to learn some Emacs Lisp, mainly in order to understand the internals of SLIME better -- maybe I could get to the point that I could extend and customize it myself. This is why I am posting here instead of an emacs group.
I am looking for help on how to get started, especially with the following:
1. Is there a SLIME-like IDE for Emacs Lisp? If not, what's the closest? I know that Emacs itself provides some functionality, but it does not look nearly as comfy as SLIME for CL. Eg I couldn't figure out the equivalent of M-. and similar.
2. Is there a document describing the architecture of SLIME?
3. How should I start? What's the best way to start poking around in SLIME?
Tamas
Tamas K Papp tkpapp@gmail.com writes:
Hi,
I decided that it would be worthwhile to learn some Emacs Lisp, mainly in order to understand the internals of SLIME better -- maybe I could get to the point that I could extend and customize it myself. This is why I am posting here instead of an emacs group.
I am looking for help on how to get started, especially with the following:
- Is there a SLIME-like IDE for Emacs Lisp? If not, what's the
closest? I know that Emacs itself provides some functionality, but it does not look nearly as comfy as SLIME for CL. Eg I couldn't figure out the equivalent of M-. and similar.
There's M-x ielm. For M-. I use http://paste.lisp.org/display/113374
- Is there a document describing the architecture of SLIME?
Not that i know. "A pile of hacks" sounds about right.
- How should I start? What's the best way to start poking around in
SLIME?
By finding something you want to modify.
Tamas K Papp tkpapp@gmail.com writes:
Hi,
I decided that it would be worthwhile to learn some Emacs Lisp, mainly in order to understand the internals of SLIME better -- maybe I could get to the point that I could extend and customize it myself. This is why I am posting here instead of an emacs group.
I am looking for help on how to get started, especially with the following:
- Is there a SLIME-like IDE for Emacs Lisp?
Yes. It's called emacs.
If not, what's the closest?
There's also a classic REPL, M-x ielm RET
I know that Emacs itself provides some functionality, but it does not look nearly as comfy as SLIME for CL. Eg I couldn't figure out the equivalent of M-. and similar.
It's M-. if you have generated the tags with etags(1)
You can also use: C-h f C-x o TAB RET
Is there a document describing the architecture of SLIME?
How should I start? What's the best way to start poking around in
SLIME?
Good questions.
Perhaps a good start would be to write a swank backend for emacs? If Christophe Rhode could write one for R, you could write one for emacs!
* (Pascal J. Bourguignon) 87zkuxj2gk.fsf@kuiper.lan.informatimago.com : Wrote on Fri, 01 Oct 2010 18:35:23 +0200:
|> I know that Emacs itself provides some functionality, but it does not |> look nearly as comfy as SLIME for CL. Eg I couldn't figure out the |> equivalent of M-. and similar. | | It's M-. if you have generated the tags with etags(1) | | You can also use: C-h f C-x o TAB RET
Or just
(define-key emacs-lisp-mode-map "\M-." 'find-function)
if desired, one can kludge approximate "M-," behaviour suitably with `pop-global-mark'
-- Madhu
* Tamas K Papp [2010-10-01 15:37] writes:
- Is there a SLIME-like IDE for Emacs Lisp? If not, what's the
closest? I know that Emacs itself provides some functionality, but it does not look nearly as comfy as SLIME for CL. Eg I couldn't figure out the equivalent of M-. and similar.
Attached is a chunk from my .emacs with similar bindings as SLIME. Turn on eldoc if you like it.
- Is there a document describing the architecture of SLIME?
http://common-lisp.net/~trittweiler/talks/slime-talk-2008.pdf might be useful. The big comments preceded by ;;; in slime.el and swank.lisp should give you the basic idea.
- How should I start? What's the best way to start poking around in
SLIME?
Write a simple command that uses slime-eval-async and defslimefun, e.g. ask for two numbers, add them on the Lisp side and insert the result in the current buffer.
If you evaluate (break) you can see the backtrace which should give you a live view on what's going on the Lisp side. For best effect put (setq swank:*communication-style* nil) in ~/.swank.lisp.
Similarly on the Emacs side: insert (debug) in the source of some interesting command and invoke it. In the *slime-events* you can see a log of the sent/received messages.
Helmut
In article m262xl7p6k.fsf@common-lisp.net, Helmut Eller heller@common-lisp.net wrote:
- Tamas K Papp [2010-10-01 15:37] writes:
- Is there a SLIME-like IDE for Emacs Lisp? If not, what's the
closest? I know that Emacs itself provides some functionality, but it does not look nearly as comfy as SLIME for CL. Eg I couldn't figure out the equivalent of M-. and similar.
Attached is a chunk from my .emacs with similar bindings as SLIME. Turn on eldoc if you like it.
That's quite cool. I'm using similiar stuff based on what Stas posted.
Perhaps it warrants a slime-dev contrib?
-T.
In article i84v89$8lt$1@dough.gmane.org, Tamas K Papp tkpapp@gmail.com wrote:
- How should I start? What's the best way to start poking around in
SLIME?
I'm more of printf-style person, so I started out way back when as follows:
Let's say you want to find out how C-c C-m works.
To find out about the emacs side, do C-h k C-c C-m, it will tell you the function name, and give you a link into the elisp source.
To find out about the swank side, perform the command, look into *slime-events* what RPC it calls, grep for it in the *.lisp files.
You'll also see the return value of the RPC in *slime-events*.
Then you can look again what the elisp side does with the return value. I usually use the following function for that purpose:
(defun tcr:debugmsg (msg &rest args) (with-current-buffer (get-buffer-create "*TCR*") (goto-char (point-max)) (insert "\n") (insert (apply #'format msg args))))
Just put (tcr:debugmsg "%S" (some-elisp)) into an elisp function definition, press C-M-x, and redo the command. The output goes to *TCR*.
HTH,
-T.