[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: How to get skills in elisp ?

From: Drew Adams
Subject: RE: How to get skills in elisp ?
Date: Mon, 25 May 2009 01:17:10 -0700

> I finally took time to start learning elisp hence nobody can call me
> an dumb emacs user ;)
> I started by reading the info files containing the Gnu Emacs Lisp
> Reference Manual although I haven't read it entirely.
> But now I got the main picture of the language but I would need some
> practice since the reference manual lack of examples before I feel
> confortable enough to start writing my own elisp scripts.
> Could anybody give me some direction at that point ?

Yes, take a look at the manual (in Info, `C-h i') called `Emacs Lisp
Introduction' in the Info menu. The manual title is actually "An Introduction to
Programming in Emacs Lisp". It's just what you're looking for.

When you want to code something, search (`grep') the existing Emacs-Lisp source
code for terms that are pertinent. You can often find code that is similar to
what you want to do. This is the way to learn about writing code to change to a
different buffer, select a different window, display a buffer, search for text,
replace text, and so on - see how the Emacs developers do it.

> Also I would like to know how people debug their scripts ? Are there
> any tricks ? For now I just write some forms and evaluate 
> them with 'C-j'.

`C-j' evaluates in the *scratch* buffer. I personally don't use *scratch* much.
I prefer to create an Emacs-Lisp buffer/file, e.g. foo.el, and work in that,
then throw it away. (My fingers can't think of `C-j' as anything other than

See also `M-:', `eval-region', and `C-x C-e'. See `debug-on-entry'. Put
`(debug)' in your code if you want to debug part of a function. Make a function
interactive temporarily, to make it easier to call (`M-x', with completion, vs
`M-:'). Comment out sections of code using `C-u M-x comment-region' (I bind
`comment-region' to `C-x C-;').

Ask questions here. Visit Emacs Wiki ( Have fun!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]