diff --git a/twander.1 b/twander.1 index e441234..ebb093d 100644 --- a/twander.1 +++ b/twander.1 @@ -429,11 +429,11 @@ .SH LOCATION OF CONFIGURATION FILE \'twander\' needs a configuration file in order to define commands -available to be run. Although the program will run without a configuration -file present, it will warn you that it is doing so without any commands -defined. Not only are commands defined in this configuration file, -but keyboard bindings can optionally be assigned (changed from their -defaults) in this file. +available to the user. Although the program will run without a +configuration file present, it will warn you that it is doing so +without any commands defined. Not only are commands defined in this +configuration file, but keyboard bindings can optionally be assigned +(changed from their defaults) in this file. By default, the program expects to find configuration information in .B $HOME/.twander @@ -465,19 +465,114 @@ .SH CONFIGURATION FILE FORMAT -\'twander\' configuration files consist of freeform lines of -text. Each line is considered separately - no configuration -line may cross into the next line. Whitespace is ignored within -a line as are blank lines. +\'twander\' configuration files consist of freeform lines of text. +Each line is considered independently - no configuration line may +cross into the next line. Whitespace is ignored within a line as are +blank lines. -There are only three possible legal lines in a \'twander\' -configuration file: Comments, Variable Definitions, and -Command Definitions. Everything else is considered invalid. -\'twander\' will respond with errors or warnings as is -appropriate anytime it encounters a problem in a configuration -file. This is both true when the program initially loads as -well as during any subsequent configuration file reloads -initiated from the keyboard while running \'twander\'. +There are only four possible legal lines in a \'twander\' +configuration file: Comments, User-Defined Variables, Key Binding +Statements and Command Definitions. Everything else is considered +invalid. \'twander\' will respond with errors or warnings as is +appropriate anytime it encounters a problem in a configuration file. +An error will cause the program to terminate, but the program +continues to run after a warning. + +This is both true when the program initially loads as well as during +any subsequent configuration file reloads initiated from the keyboard +while running \'twander\'. + +See the ".twander" file provided with the program distribution +for examples of valid configuration statements. + +.SS Comments + +A comment is begun with the "#" character which may exist +anywhere on the line. \'twander\' ignores everything from the +"#" to the end of that line without exception. This means +that the "#" cannot occur anywhere in a User-Defined Variable, +Key Binding Statement, or Command Definition. + +.SS User-Defined Variables + +Variables are defined using the syntax: + +.nf +Variable-Name = Replacement-String + +For example, + +EDITOR = emacs blah blah blah blah +.fi + +Later on, when defining a command, instead of typing in +"emacs blah blah blah blah", you can just refer to the +variable [EDITOR] - the brackets indicate you are +.B referring +to a variable. + +Why bother with this? Because it makes maintaining complex +configuration files easier. If you look in the example ".twander" +configuration file provided in the program distribution, you will see +this is mighty handy when setting up complex "xterm" sessions, for +example. + +Here are several other subtleties regarding User-Defined Variables: + +.PD 000 +.IP \(bu 4 +The Variable Name is case-sensitive - [EDITOR], [Editor], +and [editor] all refer to different variables. + +.IP \(bu 4 +Variables must be defined before they are referenced - no forward +references are permitted. + +.IP \(bu 4 +The "=" is what separates the Variable Name from the replacement +string. Therefore, the "=" cannot ever be part of a Variable +Name. Neither can the "#", as described previously. Finally, +a Variable Name cannot begin with "$" (see next bullet). + +Other than these minor restrictions, both Variable Names and +Replacement Characters can be any string of characters of any length. +Good judgement would suggest that Variable Names should be somewhat +self-descriptive and of reasonable length - i.e., Much shorter than +the replacement string! + +.IP \(bu 4 +A Variable Name must never begin with "$". This is because a Command +Definition containing a string in the form [$something] is understood +by \'twander\' to be a reference to an +.B Environment Variable, +in this case, "$something". If you do something like: + +.nf +$MYVAR = some-string +.fi + +You will never be able to subsequently reference it because, +[$MYVAR] tells \'twander\' to look in the current environment, +not its own symbol table to resolve the reference. + +.IP \(bu 4 +Variable Names may not be redefined. This means you can only +define a given Variable Name once per configuration file +.B AND +you cannot use a variable name which matches either one of the +Builtin Variables (used in Command Definitions) or one of the +Program Function Names (used to change key bindings). +.PD +.P + +.SS Key Binding Statements + +Key Binding Statements look just like Variable Definitions. +The \'twander\' parser automatically figures out which is +which. For details of key binding, see the section below entitled, +.B CHANGING KEYBOARD BINDINGS. + +.SS Command Definitions .SH CHANGING KEYBOARD BINDINGS