UniversalArgument

Description

Mark an int, bool, or int? parameter to receive the universal argument.

Many commands can benefit from having a boolean flag or integer count. Although a command may prompt the user for a boolean or integer directly, UniversalArgument allows the user to provide this argument only when they choose to and with a convenient "universal" key binding.

For clarity, M-x display-universal-argument shows the numerical and boolean value of its universal argument. If no argument is given, the count is 1, and the boolean value is false. If an argument is given, the count is 4, and the boolean value is true. If the argument is given a numerical count of 10, the count is 10 and the boolean value is true. If two C-us are given, the numerical value is 16 and the boolean value is true. You can run these commands and variations to see for yourself.

M-x display-universal-argument

1 False

C-u M-x display-universal-argument

4 True

C-u 1 0 M-x display-universal-argument

10 True

C-u C-u M-x display-universal-argument

16 True

[Command]
public string DisplayUniversalArgument([UniversalArgument]
int prefix,
[UniversalArgument]
bool boolPrefix) {
return string.Format("{0} {1}", prefix, boolPrefix);
}