Next: , Previous: Yanking Into Stack, Up: Kill and Yank

14.3 Saving into Registers

An alternative to killing and yanking stack entries is using registers in Calc. Saving stack entries in registers is like saving text in normal Emacs registers; although, like Calc's kill commands, register commands always operate on whole stack entries.

Registers in Calc are places to store stack entries for later use; each register is indexed by a single character. To store the current region (rounded up, of course, to include full stack entries) into a register, use the command r s (calc-copy-to-register). You will then be prompted for a register to use, the next character you type will be the index for the register. To store the region in register r, the full command will be r s r. With an argument, C-u r s r, the region being copied to the register will be deleted from the Calc buffer.

It is possible to add additional stack entries to a register. The command M-x calc-append-to-register will prompt for a register, then add the stack entries in the region to the end of the register contents. The command M-x calc-prepend-to-register will similarly prompt for a register and add the stack entries in the region to the beginning of the register contents. Both commands take C-u arguments, which will cause the region to be deleted after being added to the register.