Emacs for maemo

Switch styles

Contents:

1. What is this?
1.1 What is emacs?
1.2 What is maemo?
1.3 What is a port?
2. Download
3. Installation instructions
4. Size considerations
5. Dired mode
6. Info files
7. Spell checking
8. Community contributed add-ons
9. Feedback and comments

1. What is this?

Welcome to the homepage of the emacs port for the maemo platform.

1.1 What is emacs?

From the Emacs manual: “Emacs is the extensible, customizable, self-documenting real-time display editor. If this seems to be a bit of a mouthful, an easier explanation is Emacs is a text editor and more. At its core is an interpreter for Emacs Lisp ("elisp", for short), a dialect of the Lisp programming language with extensions to support text editing.”

1.2 What is maemo?

From wikipedia: “Maemo is a Debian-based development platform for handheld devices. It is used by the Nokia 770 Internet Tablet, and its successors, the Nokia N800 and N810.”

1.3 What is a port?

From Webopedia: “To port (v.) To move a program from one type of computer to another. To port an application, you need to rewrite sections that are machine dependent, and then recompile the program on the new computer. Programs that can be ported easily are said to be portable.”

This port is a straight cross-compilation from source done with the scratchbox toolkit. Currently, the stable version of GNU emacs is at 22.1. Two packages are offered to the public, with X support and without X support.

2. Download

Here are the download links:

Emacs for maemo with X support:
Package hosted on garage.maemo.org
Emacs package for maemo with no X support:
Package hosted on garage.maemo.org

3. Installation instructions

Those packages have been successfully installed on all maemo versions above and including OS2007. If Application Manager doesn't take care of the dependencies, here's what you need to know:

  • emacs with no X support: osso-xterm and ncurses-base.
  • emacs with X support: osso-xterm, ncurses-base and libxaw7. In turn, libxaw7 depends on libxmu6 and libxpm4.

4. Size considerations

A typical GNU Emacs installation takes up around 78 Mb of disk space. The maemo port of emacs is no exception. Given the amount of disk space used, naturally, there may be some concern when installing it on your device with limited memory. Someone suggested to get rid of certain not-often files, another person inquired about installing the application on external media. After giving this question a thought, I decided to provide the community with the full unabridged version of emacs. This is the only way to maximize choice. Some people will want to keep everything on their device, others will reduce that size by adopting different strategies. In the comments section on this page, someone reported that moving /usr/share/emacs to external media and simply symlinking to it works. Please post on this page the solutions you have found. If you wrote scripts to cut down the size of the installation, you are welcome to post them as well. Contributors will be fully credited.

5. Dired mode

You can get dired (C-x d) to work by adding the following to your .emacs:

(setq dired-use-ls-dired nil)

This stops emacs using the --dired option on the ls command. --dired isn't supported by busybox ls.

The way to get list-directory (C-x C-d) to work is to add

(setq list-directory-brief-switches "-C")

This gets rid of the -F option which busybox ls does not support.

(Tip contributed by Julian)

6. Info files

Many GNU applications store their documentation in /usr/share/info. They are called info files and are gzipped. However, when you install an application in maemo with Application Manager, a post-install script will delete all files found in /usr/share/info. The rationale is to save space, but that's not necessarily what you want, especially if you want to use info functionality (Meta-x info) in the emacs port that you just installed.

The solution is easy, edit the post-install script to skip /usr/share/info when doing its cleanup. The name of this script is docpurge, and its location is /usr/sbin/docpurge. The line to look for is:

rm -rf /usr/share/doc/* /usr/share/man/* /usr/share/info/*

Just delete the reference to the info directory, or comment it out. Ideally, you will do this before you install emacs, but if you haven't, you don't have to de-install and re-install the package, just transfer the info files you're interested in from a desktop computer to /usr/share/info on the device.

Ok, now you're in emacs and you press Meta-X info, and you see a list of info books you'd like to browse, you press on one, say Coreutils, and what you get is:

Opening input file: error uncompressing coreutils.info.gz, /usr/share/info/core\
    utils.info.gz

What happens is that the gzip that ships with busybox doesn't support a switch that emacs uses when it tries to decompress the info files. Solution? Two, actually. The first one (and the better one) consists in suppressing that switch by adapting the jka-compr-compression-info-list variable. A way to achieve this is to type M-x customize-option which will prompt you a variable to customize. Type jka-compr-compression-info-list, look for the entry that starts with ".\g?z", and remove the -q switch (which stands for quiet). This tip was contributed by sietchtabr at gmail com, who also provides his .emacs file here, which handily includes the above hack.

The second solution implies the opposite. Install GNU gzip on your device, which supports the -q switch. You can download the package from here (private server) or here (garage.maemo.org). Now put the directory where gzip has been installed in your PATH, before anything else, in your .ashrc or your .profile, like this:

export PATH=/usr/bin/gzip:$PATH

When you now start emacs in the terminal, and browse the info files, it will use the gzip that it expects.

7 Spell checking

Spell check with the cross-compiled GNU aspell. This package will probably not install with maemo's Application Manager, so install as root from the terminal:

dpkg -i package_name

Then you can transfer your dictionary files from your desktop emacs installation to that on maemo's. Likely locations are /usr/lib/aspell or /usr/lib/aspell-0.60/. Just copy them and, to be safe, do a chmod 644. That's it.

8. Community contributed add-ons

Qwerty12 has made available two packages that may be of interest to some of you. First, a meta-package that installs on top of the official port which provides GTK enhancements to the X interface (fonts look better, menus are "sticky" and bigger). The source originates in the emacs22-GTK debian package. It also requires this libgif package to be installed. Second, an aspell package with English dictionary included. None of these packages install with the application manager, so use the command line instead. This is experimental software.

 

9. Feedback and comments

[an error occurred while processing this directive]

Update: As of 21/4/2010, comments are closed. For running emacs on the N900, please visit sumoudou.org


© Daniel Szmulewicz, 1996 - 2011

 

 

about | work | code | silly | cv
home | blog | contact | back