next up previous
Next: Compiling and Running your Up: Creating C-Programs Previous: Alternative Compilers

Writing Source Code

The best editor for coding, and unfortunately the hardest to use, is emacs. Emacs is available on all UNIXes and exists also in a Windows-version which can be downloaded from most shareware-archives. In order to run the graphical version of emacs on UNIX, you have to have X running (or connect from a Windows-machine through PCXWare or a similar product). Important commands are: CTRL-X CTRL-F to load a file, CTRL-X CTRL-S to save, CTRL-X CTRL-C to leave emacs, CTRL-_ to undo. An emacs-introduction is available from the CCC (http://www.wpi.edu/Academics/CCC/Help/Unix/emacs.html). If you put the following three lines in a file .emacs in your home directory, you will get nice colorful syntax highlighting:

       (global-font-lock-mode t) 
       (set-background-color "white")
       (set-foreground-color "black")
If you do not want to learn emacs, you can use pico on UNIX or the editor of your choice on Windows. Pico is a relatively primitive editor and does not provide syntax highlighting or automatic indentation as emacs does, but is more intuitive to use in a UNIX-text-mode terminal window.

Andreas Koeller
2000-06-04