# execute-tool(3)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

execute-tool - Execute a user defined shell tool

## SYNOPSIS

n execute-tool "tool-name"

## DESCRIPTION

execute-tool launches a predefined shell tool, the tools are typically defined by the user-setup(3) Tools page and executed using the MicroEmacs main Tools menu. See help on user-setup(3) for more information on the basic facilities given by execute-tool.

If the numeric argument n is supplied it is used as the tool name to be executed, otherwise the argument "tool-name" must be given.

A tool with a numeric name can be executed via a key binding, for example, to execute tool 3 (as defined by user-setup) to '`C-3`' add the following line to the user setup file:-

    3 global-bind-key execute-tool "C-3"

## NOTES

The registry entries for a tool must be located in registry directory "`/history/`$platform/tool/tool-name" where $platform is the current setting of variable $platform(5) and tool-name is the name of the tool as given to the command. The following registry entries are used:-

name

The name of the tool as displayed in the user-setup Tools dialog and the Main Tools menu. This is only used for tools `0` to `9`.

command

The command-line to be launched when 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.

flag

A bit based flag setting the tool characteristics, where:-

0x01

Enable current buffer saving.

0x02

Enable prompt before saving current buffer.

0x04

Enable all edited buffers saving.

0x08

Enable prompt before saving an edited buffer.

0x10

Enable output capturing.

0x20

Enable concurrent running, not available on all platforms, see variable $system(5).

bname

The name of the buffer to be used if the output is captured. 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.

If more than 10 tools are required (maximum number definable by user-setup) or names are preferred, it is recommended that the user-setup dialog is used to define the tool and then use the registry copy utility bound to '`c`' in a list-registry(2) buffer.

## SEE ALSO

user-setup(3), ipipe-shell-command(2), pipe-shell-command(2), shell-command(2), system(5).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>