When the you invoke a command it is often useful to be able to specify arguments which the command will act on. Prefix arguments are used for this purpose. They are called prefix arguments since they are entered before the command is invoked, and therefore prefix the command with an argument. Prefix arguments are usually integers.
The easiest way for a command to access these arguments is through its interactive declaration (see section Interactive Declarations) and the `N', `p' and `P' code letters.
The two variables prefix-arg and current-prefix-arg are used
to store prefix arguments. Whenever a command is invoked the value of
prefix-arg is moved to current-prefix-arg and prefix-arg
set to nil. This allows commands to set the prefix argument of
the next command by assigning a value to the prefix-arg variable.
These variables store an object known as the raw prefix argument, when a command is called it normally uses the numeric prefix argument, this is an integer created from the raw argument using the following rules,
nil the numeric value is 1.
The prefix-numeric-argument function is used to convert the
raw argument into a numeric value.
Go to the first, previous, next, last section, table of contents.