GNU Emacs Calc 2.02 Manual
1.5.7 Other M-# Commands
Two more Calc-related commands are M-# g and M-# r,
which "grab" data from a selected region of a buffer into the
Calculator. The region is defined in the usual Emacs way, by
a "mark" placed at one end of the region, and the Emacs
cursor or "point" placed at the other.
The M-# g command reads the region in the usual left-to-right,
top-to-bottom order. The result is packaged into a Calc vector
of numbers and placed on the stack. Calc (in its standard
user interface) is then started. Type v u if you want
to unpack this vector into separate numbers on the stack. Also,
C-u M-# g interprets the region as a single number or
The M-# r command reads a rectangle, with the point and
mark defining opposite corners of the rectangle. The result
is a matrix of numbers on the Calculator stack.
Complementary to these is M-# y, which "yanks" the
value at the top of the Calc stack back into an editing buffer.
If you type M-# y while in such a buffer, the value is
yanked at the current position. If you type M-# y while
in the Calc buffer, Calc makes an educated guess as to which
editing buffer you want to use. The Calc window does not have
to be visible in order to use this command, as long as there
is something on the Calc stack.
Here, for reference, is the complete list of M-# commands.
The shift, control, and meta keys are ignored for the keystroke
Commands for turning Calc on and off:
- Turn Calc on or off, employing the same user interface as last time.
- Turn Calc on or off using its standard bottom-of-the-screen
interface. If Calc is already turned on but the cursor is not
in the Calc window, move the cursor into the window.
- Same as C, but don't select the new Calc window. If
Calc is already turned on and the cursor is in the Calc window,
move it out of that window.
- Control whether M-# c and M-# k use the full screen.
- Use Quick Mode for a single short calculation.
- Turn Calc Keypad mode on or off.
- Turn Calc Embedded mode on or off at the current formula.
- Turn Calc Embedded mode on or off, select the interesting part.
- Turn Calc Embedded mode on or off at the current word (number).
- Turn Calc on in a user-defined way, as defined by a Z I command.
- Quit Calc; turn off standard, Keypad, or Embedded mode if on.
(This is like q or OFF inside of Calc.)
Commands for moving data into and out of the Calculator:
- Grab the region into the Calculator as a vector.
- Grab the rectangular region into the Calculator as a matrix.
- Grab the rectangular region and compute the sums of its columns.
- Grab the rectangular region and compute the sums of its rows.
- Yank a value from the Calculator into the current editing buffer.
Commands for use with Embedded Mode:
- "Activate" the current buffer. Locate all formulas that
contain `:=' or `=>' symbols and record their locations
so that they can be updated automatically as variables are changed.
- Duplicate the current formula immediately below and select
- Insert a new formula at the current point.
- Move the cursor to the next active formula in the buffer.
- Move the cursor to the previous active formula in the buffer.
- Update (i.e., as if by the = key) the formula at the current point.
- Edit (as if by
calc-edit) the formula at the current point.
- Run the Emacs Info system to read the Calc manual.
(This is the same as h i inside of Calc.)
- Run the Emacs Info system to read the Calc Tutorial.
- Run the Emacs Info system to read the Calc Summary.
- Load Calc entirely into memory. (Normally the various parts
are loaded only as they are needed.)
- Read a region of written keystroke names (like `C-n a b c RET')
and record them as the current keyboard macro.
- (This is the "zero" digit key.) Reset the Calculator to
its default state: Empty stack, and default mode settings.
With any prefix argument, reset everything but the stack.