14

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?

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
mwilliams
  • 9,946
  • 13
  • 50
  • 71
  • I can't leave this as an official answer because the question is closed, but 10yrs after this was asked I've created an elisp-koans library that fits the bill: https://github.com/jtmoulia/elisp-koans – jtmoulia Jul 15 '19 at 04:20

5 Answers5

8

There used to be lesson in .el format (emacs lisp) at http://www.gnuvola.org/software/elisp-tutorial/.

You can find a copy of the tutorial here now.

I learned a lot from them. You read them in emacs in lisp interactive mode, and practice within the text.

Gustav Bertram
  • 14,591
  • 3
  • 40
  • 65
Peter
  • 47,963
  • 46
  • 132
  • 181
  • Thanks for this link, it's been pretty helpful already, especially using the Lisp interactive mode and its keybindings. Great stuff! – mwilliams Aug 09 '09 at 20:42
4

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.

Community
  • 1
  • 1
Trey Jackson
  • 73,529
  • 11
  • 197
  • 229
2

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.

Community
  • 1
  • 1
Martin Owen
  • 5,221
  • 3
  • 35
  • 31
1

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
  • 5,515
  • 2
  • 26
  • 20
-1

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
  • 10,526
  • 2
  • 24
  • 32