- NOTE: Emacs is a family of text editors, of which GNU Emacs is one of many Emacsen. Throughout the text, whenever Emacs is mentioned, I will be referring GNU Emacs specifically.
For over two months, I have been using Emacs as my daily driver text editor (for programming, note-taking, document editing). I have been using Doom Emacs to be more precise. Now that I have been using Doom for some time in my main desktop and laptop computers, the idea of having a dedicated portable Emacs machine had been on my mind lately. Ideally, this will be a low-power machine with fantastic battery life, which will serve the purpose of being my on-the-go cyber-typewriter.
Looking around my home office, wondering if I should repurpose one of my old Macbooks, I realized I had a Samsung 501C Chromebook lying around, which I had acquired on a Black Friday sale about two years ago. At the time, I was looking to try out the ChromeOS experience, and for just under $100 USD I decided it was worth the shot. The 501C is definitely lighter than any of my old Macs, and its battery life is way more than I could ask of a couple of laptops that are 10 years old. However, the 501C has by comparison rather modest specifications:
- Dual-Core Intel Atom x5-E8000 CPU (4 threads, @ 2.00GHz)
- 4GB of DDR4 RAM
- 32GB of Solid-State Storage
- 4,400 mAh battery, which runs for about 8 hours on a single charge
- 11.6 inch LCD screen (admittedly, it’s not a great display, but enough for text editing!)
Having occasionally used the Chromebook for light Google Drive editing, web browsing and email, I knew what it was (not) capable of. Even though the ChromeOS experience overall was not entirely to my liking, the fact that this was a very energy-efficient machine which went to sleep and woke up instantly was very attractive. I was willing to sacrifice the processing power in exchange for amazing battery life, and compromised resources. As a bonus, being a Pixel user, it is also nice to have Google, Android and ChromeOS integration while on the go.
Even though this little machine runs ChromeOS, it is also capable of running Linux applications, through the Linux Development Environment (formerly known as Crostini, currently in Beta). So, in theory, I should have been able to just sudo apt-get install my way into running Emacs, and then git cloning my way into getting Doom up and running. Right? So I thought, but I was wrong.
The first bump in the road came thanks to ChromeOS’ Linux Development Environment, as it is based on Debian Buster. This meant Emacs v25 was the most current version available through its repositories, and Doom requires Emacs v27. “Well, no problem…” -I thought to myself-, “it’s just a matter of compiling from source!”. Not my preferred method for installing software on my machines, but hey, Emacs has pretty solid documentation for taking this route!
We first need to make sure we have the necessary build tools installed:
$ sudo apt-get install build-essential
Then we can proceed to download and extract emacs, and configure the build for vterm support and native JSON support:
$ wget https://ftp.gnu.org/pub/gnu/emacs/emacs-27.2.tar.gz
$ tar -zxvf emacs-27.2.tar.gz
$ cd emacs-27.2
$ ./configure –with-modules –with-json
Finally, we can compile and install Emacs:
$ make
$ sudo make install
Once GNU Emacs 27.2 was installed, I proceeded to follow Doom Emacs’ installation instructions. As I was running the installation script, I was greeted by a error I was not expecting: MY GIT VERSION WAS TOO OLD! I must admit, I had never encountered this type of problem before.
Being used to Ubuntu and APT, I foolishly assumed I could just add a PPA repository to the package manager, and install the latest version of git on my machine… but of course, I was wrong again! Having spent a couple of hours scratching my head, I resorted to solve this problem, the same way I overcame my first issue with Emacs: compiling git from source! The latest version can be downloaded from here. Then we can install some dependencies and compile it:
$ sudo apt-get install dh-autoreconf libcurl4-gnutls-dev libexpat1-dev \ gettext libz-dev libssl-dev asciidoc xmlto docbook2x install-info $ tar -zxf git-2.8.0.tar.gz $ cd git-2.8.0 $ make configure $ ./configure --prefix=/usr $ make all doc info $ sudo make install install-doc install-html install-info
Once Git 2.28.0 was installed, I was able to run the Doom Emacs installer, and voilá! After much fuzzing with packages and compiling (which takes quite some time in a underpowered machine like the 501C), I finally had a working copy of Doom Emacs running on my inexpensive Chromebook, inside a virtualized Linux environment. NOT BAD! In fact, I was so excited that I typed this whole post using Emacs on my Chromebook, right after I loaded my personalized configuration for DOOM.
$ git clone https://github.com/hlissner/doom-emacs ~/.emacs.d
$ ~/.emacs.d/bin/doom install
As a result, I now have a viable device for extended away-from-home writing sessions, running a full-fledged version of Doom Emacs on inexpensive Hardware. Mostly for Org-mode documents and Org-Roam, this setup seems to be handling it reasonably well. Yes, performance is nothing to write home about, but for just running Emacs and writing text on the go is more than enough. Sure, I takes a while to start the application using the Linux Development Environment, but once it starts, the experience is rather smooth!
My main motivation for writing this post is condensing the knowledge obtained from this experience, as at the time of writing, I could not find specific instructions that could have helped guide me in achieving a Doom Emacs installation on Chrome OS. I hope this little write-up serves someone else as a concise summary of steps to take, peppered with my own anecdotes and narrative. Hopefully these won’t be strong deterrents!
If you found this information helpful, I encourage you to share your experiences and knowledge in a similar fashion. Feedback is also always welcome.
Until next time,
Jorge