Next: , Previous: Keyboard Macros, Up: Programming

17.3 Invocation Macros

Calc provides one special keyboard macro, called up by C-x * z (calc-user-invocation), that is intended to allow you to define your own special way of starting Calc. To define this “invocation macro,” create the macro in the usual way with C-x ( and C-x ), then type Z I (calc-user-define-invocation). There is only one invocation macro, so you don't need to type any additional letters after Z I. From now on, you can type C-x * z at any time to execute your invocation macro.

For example, suppose you find yourself often grabbing rectangles of numbers into Calc and multiplying their columns. You can do this by typing C-x * r to grab, and V R : * to multiply columns. To make this into an invocation macro, just type C-x ( C-x * r V R : * C-x ), then Z I. Then, to multiply a rectangle of data, just mark the data in its buffer in the usual way and type C-x * z.

Invocation macros are treated like regular Emacs keyboard macros; all the special features described above for Z K-style macros do not apply. C-x * z is just like C-x e, except that it uses the macro that was last stored by Z I. (In fact, the macro does not even have to have anything to do with Calc!)

The m m command saves the last invocation macro defined by Z I along with all the other Calc mode settings. See General Mode Commands.