How I set up Airport, X11, Fink, Emacs, IDL, and IDLWAVE-mode on Mac OSX 10.3 "Panther"

Equipment: One new Powerbook with Airport Xtreme, an Internet connection, and an IDL lab license

Goals:

Airport

Airport (Apple's name for 802.11b and 802.11g wireless networking standard) worked fine with the D-Link router using 128-bit WEP. Enter the entire 24-digit HEX key into the password field with a "$" in front of it.

Developer Tools

Look (in the Finder) under \Applications\Installers\Developer Tools. There should be a "Developer.mpkg" installer, which will install gcc 3.3 and other essential items.

If "Developer Tools" is not there already, you should be able to install it from the Panther DVD. Use the "Install Applications and Classic Support". You have to go through many screens during which it will look like you're about to reinstall every application on your computer, but in the end you will come to a checklist where you can select just the developer tools.

Finding the Terminal

The Terminal is under Applications/Utilities. Now you have a command line! OS X ships with a version of emacs, but it can only run within the terminal, which is somewhat limiting...

GNU Emacs for OS X

A Carbon build of Emacs 21.3.50 can be found at:

http://mindlube.com/products/emacs/index.html

Thank you, Andrew Choi! The very useful FAQ is at:
http://members.shaw.ca/akochoi-emacs/stories/faq.html

The command (apple) keys are the default "meta" keys for this version of Emacs.

The default font (Apple Monaco) wasn't wonderful. I wanted to substitute a Courier. Changing it from within emacs (Options/Customize Emacs) would change it for the current session, but not for future sessions, or possibly not when I changed modes. I ended up adding this line to my .emacs file (in my home directory):

(setq default-frame-alist '((font . "-apple-courier-medium-r-normal--14-140-75-75-m-140-mac-roman")))

Note that this font string is not the same one as you would get from xlsfonts under X11. One way to find the available fonts is to type

(x-list-fonts "*")

into the *scratch* buffer and hit C-j (Ctrl-j). Or you can use M-x set-default-font and hit return, and a buffer will come up with all the available fonts.

X11

Apple now provides its own X11 implementation, which includes the client, server, and window manager. This is what I installed:

http://www.apple.com/macosx/x11/download/

It probably also ships with Panther, but I downloaded a second copy before I figured out where the original was on my hard drive. You will also want to install the X11SDK package, which is in /Applications/Installers/Developer Tools/Packages.

There are other versions of X11 available as well (XDarwin with OroborOSX, for example). I've heard they also work well, but I don't have any firsthand experience with them.

Idl 6.0

RSI's programming environment, IDL, installs fine under Mac OS X. It requires X11 and possibly the X11 SDK as well. Note that it installs itself in the /Applications folder, but creates a symlink /usr/local/rsi that points to /Applications. Also, in order to get colors working properly, put a

device,decomposed=0
line in a .startup.idl file in your home directory.

Fink and g77

Up to this point, all of these software installations have been done through Apple's GUI, either through .mpkg files or sometimes though disk images (.dmg files, which are mounted as though they were disks). A lot of other free software is available either as source packages or binary .deb packages. The best way to install these programs is through the package manager, fink:

http://fink.sourceforge.net

I installed version 0.6.1. The fink installer itself is a .dmg disk image.

It turns out that g77 was not included in the "Developer Tools" gcc 3.3 package, so I installed it from fink.  It worked fine.

The IDLWAVE mode for Emacs

GNU emacs actually ships with a version of idlwave, but it's 4.something and I wanted to install the more recent version 5.2. The tar.gz package installed fine from the Finder GUI. However, IDL itself could not be launched from within Emacs IDLwave. At first it could not find the IDL binary, so I edited the ~/.MacOSX/environment.plist file for Emacs to include IDL_DIR:

<dict>
        <key>EMACS</key>
        <string>/Applications/Emacs.app/Contents/MacOS/Emacs</string>
        <key>IDL_DIR</key>
        <string>/usr/local/rsi/idl</string>
        <key>IDL_PATH</key>
        <string>&lt;IDL_DEFAULT&gt;</string>
        <key>PATH</key>
        <string>/Applications:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin</string>
        <key>RSI_DIR</key>
        <string>/usr/local/rsi</string>


After that IDL would launch, obtain its license, then apparently stall before reaching a command (IDL>) prompt.

The built-in terminal-only version of emacs did not have this problem. IDL started fine in response to M-x idlwave-mode; C-c C-s.

I attempted to install X11 (not Carbon) versions of GNU emacs using fink, hoping that they would work better, but the .deb binary packages would not install and the source packages would build but then fail to install at the same point as the downloaded .deb packages.

I decided to try XEmacs instead.

XEmacs under Apple X11

The .deb binary packages for XEmacs wouldn't install due to a dependency issue with ncurses. However, the source packages worked. I installed xemacs-sumo-pkg and xemacs. Finally, I was able to run IDL from the IDLWAVE shell.

In order to get the mouse wheel (external USB trackball) working under XEmacs, I inserted the line

(mwheel-install)

in my .xemacs/init.el file.

Unlike the Carbon GNU emacs, XEmacs under Apple X11 does not come set up with any meta keys other than the escape key. Since on a Powerbook the escape key is small and out of the way, I wanted to set up one of the option or command keys as meta. I ended up doing this by creating an .xmodmap file as follows:

clear mod1

keycode 66 = Meta_L

keycode 63 = Mode_switch

add mod1 = Meta_L

This caused the option key to act as a meta key. However, I still have to execute

xmodmap .xmodmap

from the command line before launching XEmacs. I should write a shell script to automate this.

Credits

Many thanks to Google, Google Groups, comp.sys.mac.apps, comp.lang.idl-pvwave, J.D. Smith, and all the authors and maintainers of the free software now available on Mac OS X.