Computer Science Java Style
Introduction
Fundamental Notions and First Constructs

Text Editing in emacs

The emacs text editor is widely used by computer programmers. It is rich in primitives and extensible too. A glossary of basic emacs concepts and a selection of command specifications are provided in Appendix 2 on emacs.

Introduction to Slot and Filler emacs Commands

A collection of commands which prove useful to a beginning study of Java are provided in the the file java_env.el which can be loaded for use with the emacs "load-file" command. Among these are the following.
  1. The basic Java application template generator.
  2. A command to find the next slot to be filled with particular program information.
  3. A command to delete the "previous" slot, the slot just found.
  4. A command to transfer a demo of a program from a shell running in an emacs window to a slot in sources which correspond to Java applications.
Collectively these commands, as well as a few others, can considerably lighten the burden of mechanics associated with learning to program.

Use of Slot and Filler emacs Commands

The slot and filler emacs commands will be used to get a template, find and fill various slots of the template, and transfer a demo of the program to the <?DEMO> slot of the template. The basic approach is described below. Details of just how to do certain things are provided in the laboratory challenge which immediately follows.

Generating a Template

Find and Fill the Slots

You will find and fill each slot, except for the <?DEMO> slot, by doing the following for each slot.

Transfering your Demo

Once your program is correct, you will want to run it. You can transfer the output from the program as follows.

What if you are not using emacs?

If you are not using emacs, you can still choose to use the "slot and filler" approach to creating a source file. One way to proceed would be to create the templates yourself. Then you would " Generate a basic application template. " by simply loading the proper template file, write it to disk under a different name. You would " Find and fill in the next slot. " with whatever commands your editor provides. Finally, you would " Transfer you demo. " with whatever cutting and pasting mechanisms your editor provides.

Craig Graci
Last modified: Tue Jan 21 13:04:11 EST