diff --git a/twander.1 b/twander.1 index dd21556..ac53648 100644 --- a/twander.1 +++ b/twander.1 @@ -614,7 +614,7 @@ .nf Var1 = [$PAGER] Var2 = command-arguments -V = [Var1] [Var2] [DSELECTIONS] +V = [Var1] [Var2] [DSELECTIONS] .fi Notice that since the right-hand side of User-Defined Variables @@ -627,14 +627,18 @@ .IP \(bu 4 While it is true that variables must be defined before they are referenced, \'twander\' only checks this when -.B commands are defined. -This is because User-Defined Variables are simply -string replacement instructions and do not actually cause a -nested variable to be dereferenced. This creates an interesting -situation. You edit your configuration file and add: +.B commands +are defined, not when variables are defined. This is because a +variable "definition" does nothing more than associate a symbol name +(the left side) with a replacement string (the right side) in the +symbol table. It is not until that string is actually referenced in a +Command String definition that \'twander\' does the variable +dereferencing that checks for validity. This creates an interesting +situation if you define an illegal variable, but never +actually use it. You edit your configuration file and add: .nf -foo = [BAD-VBL] +foo = [BAD-VBL] # Illegal! BAD-VBL is not defined anywhere bar = x[foo] .fi @@ -643,23 +647,22 @@ sting substitutions, we are not actually dereferencing any variables that appear on the right-hand side of a definition. -Say we add this to configuration file: +Now we add this to configuration file: .nf c mycommand blah blah blah [bar] .fi - Now we .B do get an error. Why? Because a [...] variable reference in a Command -Definition is always dereferenced, and in our example, the fact that -BAD-VBL is not defined anywhere is detected. +Definition is actually dereferenced, detecting the fact that no +definition for BAD-VBL exits. .P .SS Key Binding Statements -Key Binding Statements look just like Variable Definitions. The +Key Binding Statements look just like User-Defined Variables. The \'twander\' parser automatically figures out which is which. For a detailed explanation of key binding, see the section below entitled, .B CHANGING KEYBOARD BINDINGS. @@ -702,7 +705,6 @@ .nf # A simple Command Definition - m MyMore more somefile .fi @@ -720,7 +722,6 @@ .nf # Our command setup to run as a GUI window - m MyMore xterm -l -e more somefile .fi @@ -738,7 +739,6 @@ # Our command enhanced with a User-Defined Variable. # Remember that the variable has to be defined *before* # it is referenced. - XTERM = xterm -l -e # This defines the variable m MyMore [XTERM] more somefile # And the command then uses it .fi @@ -757,7 +757,6 @@ .nf # Our command using both a User-Defined Variable and # an Environment Variable to make it more general - XTERM = xterm -l -e m MyMore [XTERM] [$PAGER] somefile .fi @@ -782,9 +781,8 @@ .nf # Our command in its most generic form using # User-Defined, Environment, and Builtin Variables - XTERM = xterm -l -e -m MyMore [XTERM] [$PAGER] [DSELECTION] +m MyMore [XTERM] [$PAGER] [DSELECTION] .fi The "DSELECTION" builtin is what communicates the currently @@ -848,17 +846,14 @@ .nf # Copy a group of items to a location set by # the user at runtime - UnixCopy = cp -R Win32Copy = copy # Unix Version - -c UnixCP [UnixCopy] [DSELECTIONS] [PROMPT:Enter Destination] +c UnixCP [UnixCopy] [DSELECTIONS] [PROMPT:Enter Destination] # Win32 Version - -C Win32CP [UnixCopy] [DSELECTIONS] [PROMPT:Enter Destination] +C Win32CP [UnixCopy] [DSELECTIONS] [PROMPT:Enter Destination] .fi @@ -884,7 +879,7 @@ .IP \(bu 4 The results of all builtins are put inside double-quotes when they are replaced in the command string. This default is recommended -so that any builtin substitions of, say, file names with spaces +so that any builtin substitutions of, say, file names with spaces in them, will be properly recognized by your commands. You can suppress the addition of double-quotes by using the -t command line option when starting \'twander\'. @@ -895,7 +890,7 @@ define a generic Unix copy command: .nf -g gencopy cp -R [PROMPT:Enter Source] [PROMPT:Enter Destination] +g gencopy cp -R [PROMPT:Enter Source] [PROMPT:Enter Destination] .fi When the user presses "g" (or clicks on "gencopy" on the Command @@ -980,6 +975,9 @@ command definition. \'twander\' will actually interpret this as just another key binding command, in this case binding the program function QUITPROG to "something-or-other" - probably not what you intended. +Moreover, if you have a Command String somewhere with [QUITPROG] in it, +\'twander\' will declare and error and abort because it has no +User-Defined variable of that name in its symbol table. .IP \(bu 4 When you're done making changes to the configuration file, be sure to @@ -1012,7 +1010,7 @@ \'less\' to view files. You would expect that this entry might do it: .nf -V view less [DSELECTIONS] +V view less [DSELECTIONS] .fi Sadly, this will not work, at least not the way you expect.