Since I mentioned in a review that I’m using Emacs on my Android Nexus 7 tablet, I’ve received several requests for information about how I set it up. There is a prepackaged Emacs app in the Google Play store, but it does not work as distributed, because it bundles a broken terminal application. The Emacs binary itself is fine, though, and with a bit of manual work, you can install it to run inside a different terminal application (I use Terminal IDE below).
Note: Emacs needs a full-featured PC-style keyboard. I usually run Emacs on my tablet with an external Bluetooth keyboard; if you want to use a soft keyboard, consider installing the Hacker’s Keyboard, which has all of the modifier keys Emacs expects.
Request: Would anyone be willing to rebundle Emacs in an easily-installable form for Terminal IDE, and make this blog posting obsolete?
Installing Emacs for Terminal IDE
Install the Terminal IDE app on your Android device.
In your Android browser, go to http://emacs.zielm.com/data/ and download the files
lisp.tlzma, then copy them to your Terminal IDE home directory.
Launch a shell in Terminal IDE and run the following commands:
$ unlzma emacs.lzma $ chmod 755 emacs
At this point, you should already be able to run emacs by typing
(though it will fail because it can’t find its etc directory). If you want, just put it somewhere on your executable path, like you would in any Linux installation.
Create a directory
/sdcard/emacs/(or make it somewhere different, if you’re willing to set environment variables to tell Emacs to look somewhere else).
Copy the downloaded files
Change to the
/sdcard/emacs/directory and run the following commands:
$ unlzma etc.tar.lzma $ tar xvf etc.tar $ unlzma lisp.tar.lzma $ tar xvf lisp.tar
Test that emacs starts up OK now (run from wherever you installed the binary):
If all is well, you can optionally delete the tar files to save space:
$ rm /sdcard/emacs/etc.tar /sdcard/emacs/lisp.tar
Enjoy Emacs in Android! You might consider doing an
C-u 0 M-x byte-recompile-directoryon
/sdcard/emacs/lisp/(and any other lisp directories) to make sure you’re up to date.