2021-05-01 Emacs Lisp book revived

Five and a half years ago I mentioned that I was writing an intermediate book on Emacs Lisp programming. Unfortunately, the project started – and then stalled for quite some time.

There were two main reasons: one was that around the same time I took part in another big writing project, together with two more people, which lasted until late 2020. It is now finished, and I am probably not allowed to talk about it in public yet, but it is going to see the light of day quite soon, at least for some values of “soon” (hopefully still in 2021), and I’m very excited about it – and I think my mathematically-inclined readers will be, too.

Another reason was that I changed my job in 2016 and fulfilled one of my long-time dreams – being a “real programmer” (feel free to insert your favorite joke here). It turned out that I had a lot of things to learn (which is great), and quite a few to unlearn (working in academia for more than a decade really does things to you mind, and I am still unlearning some of those…)

Anyway, a few months ago I decided to revisit that project, and I have spent quite some time on writing for the last few months. I am quite proud to say that an early draft of the book is already available here. I would be very thankful for any feedback. The tagline of Leanpub, the platform I’m using, is to “publish early, publish often” – in other words, it is a platform to publish early drafts of books, which people can then buy trusting that the author will finish them. (Also, motivating the author to work hard on finishing them, too!)

Before you go buy the (as of now) one third (approximately) of the book, let me explain a few things about the project, which is now more mature than it was in 2015.

In fact, one of the reasons the project stalled a bit was that it was very difficult for me to decide what to include, in what order etc. Five years ago I made a mistake of just sitting down and writing the bits I felt like to write, and leaving the decisions about what the book as a whole is going to look like for later. This was very wrong. You can write a blog this way, since the posts do not have to form a coherent book-like structure. You can also write a book this way if it is obvious what should be included and in what order (my first book was written this way, and it was ok then – it was pretty short, the list of concepts to include was self-evident, and so was the order, because some of them naturally build on others).

Emacs and Emacs Lisp are really quite complicated, and writing a comprehensive book doesn’t make any sense – it would basically mean rewriting the Emacs Lisp Reference. So, this is what I did instead. I made a list of topics I would like to cover, and spent some time gathering ideas for tools to code which could be a good illustration of them. And not every idea could make that list! One of the goals of the book was: no toy examples, just really useful code. And indeed, most of the code in the book – even if it starts as artificial, simple examples – evolves into fully useful stuff you could include in your init.el.

Also, I didn’t want to include code which would only be useful to a small fraction of people. For instance, there is no AUCTeX-related code in the book, nor any extensions to Org-mode (since not every Emacser is also a LaTeX or Org-mode user).

One thing I am not very happy with is that I’d prefer to have more shorter chapters instead of a few longer ones. (It can change, since right now I’m reconsidering the chapter list – a few days ago I had a nice idea, and it is quite probable that I will add one or two chapters!) This is bad in a way, since someone may find the subject of one of the chapters boring, but a later chapter may build on what was presented in the preceding ones. On the other hand, I wanted to avoid a situation which is very common in programming books, where the author introduces some concept, shows a simplified example use, and proceeds to another one. In my book we do start with simple examples, but at the end of every chapter we are going to arrive at something pretty comprehensive – something that could as well be published on Melpa as a package. (In fact, I might publish some of them at some point in time.)

Also, there are some important concepts which are absent from the book. My idea was to write something which can be considered more or less complete, and once I gather some feedback, maybe expand it. There are indeed quite a few natural candidates for more chapters – testing, writing non-special major modes, running external tools from Emacs, and possibly other stuff. I even dropped some ideas I was pretty sure would make their way to the book, like an intro to functional programming I wrote a few years ago – I may reintroduce them after I write what I have planned now, but I want to focus on delivering a complete and self-contained (even if a bit minimal) book first.

One of the nice things about publishing a work in progress is that it enables the author to get early feedback. So, if you decide to trust me enough to pay for this early version of the book, I’d be very thankful for any feedback. Is it too concise? Too verbose? Are the sentences too short? Too long? And most importantly, is something difficult to understand? Tell me!

To wrap it up for now, expect more updates here, most probably once per month or so. I want to complete the book (or what might become its “first edition” in the future) around September, so stay tuned!

CategoryBlog, CategoryEnglish, CategoryEmacs, CategoryEmacsBook