ExecHacksDoc.tioga
Copyright © 1985 by Xerox Corporation. All rights reserved.
Michael Plass, March 12, 1985 1:05:00 pm PST
Tim Diebert May 28, 1985 11:20:35 am PDT
Rick Beach, May 31, 1985 9:25:10 am PDT
Spreitzer, January 21, 1986 7:23:44 pm PST
Last Edited by: Gasbarro January 22, 1986 4:27:38 pm PST
EXECHACKS
CEDAR 6.0 — FOR INTERNAL XEROX USE ONLY
ExecHacks
Michael Plass
© Copyright 1985 Xerox Corporation. All rights reserved.
Abstract: ExecHacks adds some handy menu buttons to CommandTool viewers: "DoIt" and "Redo". "DoIt" deduces a filename from the selection, and depending on the extension executes some interesting command: for .Mesa files, it compiles; for .DF files it SModels and VerifiesDF, etc. "Redo" performs two functions. Left or Middle buttoning "Redo" will replay the command currently pointed to. Right buttoning "Redo" will list the last 10 commands issued to the CommandTool, with duplicates removed. ExecHacks also registers two commands. "Redo <string>" re-executes the most recent command beginning with "<string>". "History -d 10" does the same thing as right buttoning "Redo".
Keywords: DoIt, Redo, History, DWIM, Compile, SModel, VerifyDF, Copy, Command File, User Profile
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

For Internal Xerox Use Only
ExecHacks
ExecHacks adds some handy menu buttons to CommandTool viewers: "DoIt" and "Redo".
"DoIt" deduces a filename from the selection, and depending on the extension executes some interesting command: for .Mesa files, it compiles; for .DF files it SModels and VerifiesDF; .cm or .load files are simply invoked; and so on. The action perfomed is actually determined by user profile entries, and can be extended by the user. The association given above is from the defaults, which are given below. The "DoIt" operation is purely textual, and the command is executed in the current working directory of the command tool, which may be different from the directory containing the file, so watch your directories.
When the DoIt operation is invoked on a file with extension foo, ExecHacks looks for a user profile entry ExecHacks.For.foo, or ExecHacks.ForNoExtension if the filename has no extension. The command to be executed is derived from the entry by replacing every occurrence of the string "<base>" by the base of the filename. File names are parsed in the form <directory><base>.<ext>!<version>. (Note that because of some people's small-mindedness, only the base field is available at this time for substitution.)
"Redo" performs two functions. Left or Middle buttoning "Redo" will replay the command currently pointed to. If the selection is at the end of the CommandTool viewer or in another viewer the most recently issued command is executed. Right buttoning "Redo" will list the last 10 commands issued to the CommandTool, with duplicates removed. These can then be left buttoned to reexecute.
To use it, add "ExecHacks" to the CommandTool.PerLogin and CommandTool.PerCommandTool entries in your profile. The ExecHacks command affects only the command tool it is invoked from.
ExecHacks also implements a UNIX-like redo. Issuing the command

%
Redo fo
(in a command tool that has been hacked by ExecHacks) causes the most recent command whose name (excluding directory part) begins with fo. The command

% History -d 47
prints out the last 47 commands; if the number is omitted, 10 is used. The -d means to suppress duplicates. Also, a -% switch would suppress printing the prompt before each command. This is useful for building command files from history.
ExecHacks has some user profile entries:
ExecHacks.DoitButtonName: ROPE ← "DoIt"
The name to be used for the DoIt buttons posted in command tools.
ExecHacks.RedoButtonName: ROPE ← "Redo"
The name to be used for the redo buttons.
ExecHacks.For.Ext: ROPESELECT Ext FROM
(These are merely the defaults, turkey!)
Mesa, Cedar => "RCompile <base>"
Config => "Bind <base>"
cm, load => "<base>"
DF => "SModel <base>;\nVerifyDF <base>"
BCD => "Run <base>"
Profile => "Copy [User]<<base>>6.0> ← ///<base>.profile"
ENDCASE => "Blink"
This gives the command to be executed for files whose extension is Ext (disregarding case).
ExecHacks.ForNoExtension: ROPE ← "RCompile <base>"
This gives the command to be executed for files that have no extension.