Solving Problems With Some Quick Elisp

I often read complaints about how hard it is to learn Elisp and that therefore we should rewrite Emacs in Javascript or something equally silly. The fact is, of course, that Elisp, like most Lisps, is actually easy to learn and once you’ve spend a bit of time with it, you’ve got a very powerful tool for solving text manipulation problems or, really, just about any problem at all.

Marcin Borkowski (mbork) has a short post that illustrates this nicely. Mbork’s problem is a simple one. He needs to replace all backslashes with double backslashes. That’s a trivial problem in Emacs but Mbork wants to replace only single backslashes so the obvious solutions like replace-regexp don’t quite do the job. No matter, he simply wrote a bit of Elisp that, he says, took him about 6 minutes including the inevitable debugging.

Folks are fond of pointing out, correctly, that Elisp is not the best Lisp but it’s more than good enough for its domain. Sure, things like name spaces would be nice but look at this way, part of what make Elisp so easy to learn is its simplicity.

This entry was posted in General and tagged . Bookmark the permalink.