[net.emacs] saving macros???

kentb@uo-vax1.UUCP (05/11/84)

Is there a slick way to save a keyboard macro?  I'd like to put a keyboard
macro into a file,  reload it, and bind it to some key sequence.
Suggestions?

Kent L. Beck
{ tektronix | hp-pcd }!uoregon!uo-vax1!kentb

dyer@vaxuum.DEC (Example #22) (05/21/84)

Re: saving macros???___________________________________________________________
	Boy, that's a tall order.  If you're into heavy kludgery, there's a way
to do it:
	    o Use (edit-macro).  This will put your macro into a buffer
	      called ``Macro edit'' and you can edit it.
	    o Write the macro into a file.
	    o The next day, when you go back into EMACS, do (edit-macro).
	      The ``Macro edit'' buffer will reappear.
	    o Insert the file into the ``Macro edit'' buffer.
	This is known as a hack.  If there was a way to automate it, I'd like
to look at it.
	Now, as far as rebinding the macro to another key sequence, use the
(define-buffer-macro) function, which will make what's in that buffer become
the keyboard macro.  You can then use (define-keyboard-macro) to give the
macro a name and (bind-to-key) to bind the macro to a key.

	Or, if you'd like to try it, there's a (define-string-macro) function
that may or may not work if not called interactively.  It would make interes-
ting MLisp...
		<_Jym_>