DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ m

⟦89c773e6c⟧

    Length: 2356 (0x934)
    Names: »macros.elc«

Derivation

└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
    └─ ⟦this⟧ »EUUGD11/gnu-31mar87/emacs/lisp/macros.elc« 

Hex Dump

0x000…020 0a 28 64 65 66 75 6e 20 6e 61 6d 65 2d 6c 61 73 74 2d 6b 62 64 2d 6d 61 63 72 6f 20 28 73 79 6d   ┆ (defun name-last-kbd-macro (sym┆
0x020…040 62 6f 6c 29 20 22 5c 0a 41 73 73 69 67 6e 20 61 20 6e 61 6d 65 20 74 6f 20 74 68 65 20 6c 61 73   ┆bol) "\ Assign a name to the las┆
0x040…060 74 20 6b 65 79 62 6f 61 72 64 20 6d 61 63 72 6f 20 64 65 66 69 6e 65 64 2e 0a 4f 6e 65 20 61 72   ┆t keyboard macro defined. One ar┆
0x060…080 67 2c 20 61 20 73 79 6d 62 6f 6c 2c 20 77 68 69 63 68 20 69 73 20 74 68 65 20 6e 61 6d 65 20 74   ┆g, a symbol, which is the name t┆
0x080…0a0 6f 20 64 65 66 69 6e 65 2e 0a 54 68 65 20 73 79 6d 62 6f 6c 27 73 20 66 75 6e 63 74 69 6f 6e 20   ┆o define. The symbol's function ┆
0x0a0…0c0 64 65 66 69 6e 69 74 69 6f 6e 20 62 65 63 6f 6d 65 73 20 74 68 65 20 6b 65 79 62 6f 61 72 64 20   ┆definition becomes the keyboard ┆
0x0c0…0e0 6d 61 63 72 6f 20 73 74 72 69 6e 67 2e 0a 53 75 63 68 20 61 20 5c 22 66 75 6e 63 74 69 6f 6e 5c   ┆macro string. Such a \"function\┆
0x0e0…100 22 20 63 61 6e 6e 6f 74 20 62 65 20 63 61 6c 6c 65 64 20 66 72 6f 6d 20 4c 69 73 70 2c 20 62 75   ┆" cannot be called from Lisp, bu┆
0x100…120 74 20 69 74 20 69 73 20 61 20 76 61 6c 69 64 20 63 6f 6d 6d 61 6e 64 0a 64 65 66 69 6e 69 74 69   ┆t it is a valid command definiti┆
0x120…140 6f 6e 20 66 6f 72 20 74 68 65 20 65 64 69 74 6f 72 20 63 6f 6d 6d 61 6e 64 20 6c 6f 6f 70 2e 22   ┆on for the editor command loop."┆
0x140…160 20 28 69 6e 74 65 72 61 63 74 69 76 65 20 22 53 4e 61 6d 65 20 66 6f 72 20 6c 61 73 74 20 6b 62   ┆ (interactive "SName for last kb┆
0x160…180 64 20 6d 61 63 72 6f 3a 20 22 29 20 28 62 79 74 65 2d 63 6f 64 65 20 22 c2 88 08 86 09 00 c3 c4   ┆d macro: ") (byte-code "        ┆
0x180…1a0 21 88 c5 09 21 85 1b 00 09 4b 3b 3f 85 1b 00 c3 c6 09 5c 22 88 09 08 4d 87 22 20 5b 6c 61 73 74   ┆!   !    K;?      \"   M " [last┆
0x1a0…1c0 2d 6b 62 64 2d 6d 61 63 72 6f 20 73 79 6d 62 6f 6c 20 6e 69 6c 20 65 72 72 6f 72 20 22 4e 6f 20   ┆-kbd-macro symbol nil error "No ┆
0x1c0…1e0 6b 65 79 62 6f 61 72 64 20 6d 61 63 72 6f 20 64 65 66 69 6e 65 64 22 20 66 62 6f 75 6e 64 70 20   ┆keyboard macro defined" fboundp ┆
0x1e0…200 22 46 75 6e 63 74 69 6f 6e 20 25 73 20 69 73 20 61 6c 72 65 61 64 79 20 64 65 66 69 6e 65 64 20   ┆"Function %s is already defined ┆
0x200…220 61 6e 64 20 6e 6f 74 20 61 20 6b 65 79 62 6f 61 72 64 20 6d 61 63 72 6f 2e 22 5d 20 35 29 29 0a   ┆and not a keyboard macro."] 5)) ┆
0x220…240 0a 28 64 65 66 75 6e 20 69 6e 73 65 72 74 2d 6b 62 64 2d 6d 61 63 72 6f 20 28 6d 61 63 72 6f 6e   ┆ (defun insert-kbd-macro (macron┆
0x240…260 61 6d 65 20 26 6f 70 74 69 6f 6e 61 6c 20 6b 65 79 73 29 20 22 5c 0a 49 6e 73 65 72 74 20 69 6e   ┆ame &optional keys) "\ Insert in┆
0x260…280 20 62 75 66 66 65 72 20 74 68 65 20 64 65 66 69 6e 69 74 69 6f 6e 20 6f 66 20 6b 62 64 20 6d 61   ┆ buffer the definition of kbd ma┆
0x280…2a0 63 72 6f 20 4e 41 4d 45 2c 20 61 73 20 4c 69 73 70 20 63 6f 64 65 2e 0a 53 65 63 6f 6e 64 20 61   ┆cro NAME, as Lisp code. Second a┆
0x2a0…2c0 72 67 75 6d 65 6e 74 20 4b 45 59 53 20 6e 6f 6e 2d 6e 69 6c 20 6d 65 61 6e 73 20 61 6c 73 6f 20   ┆rgument KEYS non-nil means also ┆
0x2c0…2e0 72 65 63 6f 72 64 20 74 68 65 20 6b 65 79 73 20 69 74 20 69 73 20 6f 6e 2e 0a 20 28 54 68 69 73   ┆record the keys it is on.  (This┆
0x2e0…300 20 69 73 20 74 68 65 20 70 72 65 66 69 78 20 61 72 67 75 6d 65 6e 74 2c 20 77 68 65 6e 20 63 61   ┆ is the prefix argument, when ca┆
0x300…320 6c 6c 69 6e 67 20 69 6e 74 65 72 61 63 74 69 76 65 6c 79 2e 29 0a 0a 54 68 69 73 20 4c 69 73 70   ┆lling interactively.)  This Lisp┆
0x320…340 20 63 6f 64 65 20 77 69 6c 6c 2c 20 77 68 65 6e 20 65 78 65 63 75 74 65 64 2c 20 64 65 66 69 6e   ┆ code will, when executed, defin┆
0x340…360 65 20 74 68 65 20 6b 62 64 20 6d 61 63 72 6f 20 77 69 74 68 20 74 68 65 0a 73 61 6d 65 20 64 65   ┆e the kbd macro with the same de┆
0x360…380 66 69 6e 69 74 69 6f 6e 20 69 74 20 68 61 73 20 6e 6f 77 2e 20 20 49 66 20 79 6f 75 20 73 61 79   ┆finition it has now.  If you say┆
0x380…3a0 20 74 6f 20 72 65 63 6f 72 64 20 74 68 65 20 6b 65 79 73 2c 0a 74 68 65 20 4c 69 73 70 20 63 6f   ┆ to record the keys, the Lisp co┆
0x3a0…3c0 64 65 20 77 69 6c 6c 20 61 6c 73 6f 20 72 65 62 69 6e 64 20 74 68 6f 73 65 20 6b 65 79 73 20 74   ┆de will also rebind those keys t┆
0x3c0…3e0 6f 20 74 68 65 20 6d 61 63 72 6f 2e 0a 4f 6e 6c 79 20 67 6c 6f 62 61 6c 20 6b 65 79 20 62 69 6e   ┆o the macro. Only global key bin┆
0x3e0…400 64 69 6e 67 73 20 61 72 65 20 72 65 63 6f 72 64 65 64 20 73 69 6e 63 65 20 65 78 65 63 75 74 69   ┆dings are recorded since executi┆
0x400…420 6e 67 20 74 68 69 73 20 4c 69 73 70 20 63 6f 64 65 0a 61 6c 77 61 79 73 20 6d 61 6b 65 73 20 67   ┆ng this Lisp code always makes g┆
0x420…440 6c 6f 62 61 6c 20 62 69 6e 64 69 6e 67 73 2e 0a 0a 54 6f 20 73 61 76 65 20 61 20 6b 62 64 20 6d   ┆lobal bindings.  To save a kbd m┆
0x440…460 61 63 72 6f 2c 20 76 69 73 69 74 20 61 20 66 69 6c 65 20 6f 66 20 4c 69 73 70 20 63 6f 64 65 20   ┆acro, visit a file of Lisp code ┆
0x460…480 73 75 63 68 20 61 73 20 79 6f 75 72 20 7e 2f 2e 65 6d 61 63 73 2c 0a 75 73 65 20 74 68 69 73 20   ┆such as your ~/.emacs, use this ┆
0x480…4a0 63 6f 6d 6d 61 6e 64 2c 20 61 6e 64 20 74 68 65 6e 20 73 61 76 65 20 74 68 65 20 66 69 6c 65 2e   ┆command, and then save the file.┆
0x4a0…4c0 22 20 28 69 6e 74 65 72 61 63 74 69 76 65 20 22 43 49 6e 73 65 72 74 20 6b 62 64 20 6d 61 63 72   ┆" (interactive "CInsert kbd macr┆
0x4c0…4e0 6f 20 28 6e 61 6d 65 29 3a 20 0a 50 22 29 20 28 62 79 74 65 2d 63 6f 64 65 20 22 c2 88 c3 63 88   ┆o (name):  P") (byte-code "   c ┆
0x4e0…500 c4 08 70 5c 22 88 c5 63 88 c4 08 4b 70 5c 22 88 c6 63 88 09 85 40 00 c7 08 c2 5c 22 19 09 85 3f   ┆  p\"  c   Kp\"  c   @    \"   ?┆
0x500…520 00 c8 63 88 c4 09 40 70 5c 22 88 c9 63 88 c4 08 70 5c 22 88 c6 63 88 09 41 89 11 88 82 1f 00 29   ┆  c   @p\"  c   p\"  c  A      )┆
0x520…540 87 22 20 5b 6d 61 63 72 6f 6e 61 6d 65 20 6b 65 79 73 20 6e 69 6c 20 22 28 66 73 65 74 20 27 22   ┆ " [macroname keys nil "(fset '"┆
0x540…560 20 70 72 69 6e 31 20 22 0a 20 20 20 22 20 22 29 0a 22 20 77 68 65 72 65 2d 69 73 2d 69 6e 74 65   ┆ prin1 "    " ") " where-is-inte┆
0x560…580 72 6e 61 6c 20 22 28 67 6c 6f 62 61 6c 2d 73 65 74 2d 6b 65 79 20 22 20 22 20 27 22 5d 20 38 29   ┆rnal "(global-set-key " " '"] 8)┆
0x580…5a0 29 0a 0a 28 64 65 66 75 6e 20 6b 62 64 2d 6d 61 63 72 6f 2d 71 75 65 72 79 20 28 66 6c 61 67 29   ┆)  (defun kbd-macro-query (flag)┆
0x5a0…5c0 20 22 5c 0a 51 75 65 72 79 20 75 73 65 72 20 64 75 72 69 6e 67 20 6b 62 64 20 6d 61 63 72 6f 20   ┆ "\ Query user during kbd macro ┆
0x5c0…5e0 65 78 65 63 75 74 69 6f 6e 2e 0a 57 69 74 68 20 70 72 65 66 69 78 20 61 72 67 75 6d 65 6e 74 2c   ┆execution. With prefix argument,┆
0x5e0…600 20 65 6e 74 65 72 73 20 72 65 63 75 72 73 69 76 65 20 65 64 69 74 2c 0a 20 72 65 61 64 69 6e 67   ┆ enters recursive edit,  reading┆
0x600…620 20 6b 65 79 62 6f 61 72 64 20 63 6f 6d 6d 61 6e 64 73 20 65 76 65 6e 20 77 69 74 68 69 6e 20 61   ┆ keyboard commands even within a┆
0x620…640 20 6b 62 64 20 6d 61 63 72 6f 2e 0a 20 59 6f 75 20 63 61 6e 20 67 69 76 65 20 64 69 66 66 65 72   ┆ kbd macro.  You can give differ┆
0x640…660 65 6e 74 20 63 6f 6d 6d 61 6e 64 73 20 65 61 63 68 20 74 69 6d 65 20 74 68 65 20 6d 61 63 72 6f   ┆ent commands each time the macro┆
0x660…680 20 65 78 65 63 75 74 65 73 2e 0a 57 69 74 68 6f 75 74 20 70 72 65 66 69 78 20 61 72 67 75 6d 65   ┆ executes. Without prefix argume┆
0x680…6a0 6e 74 2c 20 72 65 61 64 73 20 61 20 63 68 61 72 61 63 74 65 72 2e 20 20 59 6f 75 72 20 6f 70 74   ┆nt, reads a character.  Your opt┆
0x6a0…6c0 69 6f 6e 73 20 61 72 65 3a 0a 20 53 70 61 63 65 20 2d 2d 20 65 78 65 63 75 74 65 20 74 68 65 20   ┆ions are:  Space -- execute the ┆
0x6c0…6e0 72 65 73 74 20 6f 66 20 74 68 65 20 6d 61 63 72 6f 2e 0a 20 44 45 4c 20 2d 2d 20 73 6b 69 70 20   ┆rest of the macro.  DEL -- skip ┆
0x6e0…700 74 68 65 20 72 65 73 74 20 6f 66 20 74 68 65 20 6d 61 63 72 6f 3b 20 73 74 61 72 74 20 6e 65 78   ┆the rest of the macro; start nex┆
0x700…720 74 20 72 65 70 65 74 69 74 69 6f 6e 2e 0a 20 43 2d 64 20 2d 2d 20 73 6b 69 70 20 72 65 73 74 20   ┆t repetition.  C-d -- skip rest ┆
0x720…740 6f 66 20 74 68 65 20 6d 61 63 72 6f 20 61 6e 64 20 64 6f 6e 27 74 20 72 65 70 65 61 74 20 69 74   ┆of the macro and don't repeat it┆
0x740…760 20 61 6e 79 20 6d 6f 72 65 2e 0a 20 43 2d 72 20 2d 2d 20 65 6e 74 65 72 20 61 20 72 65 63 75 72   ┆ any more.  C-r -- enter a recur┆
0x760…780 73 69 76 65 20 65 64 69 74 2c 20 74 68 65 6e 20 6f 6e 20 65 78 69 74 20 61 73 6b 20 61 67 61 69   ┆sive edit, then on exit ask agai┆
0x780…7a0 6e 20 66 6f 72 20 61 20 63 68 61 72 61 63 74 65 72 0a 20 43 2d 6c 20 2d 2d 20 72 65 64 69 73 70   ┆n for a character  C-l -- redisp┆
0x7a0…7c0 6c 61 79 20 73 63 72 65 65 6e 20 61 6e 64 20 61 73 6b 20 61 67 61 69 6e 2e 22 20 28 69 6e 74 65   ┆lay screen and ask again." (inte┆
0x7c0…7e0 72 61 63 74 69 76 65 20 22 50 22 29 20 28 62 79 74 65 2d 63 6f 64 65 20 22 c3 88 08 86 0d 00 09   ┆ractive "P") (byte-code "       ┆
0x7e0…800 86 0d 00 c7 c8 21 88 0a 83 1c 00 c3 c3 19 18 c9 20 2a 82 87 00 08 3f 83 25 00 c3 82 87 00 c5 1c   ┆     !           *    ? %       ┆
0x800…820 0c 85 86 00 c3 c3 19 18 ca cb 21 88 72 2a 1e 06 0e 06 cc 55 83 44 00 c3 89 14 82 81 00 0e 06 cd   ┆          ! r*     U D          ┆
0x820…840 55 83 55 00 c3 89 14 88 ce 89 10 82 81 00 0e 06 cf 55 83 66 00 c3 89 14 88 c5 89 10 82 81 00 0e   ┆U U              U f            ┆
0x840…860 06 d0 55 83 73 00 d1 c3 21 82 81 00 0e 06 d2 55 85 81 00 c3 c3 19 18 c9 20 2a 29 88 82 27 00 29   ┆  U s   !      U         *)  ' )┆
0x860…880 87 22 20 5b 65 78 65 63 75 74 69 6e 67 2d 6d 61 63 72 6f 20 64 65 66 69 6e 69 6e 67 2d 6b 62 64   ┆ " [executing-macro defining-kbd┆
0x880…8a0 2d 6d 61 63 72 6f 20 66 6c 61 67 20 6e 69 6c 20 6c 6f 6f 70 20 74 20 63 68 61 72 20 65 72 72 6f   ┆-macro flag nil loop t char erro┆
0x8a0…8c0 72 20 22 4e 6f 74 20 64 65 66 69 6e 69 6e 67 20 6f 72 20 65 78 65 63 75 74 69 6e 67 20 6b 62 64   ┆r "Not defining or executing kbd┆
0x8c0…8e0 20 6d 61 63 72 6f 22 20 72 65 63 75 72 73 69 76 65 2d 65 64 69 74 20 6d 65 73 73 61 67 65 20 22   ┆ macro" recursive-edit message "┆
0x8e0…900 50 72 6f 63 65 65 64 20 77 69 74 68 20 6d 61 63 72 6f 3f 20 28 53 70 61 63 65 2c 20 44 45 4c 2c   ┆Proceed with macro? (Space, DEL,┆
0x900…920 20 43 2d 64 2c 20 43 2d 72 20 6f 72 20 43 2d 6c 29 20 22 20 33 32 20 31 32 37 20 22 22 20 34 20   ┆ C-d, C-r or C-l) " 32 127 "" 4 ┆
0x920…934 31 32 20 72 65 63 65 6e 74 65 72 20 31 38 5d 20 37 29 29 0a   ┆12 recenter 18] 7)) ┆