Emacs/emacs/Number-Registers
Next: File Registers, Previous: Configuration Registers, Up: Registers [Contents][Index]
13.5 Keeping Numbers in Registers
There are commands to store a number in a register, to insert the number in the buffer in decimal, and to increment it. These commands can be useful in keyboard macros (see Keyboard Macros).
- C-u
number
C-x r nr
Store
number
into registerr
(number-to-register
).- C-u
number
C-x r +r
If
r
contains a number, increment the number in that register bynumber
. Note that command C-x r + (increment-register
) behaves differently ifr
contains text. See Text Registers.- C-x r i
r
Insert the number from register
r
into the buffer.
C-x r i is the same command used to insert any other sort of register contents into the buffer. C-x r + with no numeric argument increments the register value by 1; C-x r n with no numeric argument stores zero in the register.