Previous: , Up: Using Calc   [Contents][Index]

1.5.7 Other C-x * Commands

Two more Calc-related commands are C-x * g and C-x * 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 C-x * 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 C-x * g interprets the region as a single number or formula.

The C-x * 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 C-x * y, which “yanks” the value at the top of the Calc stack back into an editing buffer. If you type C-x * y while in such a buffer, the value is yanked at the current position. If you type C-x * 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 C-x * commands. The shift, control, and meta keys are ignored for the keystroke following C-x *.

Commands for turning Calc on and off:

*

Turn Calc on or off, employing the same user interface as last time.

=, +, -, /, \, &, #

Alternatives for *.

C

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.

O

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.

B

Control whether C-x * c and C-x * k use the full screen.

Q

Use Quick mode for a single short calculation.

K

Turn Calc Keypad mode on or off.

E

Turn Calc Embedded mode on or off at the current formula.

J

Turn Calc Embedded mode on or off, select the interesting part.

W

Turn Calc Embedded mode on or off at the current word (number).

Z

Turn Calc on in a user-defined way, as defined by a Z I command.

X

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:

G

Grab the region into the Calculator as a vector.

R

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.

Y

Yank a value from the Calculator into the current editing buffer.

Commands for use with Embedded mode:

A

“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.

D

Duplicate the current formula immediately below and select the duplicate.

F

Insert a new formula at the current point.

N

Move the cursor to the next active formula in the buffer.

P

Move the cursor to the previous active formula in the buffer.

U

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.

Miscellaneous commands:

I

Run the Emacs Info system to read the Calc manual. (This is the same as h i inside of Calc.)

T

Run the Emacs Info system to read the Calc Tutorial.

S

Run the Emacs Info system to read the Calc Summary.

L

Load Calc entirely into memory. (Normally the various parts are loaded only as they are needed.)

M

Read a region of written keystroke names (like C-n a b c RET) and record them as the current keyboard macro.

0

(This is the “zero” digit key.) Reset the Calculator to its initial state: Empty stack, and initial mode settings.

Previous: Embedded Mode (Overview), Up: Using Calc   [Contents][Index]