The shell-tool-setup dialog allows the user to configure up to 10 system commands, or tools, which can be executed via MicroEmacs Main Advanced Menu. The dialog configures the user's registry for the command
execute-tool(3) to be used. The execution of a tool can also be bound to a key, see execute-tool for more information.
The top half of the dialog consists of the 10 Tools (0-9) configuration buttons. Selecting one of these selects the current tool to be configured, the current tool is shown by the title in the middle of the dialog.
The lower half of the dialog configures the currently selected tool, as follows:-
Tool Name
Sets the displayed name of the tool. The tool name is used in the buttons in the top half of this dialog and in the MicroEmacs Main Tools Menu.
Command Line
Sets the system command-line to be launched whenever the tool is executed, the following special tokens may be used in the command-line which are substituted at execution:-
%ff
The current buffer's full file name, including the path.
%fp
The current buffer's file path.
%fn
The current buffer's file name without the path.
%fb
The current buffer's file base name, i.e. the file name without the path or the extension.
%fe
The current buffer's file extension with the '.' (e.g. ".emf"), set to the empty string if the file name does not have an extension.
Note that "%ff" is always the same as "%fp%fn" and "%fp%fb%fe". If any of these tokens are used, the tool will fail to execute if the current buffer does not have a file name.
Run Concurrently
If enabled, when the tool is executed the command is launched and run concurrently, allowing the user to continue working in MicroEmacs during the tools execution. This option is not available for all versions on MicroEmacs and forces the output to be captured. Enabling this option will force the use of command
ipipe-shell-command(2) to launch the tool.
Reread Current Buffer
When enabled the current buffer is reloaded when the command completes, this option is only available when Run Concurrently is disabled.
Capture Output
If enabled any output produced from the execution of the tool will be captured and inserted into a new buffer. When enabled the following two items, Buffer and Hide, may be specified. When disabled the command used to execute the tool is
shell-command(2), otherwise the command used is either
pipe-shell-command(2) or
ipipe-shell-command(2) depending on the setting of Run Concurrently.
Buffer
Specifies the buffer name the captured output should be dumped to, this option is only visible when Capture Output is enabled. The following special tokens may be used in the buffer name which are substituted at execution:-
%fn
The current buffer's file name without the path, set to the buffer name if the current buffer does not have a file name.
%fb
The current buffer's file base name, i.e. the file name without the path or the extension. Set to the buffer name if the current buffer does not have a file name.
%fe
The current buffer's file extension with the '.' (e.g. ".emf"), set to the empty string if the current buffer does not have a file name or it does not have an extension.
Note that "%fn" is always the same as "%fb%fe". Default buffer name when this field is left empty is "*command*", or "*icommand*" if Run Concurrently is enabled.
Hide
When enabled the tool output capture buffer is hidden, this option is only visible when Capture Output is enabled.
Current Buffer - Save and Prompt Before Saving
If the current buffer has been edited, enabling Save Current Buffer will automatically save the current buffer before executing the tool. This is particularly useful when the tool operates on the current buffer's file (e.g. compiles the file). If Prompt is also enabled the user will be prompted before the file is saved.
All Buffers - Save and Prompt Before Saving
If Save All Buffers is enabled, all edited buffers will be automatically saved before executing the tool. This is particularly useful when the tool may operate on multiple files (e.g. compilation of a project). If Prompt is also enabled the user will be prompted before each file is saved.