Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Slime and Emacs Lisp
@ 2006-04-06 19:23 Sébastien Vauban
  2006-04-06 21:30 ` Albert Reiner
  2006-04-07  8:32 ` Tim X
  0 siblings, 2 replies; 11+ messages in thread
From: Sébastien Vauban @ 2006-04-06 19:23 UTC (permalink / raw)


Hello,

I've just installed Slime and CLisp. Very good choice, I think.

But my ultimate goal would be to try enjoying all the features
of Slime for debugging Emacs Lisp code I want to maintain...
but, when compiling my Emacs Lisp code, it reports many errors,
like:

    o   undefined function NIL
    o   function INTERACTIVE is not defined
    o   function USE-LOCAL-MAP is not defined
    o   MAJOR-MODE is neither declared nor bound
    o   function RUN-HOOKS is not defined
    o   ...

And, *not* being an expert at all in both languages, I don't
know if their differences are so big it's purely impossible to
do what I want, or if it's still possible to debug Emacs Lisp
code with Slime/CLisp?

Thanks,
  Seba

-- 
Sébastien Vauban

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Slime and Emacs Lisp
  2006-04-06 19:23 Slime and Emacs Lisp Sébastien Vauban
@ 2006-04-06 21:30 ` Albert Reiner
  2006-04-28 18:45   ` Aaron Hsu
  2006-04-07  8:32 ` Tim X
  1 sibling, 1 reply; 11+ messages in thread
From: Albert Reiner @ 2006-04-06 21:30 UTC (permalink / raw)


[Sébastien Vauban <ewgeocaufsfb@spammotel.com>, Thu, 06 Apr 2006 19:23:16 GMT]:
> I've just installed Slime and CLisp. Very good choice, I think.

Indeed, but for Common Lisp:

Clisp is one of many implementations of Common Lisp, which is a
completely different kind of Lisp than Emacs Lisp.  And Slime is only
designed to help with Common Lisp.

> And, *not* being an expert at all in both languages, I don't
> know if their differences are so big it's purely impossible to
> do what I want, or if it's still possible to debug Emacs Lisp
> code with Slime/CLisp?

I suspect so.

Albert.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Slime and Emacs Lisp
  2006-04-06 19:23 Slime and Emacs Lisp Sébastien Vauban
  2006-04-06 21:30 ` Albert Reiner
@ 2006-04-07  8:32 ` Tim X
  2006-04-07 17:13   ` Sébastien Vauban
  1 sibling, 1 reply; 11+ messages in thread
From: Tim X @ 2006-04-07  8:32 UTC (permalink / raw)


Sébastien Vauban <ewgeocaufsfb@spammotel.com> writes:

> Hello,
>
> I've just installed Slime and CLisp. Very good choice, I think.
>
> But my ultimate goal would be to try enjoying all the features
> of Slime for debugging Emacs Lisp code I want to maintain...
> but, when compiling my Emacs Lisp code, it reports many errors,
> like:
>
>     o   undefined function NIL
>     o   function INTERACTIVE is not defined
>     o   function USE-LOCAL-MAP is not defined
>     o   MAJOR-MODE is neither declared nor bound
>     o   function RUN-HOOKS is not defined
>     o   ...
>
> And, *not* being an expert at all in both languages, I don't
> know if their differences are so big it's purely impossible to
> do what I want, or if it's still possible to debug Emacs Lisp
> code with Slime/CLisp?
>

Please note this is not the right group for this question. Try
gnu.emacs.help. 

Slime is designed for working with common Lisp, which is a different
beastie to Emacs Lisp. Emacs has a pretty good in-built debugging
capabilities and a much closer integration than you would get with
slime even if you could get slime to work with it. 

Slime uses a CL package called SWANK, which is used to handle the
interactions between emacs and common lisp. You don't need this for
emacs lisp as its part of the editor. You can get a similar function
to the slime repl with ielm e.g.

M-x ielm

HTH

Tim


-- 
tcross (at) rapttech dot com dot au

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Slime and Emacs Lisp
  2006-04-07  8:32 ` Tim X
@ 2006-04-07 17:13   ` Sébastien Vauban
  2006-04-07 17:48     ` Johan Bockgård
  2006-04-08  5:05     ` Tim X
  0 siblings, 2 replies; 11+ messages in thread
From: Sébastien Vauban @ 2006-04-07 17:13 UTC (permalink / raw)


Hello,

>> But my ultimate goal would be to try enjoying all the features
>> of Slime for debugging Emacs Lisp code I want to maintain...
>>
>> And, *not* being an expert at all in both languages, I don't
>> know if their differences are so big it's purely impossible to
>> do what I want, or if it's still possible to debug Emacs Lisp
>> code with Slime/CLisp?
>
> Please note this is not the right group for this question. Try
> gnu.emacs.help. 

Sorry, you're right. Stupid mistake.


> Slime is designed for working with common Lisp, which is a different
> beastie to Emacs Lisp. Emacs has a pretty good in-built debugging
> capabilities and a much closer integration than you would get with
> slime even if you could get slime to work with it. 

Can you be a bit more specific about which environment you use
to do so?

For example, how do you get the display of a function's
arguments list in the minibuffer?  Very very useful.

How do you localize source code?  Ctags, Etags, ...?

Thanks for the help,
  Seba

-- 
Sébastien Vauban

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Slime and Emacs Lisp
  2006-04-07 17:13   ` Sébastien Vauban
@ 2006-04-07 17:48     ` Johan Bockgård
  2006-04-21 11:23       ` Giacomo Boffi
  2006-04-08  5:05     ` Tim X
  1 sibling, 1 reply; 11+ messages in thread
From: Johan Bockgård @ 2006-04-07 17:48 UTC (permalink / raw)


Sébastien Vauban <ewgeocaufsfb@spammotel.com> writes:

> For example, how do you get the display of a function's arguments
> list in the minibuffer? Very very useful.

Eldoc mode.

    (add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
    (add-hook 'lisp-interaction-mode-hook 'turn-on-eldoc-mode)
    (add-hook 'ielm-mode-hook 'turn-on-eldoc-mode)

> How do you localize source code?  Ctags, Etags, ...?

Through `find-function' etc. There are also links to the source from
the *Help* buffers.

(find-function-setup-keys) will define a bunch of keys for you:

    C-x   F     find-function
    C-x 4 F     find-function-other-window
    C-x 5 F     find-function-other-frame
    C-x   K     find-function-on-key
    C-x   V     find-variable
    C-x 4 V     find-variable-other-window
    C-x 5 V     find-variable-other-frame

-- 
Johan Bockgård

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Slime and Emacs Lisp
  2006-04-07 17:13   ` Sébastien Vauban
  2006-04-07 17:48     ` Johan Bockgård
@ 2006-04-08  5:05     ` Tim X
  2006-04-09 17:37       ` Julian Stecklina
  1 sibling, 1 reply; 11+ messages in thread
From: Tim X @ 2006-04-08  5:05 UTC (permalink / raw)


Sébastien Vauban <ewgeocaufsfb@spammotel.com> writes:

> Hello,
>
>>> But my ultimate goal would be to try enjoying all the features
>>> of Slime for debugging Emacs Lisp code I want to maintain...
>>>
>>> And, *not* being an expert at all in both languages, I don't
>>> know if their differences are so big it's purely impossible to
>>> do what I want, or if it's still possible to debug Emacs Lisp
>>> code with Slime/CLisp?
>>
>> Please note this is not the right group for this question. Try
>> gnu.emacs.help. 
>
> Sorry, you're right. Stupid mistake.
>
>
>> Slime is designed for working with common Lisp, which is a different
>> beastie to Emacs Lisp. Emacs has a pretty good in-built debugging
>> capabilities and a much closer integration than you would get with
>> slime even if you could get slime to work with it. 
>
> Can you be a bit more specific about which environment you use
> to do so?
>
> For example, how do you get the display of a function's
> arguments list in the minibuffer?  Very very useful.
>

Three refernces which you cannot do without if you are planning to
develop emacs lisp packages -

1. The emacs manual. Check out the section on tags, programming modes,
   imenu, documentation lookup, symbol completion etc.

2. An introduction to Emacs Lisp manual. Comes as a package under
   Debian and possibly RedHat and should be available at the GNU site.
   Gives a general overview of emacs lisp and pointers to using the
   debugger and other built-in features. 

3. The Emacs Lisp manual. Covers the nitty gritty bits of emacs lisp
   and using the debugger, profiling etc. 

4. http://www.emacswiki.org - contains lots of useful information on
   customizations and add-on packages you can use to setup your lisp
   development environment. 

5. O'Reilly has a book called something like Extending Emacs or Emacs
   Lisp Programming - I can't quite remember. It has some handy tips. 

To what extent you can get things like function argument lists in the
min-buffer, I don't know. Most of my emacs lisp programming has been
fairly simple and I've not used/missed that feature. However, as slime
is just emacs lisp, then either it can be implemented (there is your
first project!) or it already exists either as an add-on or
customization change. 

Tim


-- 
tcross (at) rapttech dot com dot au

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Slime and Emacs Lisp
  2006-04-08  5:05     ` Tim X
@ 2006-04-09 17:37       ` Julian Stecklina
  2006-04-10  4:46         ` Stefan Monnier
  0 siblings, 1 reply; 11+ messages in thread
From: Julian Stecklina @ 2006-04-09 17:37 UTC (permalink / raw)


Tim X <timx@nospam.dev.null> writes:

> 5. O'Reilly has a book called something like Extending Emacs or Emacs
>    Lisp Programming - I can't quite remember. It has some handy tips. 

I have "Writing GNU Emacs Extensions" on my shelf which is quite nice.

But back to being off-topic: Is there some kind of debugger and
inspector for Elisp like what Slime provides for CL? At least the
debugger I know from XEmacs is very basic and does not remotely compare
to Slime's. Any help is greatly appreciated.

Regards,
-- 
Julian Stecklina

"I object to doing things that computers can do." - Olin Shivers

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Slime and Emacs Lisp
  2006-04-09 17:37       ` Julian Stecklina
@ 2006-04-10  4:46         ` Stefan Monnier
  2006-04-10  8:23           ` Tim X
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2006-04-10  4:46 UTC (permalink / raw)


>> 5. O'Reilly has a book called something like Extending Emacs or Emacs
>> Lisp Programming - I can't quite remember. It has some handy tips. 

> I have "Writing GNU Emacs Extensions" on my shelf which is quite nice.

> But back to being off-topic: Is there some kind of debugger and
> inspector for Elisp like what Slime provides for CL? At least the
> debugger I know from XEmacs is very basic and does not remotely compare
> to Slime's. Any help is greatly appreciated.

Check the Emacs Lisp Manual, looking for "debugger".
I use `edebug'.


        Stefan

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Slime and Emacs Lisp
  2006-04-10  4:46         ` Stefan Monnier
@ 2006-04-10  8:23           ` Tim X
  0 siblings, 0 replies; 11+ messages in thread
From: Tim X @ 2006-04-10  8:23 UTC (permalink / raw)


Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>> 5. O'Reilly has a book called something like Extending Emacs or Emacs
>>> Lisp Programming - I can't quite remember. It has some handy tips. 
>
>> I have "Writing GNU Emacs Extensions" on my shelf which is quite nice.
>
>> But back to being off-topic: Is there some kind of debugger and
>> inspector for Elisp like what Slime provides for CL? At least the
>> debugger I know from XEmacs is very basic and does not remotely compare
>> to Slime's. Any help is greatly appreciated.
>
> Check the Emacs Lisp Manual, looking for "debugger".
> I use `edebug'.
>
>

I echo Stefan's comments. Emacs has the basic debugger/stack trace,
but it also has edebug, which is very powerful. Personally, I've
always found the best debugger to be between your ears. I've used the
simple debugger a fair bit, but have only resorted to using edebug on
a couple of occasions. I find lisp with its very simple syntax means
90% of the time, any bugs I have are 'logic flaws' in my algorithm and
while stepping/tracing and watching variables change values can
certainly help, its usually (for me) faster to just look at my code
and run it through in my head. The whole development process with lisp
is very different to working with something like C. I use unit testing
a lot more with lisp and just work on an individual function until I
know its returning what I want/expect and then just move on to the
next bit. In C, I would often have to write quite a few functions
before I could get to the point of testing and would then find quite a
few bugs all at once. However, even in C, I rarely used a debugger -
most of the time a few useful debugging C macros and a couple of
asserts was sufficient. I really only ever used a debugger when
dealing with lower level subsystems and device drivers or possibly a
quick analysis of a core file to work out where the problem occured
and then start looking at the sources from that pint. 

I've found even when working with slime and common lisp, I rarely need
the full power of its features - maybe I'm just doing really simple
stuff. I'm also a bit of a dinosaur and started writing code before
all these really flashy IDEs existed - back then, getting your code to
work well with a debugger often took a bit of effort and the
information it provided was either difficult to interpret or too
verbose.

I'd strongly recommend just using the emacs debugger and edebg for the
more complex situation. When you find your at a point which is
difficult to debug, post some specific examples to gnu.emacs.help and
I'm sure you will get some good pointers. 

In the meantime, lets move this discussion to gnu.emacs.help rather
than continuing this off topic thread further in this group.

Tim 

-- 
tcross (at) rapttech dot com dot au

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Slime and Emacs Lisp
  2006-04-07 17:48     ` Johan Bockgård
@ 2006-04-21 11:23       ` Giacomo Boffi
  0 siblings, 0 replies; 11+ messages in thread
From: Giacomo Boffi @ 2006-04-21 11:23 UTC (permalink / raw)


bojohan+news@dd.chalmers.se (Johan Bockgård) writes:

> Eldoc mode.
> (find-function-setup-keys)
> Johan Bockgård

thank you very much
-- 
continua pure a nasconderti dietro a chi ti vuole bene, sei fortunato
ad avere amici generosi che sprecano tempo a difenderti anche su un
gruppo che tu consideri invece un posto adatto solo a prendere per il
culo. te lo devo dire agnosco, sei proprio stupido -- alics, in IFQ

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Slime and Emacs Lisp
  2006-04-06 21:30 ` Albert Reiner
@ 2006-04-28 18:45   ` Aaron Hsu
  0 siblings, 0 replies; 11+ messages in thread
From: Aaron Hsu @ 2006-04-28 18:45 UTC (permalink / raw)


Albert Reiner <areiner@tph.tuwien.ac.at> writes:

> And Slime is only designed to help with Common Lisp.

Don't forget SLIME48 with Scheme 48, which is SLIME for Scheme. 

-- 
Aaron Hsu <spam@sacrificumdeo.net> Jabber: arcfide@xmpp.us
<http://www.sacrificumdeo.net> "Extend beyond the Mortal . . . ."
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety." - Benjamin Franklin

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2006-04-28 18:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-06 19:23 Slime and Emacs Lisp Sébastien Vauban
2006-04-06 21:30 ` Albert Reiner
2006-04-28 18:45   ` Aaron Hsu
2006-04-07  8:32 ` Tim X
2006-04-07 17:13   ` Sébastien Vauban
2006-04-07 17:48     ` Johan Bockgård
2006-04-21 11:23       ` Giacomo Boffi
2006-04-08  5:05     ` Tim X
2006-04-09 17:37       ` Julian Stecklina
2006-04-10  4:46         ` Stefan Monnier
2006-04-10  8:23           ` Tim X

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).