Projects Home Style Autobuild CVS Doxygen


XEmacs
XEmacs is a highly customizable open source text editor and application development system. It is an extension of GNU Emacs which supports a modern GUI with buttons and menus in addition to the regular <ctlr> and <esc> sequences of Emacs.

XEmacs is constructed around the idea of buffers: a buffer can contain a text file, a running process, the output of a command or anything else of a textual nature.

The GUI is composed of top-level windows called frames which are divided into buffer views called windows - so you can run one frame with five windows or five frames each with a single window. Each window contains a buffer, but a single buffer can appear in more than one window. This lets you have multiple views of the same file (making copy/paste really easy).

XEmacs has lots of modes which handle special-case editing of files. The C++ mode, for example, has the ability to properly indent code: just press the <TAB> key on any line of code and it will be indented appropriately. The manual has a full list of major modes.

Customizing
Most customization is handled through the Options menu - most entries here are self-explanatory, but there are a couple I use frequently which deserve special mention.

Paren Highlighting
Select one of the options here to activate parenthesis matching. Particularly handy when writing if statements.

Syntax Highlighting
Select "Automatic" and "In This Buffer" to have XEmacs color your text appropriately - this makes reading code much easier.

Changing color.
XEmacs comes up with black text on a gray background. I hate this and change it as the first thing. Select "Edit Faces" from the Options menu to bring up a customization buffer. Scan down the list of fonts until you get to the underlined entry "Default", click on the arrow next to the word.
Click on the box next to Foreground, enter "black" into the gray field.
Click on the box next to Background, enter "white" into the gray field.
Right click on [State] and select "save for future sessions".

Setting line numbers.
The bar at the bottom of every window shows the file name, edit mode and other information about the buffer. I like to have the line and column numbers down there as well. Go to "Frame Appearance" and checkmark "Line Numbers" and "Column Numbers"

Re-mapping .h files
I mostly work with C++ - the naming scheme of .C and .h for code and header files works ok, but there is some confusion about the mode in which .h files should be edited. If you primarily edit C headers, you want to leave it alone, but since I use C++ headers, I want to set XEmacs to automatically go to C++ mode when I load a .h file.
To do this, edit the .emacs file in your home directory and add the line:
(setq auto-mode-alist (cons '("\\.h$"  . c++-mode) auto-mode-alist))
After you make changes to the options from the Options menu, do not forget to select "Save Options" to preserve your changes across sessions.

Debugging
Use gdb or ddd for debugging. Both are fine debuggers and ddd will give you a nice GUI for controlling a running program. There is not much to say except to mention that core files generated when a program crashes are actually very useful information and should not be discarded out of hand.

Starting the gdb debugger using:
gdb programname core
where programname is the name of the program which just crashed will start up the gdb debugger, load the program and re-create the execution at the point the program crashed.

More information
The XEmacs web site can be found at http://www.xemacs.org Local info on XEmacs can always be found by clicking on the Help menu from within XEmacs and the complete manuals for XEmacs along with (assuming competent sysadmin support) for many other GNU packages can be found by clicking on the "Info" button.

Documentation on the gdb debugger is available through gnu.org at http://www.gnu.org/manual/gdb-4.17/gdb.html.
A local copy for browsing is available on this server.
A copy of the .tar.gz file suitable for downloading for use at home is also available: gdb

Documentation on the ddd debugger (which uses gdb as the underlying debugger) is available through gnu.org at http://www.gnu.org/manual/ddd/index.html.
The manual is also available locally as a PDF file - but check if you already don't have a copy (under RedHat 7.2) in /usr/share/doc/ddd-3.3.1/ddd.pdf


Projects Home Style Autobuild CVS Doxygen



Karlis Kaugars
Last modified: Fri Jan 18 10:54:36 EST 2002