RED Customisation

The possibilities to make changes to Red fall in two categories:
  1. Changes made by an individual user.
  2. Red setup (typically done by an administrator).
Red lets users make their individual changes interactively, while the system setup is done by writing X resources.

This chapter is devided into several sections:

  1. Preferences
  2. Key Bindings
  3. Changing the Toolbar
  4. Changing Fonts
  5. Changing Colours
  6. X Resources

1. Preferences

To change the Red preferences, choose Preferences... from the Options menu.

The preferences are:

Show toolbar
Toggles the display of the toolbar.
Show cursor line number
Togglespermanent line number display at the bottom of the screen.
Beep with warnings
Determines whether Red beeps when displaying a warning.
Make backup when saving
When on, Red automatically creates a backup file when an existing file is changed. The backup file name has a .~ suffix.
Always end file with Newline character
When on, Red adds a Newline character (normally inserted by the Return or Enter key) at the end of a file if the file does not end in a Newline. This helps with some applications which expect all lines (including the last one) to be terminated with a Newline.
Automatically convert DOS files while loading
When on, and a file is loaded that is found to be in DOS format (lines are ended with CR/LF rather than the Unix standard LF only), the CR is automatically stripped from the file.
Comment start
String to be inserted as a start of a comment when using the function comment.
Comment end
String to be inserted as the end of a comment when using the function comment.
Quote string
When you include a file into the current buffer (using the insert-file function from the Edit menu), you have the option of "quoting" that file. If a file is quoted, the quote string defined here is used as a prefix to every line.
Preferences are saved as soon as they are defined and retained for future sessions. They are stored in a file named ".red-prefs" in the user's home directory.

2. Key Bindings

Changing key bindings allows a user to change the function that is called by a given key. Several keys can call the same function. All keys can be combined with one or more of the three modifier keys Shift, Control, Alt. A maximum of two modifier keys is recognised for each key combination.

To view or change the key bindings, call key-bindings (by default on Alt-k and in the Options menu). This opens a dialog.

The Defaults button can be used to revert the key bindings to their default values. This operation can not be undone!

The key bindings are stored in a file named ".red-key-bindings" in the user's home directory. Removing this file causes Red to revert to default bindings. A set of key bindings can be given to another user by copying this file into the user's home directory.

3. Changing the Toolbar

Changing the toolbar is not yet implemented.

4. Changing Fonts

Changing fonts interactively is not yet implemented.

5. Changing Colours

Changing colours is not yet implemented.

6. X Resources

Although it might be confusing, the class name to use for changing some Red resources is Blue. This is, because Red is part of the Blue programming environment, and resources for that environment are for the resource class Blue. Some resources are for the class Red.

Red's X Resources are stored in a file called "Blue" which is typically located in /usr/lib/X11/app-defaults. You can change the settings there or add the following lines to your X resource database.

Blue.editFont: font
The default font used for editing.

Examples:

Blue.editFont: lucidasanstypewriter-12
Blue.editFont: lucidasanstypewriter-14
Blue.editFont: lucidasanstypewriter-bold-12
Blue.editFont: lucidasanstypewriter-bold-14
Blue.editFont: 8x13
Blue.editFont: 8x13bold
Blue.editFont: 9x15
The font must be a fixed character width font.

Blue.infoFont: font
The default font used in the information area.

Example:

Blue.infoFont: *menu*12*

Red.width: pixels
Initial width of the Red window in pixels. (Default: 696)

Red.height: pixels
Initial height of the Red window in pixels. (Default: 580)

Blue.redManCmd: command
This is a Unix command to display the Red manual in a browser. Typically, this would be a command that attempts to open the Red manual pages in a running browser (which fails if no browser is running). If this command fails, the command defined in redManCmd2 is executed.

Blue.redManCmd2: command
Command executed when redManCmd fails. Typically, this starts a browser known to exist on the system with the URL of the Red manual pages.

Blue.printCmd: command
The command to be executed when the "Print" function is called. The position of the file name is marked with a dollar sign ($). E.g.:

Blue.printCmd: /usr/ucb/lpr -h -P$
Blue.motd1: text
Blue.motd2: text
Message of the day: Line one and two of a text to be displayed in the information area at startup.


Main index