views:

456

answers:

5

There's a great project called the Ruby Koans, it's a series of tasks to exercise yourself in the Ruby language, stepping you through the standard library using the Ruby Unit Testing suite as a learning tool. It's a great project.

I'd love to see something similar for Emacs.

Can anyone recommend any Lisp exercises to be done inside of Emacs to both exercise Lisp and Emacs usage? Perhaps also while completing the Ruby Koans?

+3  A: 

http://www.gnuvola.org/software/elisp-tutorial/ are lessons in .el format. (emacs lisp). I learned a lot from them. You read them in emacs in lisp interactive mode, and practice within the text.

Peter
Thanks for this link, it's been pretty helpful already, especially using the Lisp interactive mode and its keybindings. Great stuff!
mwilliams
A: 

A very old Oreilly book, Writing GNU Emacs Extensions, has some, if I remember correctly. You might also want to look at the "Emacs Lisp Intro" found in the info pages (you access them using M-x info.

Honestly, the best way to learn Emacs is to change the way you look at it. Don't look at is a text editor to be learned, but as an environment for writing text editors to be explored. Think to yourself: What did I always want in a text editor but never found in the editors that I have used? Set yourself about making it. You'll learn far more, more quickly, trying to make your "own" editor piece-by-piece than by trying to remember lessons learned from some loosely (if at all) linked exercises that have no context in a problem to be solved.

Pinochle
Hee... so true about thinking alike.
Trey Jackson
+2  A: 

The book, "Writing GNU Emacs Extensions", comes pretty close to what you're asking for.

But, if you don't want a book, there are three similar questions already in stackoverflow: What's the best way to learn lisp, How to quickly get started at using and learning emacs, and Tips for learning elisp.

I don't know a "walk through" series that exists, but have found that the best way is to start thinking about little things you wish it did, and then trying to make it work (asking here helps). Even if Emacs already provides such functionality, you might find it more interesting to solve problems you want solved, rather than a bunch of throw-away lessons that hold little interest to you.

Trey Jackson
Great minds think alike, sometimes at exactly the same time!
Pinochle
+1  A: 

The The Little Schemer is a book of Lisp exercises. You need to be aware that some of them are impossible in Emacs Lisp, as it doesn't support closures.

It is also focused on teaching recursion to non-programmers, meaning that you won't cover the full range of Lisp statements (most exercises just use (cond ...) recursively.)

I really enjoyed it though.

Martin Owen
A: 

How is this one:

Write a simple program to open a particular file ("~/ekoans.txt") and select a random line from that text file, that is displayed to the user in a new temporary buffer. Call the function ekoan-random, and make it callable by the user.

The first few lines of ekoans.txt are:

Make ekoan-random open up a new file for you instead of a temporary buffer, and insert apropos header text in the new buffer.
Write an ekoan-sequential function that behaves like ekoan-random, except it works in sequential order
Make ekoan-sequential persist through a customization variable
Make the name of the koan file changeable by a customization variable

I call this Koan-strapping!

Jonathan Arkell