home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / emacs / 2931 < prev    next >
Encoding:
Text File  |  1992-08-22  |  2.3 KB  |  63 lines

  1. Newsgroups: comp.emacs
  2. Path: sparky!uunet!math.fu-berlin.de!zrz.tu-berlin.de!mailgzrz.tu-berlin.de!nickel
  3. From: nickel@cs.tu-berlin.de (Juergen Nickelsen)
  4. Subject: Re: How to save a macro?
  5. In-Reply-To: burky@austin.ibm.com's message of 21 Aug 92 20:41:20 GMT
  6. Message-ID: <NICKEL.92Aug22170945@desaster.cs.tu-berlin.de>
  7. Lines: 48
  8. Sender: news@mailgzrz.tu-berlin.de (News Manager)
  9. Nntp-Posting-Host: desaster.cs.tu-berlin.de
  10. Reply-To: nickel@cs.tu-berlin.de
  11. Organization: STONE Project, Technical University of Berlin, Germany
  12. References: <1992Aug21.204120.22665@awdprime.austin.ibm.com>
  13. Date: Sat, 22 Aug 1992 15:09:47 GMT
  14.  
  15. I got a "user unknown" when sending a mail reply to this address:
  16.  
  17. While talking to netmail.austin.ibm.com:
  18. >>> RCPT To:<burky@austin.ibm.com>
  19. <<< 550 <burky@austin.ibm.com>... User unknown: No such file or directory
  20. 550 <burky@austin.ibm.com>... User unknown
  21.  
  22. , so I'm following up, sorry.
  23.  
  24. (BTW, this isn't the first time that happened to me with a
  25. "user@austin.ibm.com" address, does anyone know what's wrong with
  26. these addresses?)
  27.  
  28.  
  29. From: burky@austin.ibm.com
  30. Newsgroups: comp.emacs
  31.  
  32. > If a keyboard macro is made with C-x C-( ... C-x C-), can it be saved in
  33. > some way so that it will be defined when emacs starts up again?
  34.  
  35. Yes. Give the macro a name (with M-x name-last-kbd-macro RET), then
  36. edit your .emacs file, type M-x insert-kbd-macro RET and the name of
  37. the macro. This inserts an "fset" form which binds the keyboard macro
  38. to a function name.
  39.  
  40. You can then bind it to a key permanantly with (assuming
  41. the name of the macro is "my-own-kdb-macro", and the key you want to
  42. bind it to is "C-c m")
  43.  
  44.     (global-set-key "\C-cm" 'my-own-kdb-macro)
  45.  
  46. > Alternatively, Is it possible to define a macro for several keystrokes in 
  47. > your .emacs file?
  48.  
  49. At the place in the "global-set-key" form where "'my-own-kdb-macro"
  50. stands in the example above, you can put a string with the characters
  51. you want to be "typed" in the keyboard macro. You have to insert
  52. control and meta characters with quoted-insert (usually bound to C-q),
  53. of course.
  54.  
  55. However, the better approach for permanently needed macros is to write
  56. a Lisp function and bind that to a key -- this is far more flexible
  57. and powerful than a keyboard macro can be. If you often need custom
  58. functions, you really should consider diving into Emacs Lisp (if you
  59. haven't done that yet).
  60.  
  61. --
  62. Juergen Nickelsen
  63.