Using neXtaw with Emacs 21

What is neXtaw?

NeXtaw is a replacement for the traditional and ubiquitous Athena Xaw widget set. Since Xaw is generally considered to be ugly (but, less contentiously, it's just flat and simple-looking), alternative widget sets have been developed to replace it. The common feature of the alternative widget sets is an enticing "3d look" that Xaw lacks. The best known alternative widget set is Xaw3d, probably as ubiquitous as Xaw is nowadays. As its name suggests, neXtaw aims to emulate the look of the legendary NeXTSTEP graphical user interface.

With the encroaching success of Gtk and Qt, the days of Xaw replacements such as Xaw3d and neXtaw are probably numbered. However, the latter have the advantage that they are small (in addition to being stable) and so this might help extend their longevity a bit. Note, moreover, that Emacs 21 supports neither Gtk nor Qt.

Using neXtaw with Emacs 21

As far as I can tell, there's no official way of using neXtaw with Emacs 21 (in contrast to XEmacs 21.4, which officially supports neXtaw). Consequently, what follows is an unofficial way of using neXtaw with Emacs. It's straightforward and works on my system, but I naturally cannot make any guarantees about its working on your system (although it should work provided that you can compile neXtaw and Emacs).

The target system in my case is an old Linux distribution running kernel 2.2.26, gcc-3.2.3, glibc-2.2.3, and XFree86-4.1.0.

The first step is to download and compile neXtaw-0.15.1, which is the latest version at this time. By default, neXtaw's headers and libraries are installed in /usr/local/include and /usr/local/lib, respectively.

The second step is to download and compile Emacs-21.4a, the latest version of the 21 series at this time. Assuming that X's headers and libraries are installed in /usr/X11R6 (the standard place on Linux systems), specify the following configure options (on one line):

./configure --x-includes=/usr/local/include:/usr/X11R6/include --x-libraries=/usr/local/lib:/usr/X11R6/lib

Naturally, if you install neXtaw's headers and libraries in the same place as X's headers and libraries, then it suffices to run ./configure without any special options.

After configure has finished, open the file src/Makefile in an editor and change the line LIBW= -lXaw3d to LIBW= -lneXtaw. This ensures that neXtaw will be used instead of Xaw3d. Then run make followed by make install (the latter step naturally assumes that the run with make is successful).

Here's a screenshot of Emacs 21 with a split window on my system. Observe, in particular, the cool neXtaw scrollbars! However, be aware that Emacs thinks that it's using Xaw3d, hence the fact that it's really using neXtaw isn't recorded under Show Emacs Version.


Go to my cover page for Linux-related technical notes
Christopher Piñón (pinon AT sdf-eu DOT org)
Comments welcome
Last updated on 12 January 2007

http://pinon.sdf-eu.org/technotes/nextaw_emacs.html