Fragmented Notes

This is where I write about learning to code

SICP in Emacs: Reading in the info-Buffer

Structure and Interpretation of Computer Programs, short SICP is a great book and Emacs is a great tool for all things about text. So it is only natural to use one with the other and yesterday I stumbled upon this blogpost: SICP in Emacs. Sadly I had no idea about how to use or install a book in the info-system. That had to change a bit and the following will be instruction for me in the future, should I forget how to bring the greatest CS-book of the 80ies into one of the greatest programs from the 80ies.

In the search for information on info, I found that there is a lot of documentation missing from my relatively recent Debian install. Most of the more interesting parts on info are in the package “texinfo-doc-nonfree”. I suggest to install it on every system, because the info system is very cool and it is very rewarding t read its manual. What I don’t understand is the “nonfree” part: should it not be free software as a part of the GNU-project? So the first step is this:

sudo apt-get install texinfo-doc-nonfree 

After that, I downloaded the Info-version of SICP, that can be found on the website of Neil van Dyke.

This file has to be moved to a “info directory”. The manual mentioned above explains how to build one, but I just used the one used by Emacs and gave the file the necessary permissions:

sudo cp sicp.info.gz /usr/local/share/info/
sudo chmod 644 /usr/local/share/info/sicp.info.gz 

The rest of the installation is done by “install-info”:

sudo install-info /usr/local/share/info/sicp.info.gz /usr/local/share/info/dir

This all of course works primarily on Debian-GNU/Linux, but some good advice for info on Windows seems to be found in this blogpost: http://pchristensen.com/blog/articles/setting-up-and-using-emacs-infomode/

My complete reading setup for SICP now looks like this:

A screenshot of Emacs with three frames: sicp, a source code file and a scheme REPL

It looks like I am not the only one who likes this technological opportunity enough to make a screenshot

If you need some convincing, why reading SICP in the first place is a good idea, you might read this article: Why and how to start your sicp trek

As RMS tends to say: “Happy hacking!”