Koen De Hondt
Last revision: August 7th, 1996

Agora94 User Guide - Editing an Agora Program


This chapter describes how to use the Agora text editor.

Opening and closing an Agora text editor

A text editor is opened by clicking on the text editor icon in the Agora launcher.

Figure 3:Agora text editor

Figure 3 shows the text editor. It contains a menu bar and a text field. The contents of the menu bar menus is discussed below. Clicking on the text field with the <operate> mouse button pops up the <operate> menu, which contains a selection of the commands listed in the menu bar menus.

When an Agora text editor is closed and changes were made since the last time the text was saved, the close confirmation dialog is popped up to prevent accidental data loss.

Figure 4: Close confirmation dialog

Menu commands

Figure 5: File menu

The file menu lists commands applicable to the whole text. The New command has the same effect as opening a new text editor window using the Agora launcher. When the Open command is chosen a file selection dialog is put up. The contents of the selected file is displayed in the text editor window. Save is used to save the current text. If the text is not saved before, this command has the same effect as Save As: a dialog to name a file is put up and the file is saved under the given name. With the Revert command the user is able to restore the contents of the text editor window with the last saved version of the current file. Hardcopy is used to print the text on a printer.

Figure 6: Edit menu

In the top half of the edit menu, one finds the usual commands for text editing. Again, Undo, Cut, Copy and Paste have the same effect as their Smalltalk counterparts. The Clear command deletes the currently selected text.

The commands in the bottom half of the menu all have to do with emphasising text. Reify and Unreify are used to boldface and to undo the boldfacing of a text selection. When static errors are found when a text is parsed, the black characters in the erroneous text are turned into white ones. The Remove Error Mark command turns white characters back into black ones. The Remove All Error Marks command does the same for the whole text. These two commands are rarely used, because the text editor automatically removes all white characters when a text is to be parsed, so that the user need not be bothered with it.

Figure 7: Do menu

The Do menu contains the evaluation commands. The Do It command evaluates the currently selected text and the Inspect It command opens an Agora object inspector window on the result of the evaluation.

The Do It All and Inspect It All commands do the same as the above, but operate on the whole text in stead of the current text selection. In general these commands are used most frequently.

Figure 8: Do menu

The Special menu contains the Format and Format All commands, used to pretty print the text. Pretty printing is only possible when the text is grammatically correct.

It also lists the Preferences command, to edit the preferences of the text editor window at hand. In this version, only one preference can be set: the reporting by the checker of the unreified reifier warnings(see chapter 4). The default setting is not to ignore warnings.

Figure 9: Preferences dialog

Command key shortcuts

For almost all menu commands, a keyboard shortcut is provided. Since Smalltalk menus do not provide a way to display command key shortcuts, the list of available shortcuts is given in table 1. The listed keys must be pressed in combination with the alt (On the Macintosh the command (or apple) key is used) key to activate a menu command.

Table 1: Keyboard shortcuts

			alt key		menu command
						File menu
			N			New
			O			Open
			S			Save
			H			Hardcopy
						Edit menu
			A			Again
			Z			Undo
			X			Cut
			C			Copy
			V			Paste
			R			Reify
			B			Reify
			U			Unreify
			E			Remove All Error Marks
						Do menu
			D			Do It All
			I			Inspect It All
						Special menu
			F			Format All

Typing shortcuts

The Agora text editor provides typing shortcuts for almost all implemented reifiers. Table 2 shows what the result is when a key is pressed in combination with the control key.

Table 2: Typing shortcuts

			control key		result
			A			@
			C			cloning
			D			from:to:do:
			E			clone
			F			ifFalse:
			I			imperative
			J			functional
			L			local
			M			method:
			N			comment
			P			public
			Q			whileFalse:
			R			return
			S			self
			T			ifTrue:
			U			super
			V			variable:
			W			whileTrue:
			X			mixin
			Z			lazy
			<			<-
			>			<>