Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do I jump to a function definition in emacs when using slime?

I have installed slime using https://github.com/thephoeron/slime-pack and want to explore the common-lisp a bit more.

How do I access the source for a particular function in emacs?

for example, if I have a function:

(type-of 1)

and I want to visit the source of type-of, how can this be done?

like image 217
zcaudate Avatar asked Jul 18 '14 06:07

zcaudate


People also ask

How do you enter a function in Emacs?

M-. key will take you to the function definition emacs.

How do I use SLIME in Emacs?

emacs. d/ . The first lisp file you load you may need to perform M-x slime , which means holding down either Alt or Escape, then hitting the letter 'x'. A prompt will appear at the bottom of the editor (in the minibuffer) where you type "slime" and hit enter.


1 Answers

Meta .

It calls the function: slime-edit-definition

For jumping to functions inside your lisp implementation you may need to do something extra to point to the sources. In SBCL you have to sb-ext:set-sbcl-source-location to the correct place in .sbclrc:

(sb-ext:set-sbcl-source-location "/path/to/sbcl/")

You can edit .sbclrc with C-xC-f ~/.sbclrc in Emacs.

like image 185
PuercoPop Avatar answered Oct 18 '22 00:10

PuercoPop