home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.emacs
- Path: sparky!uunet!math.fu-berlin.de!zrz.tu-berlin.de!mailgzrz.tu-berlin.de!nickel
- From: nickel@cs.tu-berlin.de (Juergen Nickelsen)
- Subject: Re: How to save a macro?
- In-Reply-To: burky@austin.ibm.com's message of 21 Aug 92 20:41:20 GMT
- Message-ID: <NICKEL.92Aug22170945@desaster.cs.tu-berlin.de>
- Lines: 48
- Sender: news@mailgzrz.tu-berlin.de (News Manager)
- Nntp-Posting-Host: desaster.cs.tu-berlin.de
- Reply-To: nickel@cs.tu-berlin.de
- Organization: STONE Project, Technical University of Berlin, Germany
- References: <1992Aug21.204120.22665@awdprime.austin.ibm.com>
- Date: Sat, 22 Aug 1992 15:09:47 GMT
-
- I got a "user unknown" when sending a mail reply to this address:
-
- While talking to netmail.austin.ibm.com:
- >>> RCPT To:<burky@austin.ibm.com>
- <<< 550 <burky@austin.ibm.com>... User unknown: No such file or directory
- 550 <burky@austin.ibm.com>... User unknown
-
- , so I'm following up, sorry.
-
- (BTW, this isn't the first time that happened to me with a
- "user@austin.ibm.com" address, does anyone know what's wrong with
- these addresses?)
-
-
- From: burky@austin.ibm.com
- Newsgroups: comp.emacs
-
- > If a keyboard macro is made with C-x C-( ... C-x C-), can it be saved in
- > some way so that it will be defined when emacs starts up again?
-
- Yes. Give the macro a name (with M-x name-last-kbd-macro RET), then
- edit your .emacs file, type M-x insert-kbd-macro RET and the name of
- the macro. This inserts an "fset" form which binds the keyboard macro
- to a function name.
-
- You can then bind it to a key permanantly with (assuming
- the name of the macro is "my-own-kdb-macro", and the key you want to
- bind it to is "C-c m")
-
- (global-set-key "\C-cm" 'my-own-kdb-macro)
-
- > Alternatively, Is it possible to define a macro for several keystrokes in
- > your .emacs file?
-
- At the place in the "global-set-key" form where "'my-own-kdb-macro"
- stands in the example above, you can put a string with the characters
- you want to be "typed" in the keyboard macro. You have to insert
- control and meta characters with quoted-insert (usually bound to C-q),
- of course.
-
- However, the better approach for permanently needed macros is to write
- a Lisp function and bind that to a key -- this is far more flexible
- and powerful than a keyboard macro can be. If you often need custom
- functions, you really should consider diving into Emacs Lisp (if you
- haven't done that yet).
-
- --
- Juergen Nickelsen
-