home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 6 / FreshFish_September1994.bin / bbs / gnu / emacs-18.59-src.lha / GNU / src / amiga / emacs-18.59 / lisp / macros.elc < prev    next >
Emacs Compiled Lisp  |  1991-01-10  |  2.3 KB

view JSON data     |     view as text     |     open on a Mac     |     open on a PC

This file was processed as: Emacs Compiled Lisp (other/emacsCompiledLisp).
This format is not currently supported by dexvert.

ConfidenceProgramDetectionMatch TypeSupport
1% dexvert Emacs Compiled Lisp (other/emacsCompiledLisp) magic Unsupported
100% file Emacs v18 byte-compiled Lisp data default
99% file data default
100% gt2 Kopftext: '(defun name-last-kbd-macro (symbol) ' default (weak)
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 0a 28 64 65 66 75 6e 20 | 6e 61 6d 65 2d 6c 61 73 |.(defun |name-las|
|00000010| 74 2d 6b 62 64 2d 6d 61 | 63 72 6f 20 28 73 79 6d |t-kbd-ma|cro (sym|
|00000020| 62 6f 6c 29 20 22 5c 0a | 41 73 73 69 67 6e 20 61 |bol) "\.|Assign a|
|00000030| 20 6e 61 6d 65 20 74 6f | 20 74 68 65 20 6c 61 73 | name to| the las|
|00000040| 74 20 6b 65 79 62 6f 61 | 72 64 20 6d 61 63 72 6f |t keyboa|rd macro|
|00000050| 20 64 65 66 69 6e 65 64 | 2e 0a 4f 6e 65 20 61 72 | defined|..One ar|
|00000060| 67 2c 20 61 20 73 79 6d | 62 6f 6c 2c 20 77 68 69 |g, a sym|bol, whi|
|00000070| 63 68 20 69 73 20 74 68 | 65 20 6e 61 6d 65 20 74 |ch is th|e name t|
|00000080| 6f 20 64 65 66 69 6e 65 | 2e 0a 54 68 65 20 73 79 |o define|..The sy|
|00000090| 6d 62 6f 6c 27 73 20 66 | 75 6e 63 74 69 6f 6e 20 |mbol's f|unction |
|000000a0| 64 65 66 69 6e 69 74 69 | 6f 6e 20 62 65 63 6f 6d |definiti|on becom|
|000000b0| 65 73 20 74 68 65 20 6b | 65 79 62 6f 61 72 64 20 |es the k|eyboard |
|000000c0| 6d 61 63 72 6f 20 73 74 | 72 69 6e 67 2e 0a 53 75 |macro st|ring..Su|
|000000d0| 63 68 20 61 20 5c 22 66 | 75 6e 63 74 69 6f 6e 5c |ch a \"f|unction\|
|000000e0| 22 20 63 61 6e 6e 6f 74 | 20 62 65 20 63 61 6c 6c |" cannot| be call|
|000000f0| 65 64 20 66 72 6f 6d 20 | 4c 69 73 70 2c 20 62 75 |ed from |Lisp, bu|
|00000100| 74 20 69 74 20 69 73 20 | 61 20 76 61 6c 69 64 20 |t it is |a valid |
|00000110| 63 6f 6d 6d 61 6e 64 0a | 64 65 66 69 6e 69 74 69 |command.|definiti|
|00000120| 6f 6e 20 66 6f 72 20 74 | 68 65 20 65 64 69 74 6f |on for t|he edito|
|00000130| 72 20 63 6f 6d 6d 61 6e | 64 20 6c 6f 6f 70 2e 22 |r comman|d loop."|
|00000140| 20 28 69 6e 74 65 72 61 | 63 74 69 76 65 20 22 53 | (intera|ctive "S|
|00000150| 4e 61 6d 65 20 66 6f 72 | 20 6c 61 73 74 20 6b 62 |Name for| last kb|
|00000160| 64 20 6d 61 63 72 6f 3a | 20 22 29 20 28 62 79 74 |d macro:| ") (byt|
|00000170| 65 2d 63 6f 64 65 20 22 | c2 88 08 86 09 00 c3 c4 |e-code "|........|
|00000180| 21 88 c5 09 21 85 1b 00 | 09 4b 3b 3f 85 1b 00 c3 |!...!...|.K;?....|
|00000190| c6 09 5c 22 88 09 08 4d | 87 22 20 5b 6c 61 73 74 |..\"...M|." [last|
|000001a0| 2d 6b 62 64 2d 6d 61 63 | 72 6f 20 73 79 6d 62 6f |-kbd-mac|ro symbo|
|000001b0| 6c 20 6e 69 6c 20 65 72 | 72 6f 72 20 22 4e 6f 20 |l nil er|ror "No |
|000001c0| 6b 65 79 62 6f 61 72 64 | 20 6d 61 63 72 6f 20 64 |keyboard| macro d|
|000001d0| 65 66 69 6e 65 64 22 20 | 66 62 6f 75 6e 64 70 20 |efined" |fboundp |
|000001e0| 22 46 75 6e 63 74 69 6f | 6e 20 25 73 20 69 73 20 |"Functio|n %s is |
|000001f0| 61 6c 72 65 61 64 79 20 | 64 65 66 69 6e 65 64 20 |already |defined |
|00000200| 61 6e 64 20 6e 6f 74 20 | 61 20 6b 65 79 62 6f 61 |and not |a keyboa|
|00000210| 72 64 20 6d 61 63 72 6f | 2e 22 5d 20 35 29 29 0a |rd macro|."] 5)).|
|00000220| 0a 28 64 65 66 75 6e 20 | 69 6e 73 65 72 74 2d 6b |.(defun |insert-k|
|00000230| 62 64 2d 6d 61 63 72 6f | 20 28 6d 61 63 72 6f 6e |bd-macro| (macron|
|00000240| 61 6d 65 20 26 6f 70 74 | 69 6f 6e 61 6c 20 6b 65 |ame &opt|ional ke|
|00000250| 79 73 29 20 22 5c 0a 49 | 6e 73 65 72 74 20 69 6e |ys) "\.I|nsert in|
|00000260| 20 62 75 66 66 65 72 20 | 74 68 65 20 64 65 66 69 | buffer |the defi|
|00000270| 6e 69 74 69 6f 6e 20 6f | 66 20 6b 62 64 20 6d 61 |nition o|f kbd ma|
|00000280| 63 72 6f 20 4e 41 4d 45 | 2c 20 61 73 20 4c 69 73 |cro NAME|, as Lis|
|00000290| 70 20 63 6f 64 65 2e 0a | 53 65 63 6f 6e 64 20 61 |p code..|Second a|
|000002a0| 72 67 75 6d 65 6e 74 20 | 4b 45 59 53 20 6e 6f 6e |rgument |KEYS non|
|000002b0| 2d 6e 69 6c 20 6d 65 61 | 6e 73 20 61 6c 73 6f 20 |-nil mea|ns also |
|000002c0| 72 65 63 6f 72 64 20 74 | 68 65 20 6b 65 79 73 20 |record t|he keys |
|000002d0| 69 74 20 69 73 20 6f 6e | 2e 0a 20 28 54 68 69 73 |it is on|.. (This|
|000002e0| 20 69 73 20 74 68 65 20 | 70 72 65 66 69 78 20 61 | is the |prefix a|
|000002f0| 72 67 75 6d 65 6e 74 2c | 20 77 68 65 6e 20 63 61 |rgument,| when ca|
|00000300| 6c 6c 69 6e 67 20 69 6e | 74 65 72 61 63 74 69 76 |lling in|teractiv|
|00000310| 65 6c 79 2e 29 0a 0a 54 | 68 69 73 20 4c 69 73 70 |ely.)..T|his Lisp|
|00000320| 20 63 6f 64 65 20 77 69 | 6c 6c 2c 20 77 68 65 6e | code wi|ll, when|
|00000330| 20 65 78 65 63 75 74 65 | 64 2c 20 64 65 66 69 6e | execute|d, defin|
|00000340| 65 20 74 68 65 20 6b 62 | 64 20 6d 61 63 72 6f 20 |e the kb|d macro |
|00000350| 77 69 74 68 20 74 68 65 | 0a 73 61 6d 65 20 64 65 |with the|.same de|
|00000360| 66 69 6e 69 74 69 6f 6e | 20 69 74 20 68 61 73 20 |finition| it has |
|00000370| 6e 6f 77 2e 20 20 49 66 | 20 79 6f 75 20 73 61 79 |now. If| you say|
|00000380| 20 74 6f 20 72 65 63 6f | 72 64 20 74 68 65 20 6b | to reco|rd the k|
|00000390| 65 79 73 2c 0a 74 68 65 | 20 4c 69 73 70 20 63 6f |eys,.the| Lisp co|
|000003a0| 64 65 20 77 69 6c 6c 20 | 61 6c 73 6f 20 72 65 62 |de will |also reb|
|000003b0| 69 6e 64 20 74 68 6f 73 | 65 20 6b 65 79 73 20 74 |ind thos|e keys t|
|000003c0| 6f 20 74 68 65 20 6d 61 | 63 72 6f 2e 0a 4f 6e 6c |o the ma|cro..Onl|
|000003d0| 79 20 67 6c 6f 62 61 6c | 20 6b 65 79 20 62 69 6e |y global| key bin|
|000003e0| 64 69 6e 67 73 20 61 72 | 65 20 72 65 63 6f 72 64 |dings ar|e record|
|000003f0| 65 64 20 73 69 6e 63 65 | 20 65 78 65 63 75 74 69 |ed since| executi|
|00000400| 6e 67 20 74 68 69 73 20 | 4c 69 73 70 20 63 6f 64 |ng this |Lisp cod|
|00000410| 65 0a 61 6c 77 61 79 73 | 20 6d 61 6b 65 73 20 67 |e.always| makes g|
|00000420| 6c 6f 62 61 6c 20 62 69 | 6e 64 69 6e 67 73 2e 0a |lobal bi|ndings..|
|00000430| 0a 54 6f 20 73 61 76 65 | 20 61 20 6b 62 64 20 6d |.To save| a kbd m|
|00000440| 61 63 72 6f 2c 20 76 69 | 73 69 74 20 61 20 66 69 |acro, vi|sit a fi|
|00000450| 6c 65 20 6f 66 20 4c 69 | 73 70 20 63 6f 64 65 20 |le of Li|sp code |
|00000460| 73 75 63 68 20 61 73 20 | 79 6f 75 72 20 7e 2f 2e |such as |your ~/.|
|00000470| 65 6d 61 63 73 2c 0a 75 | 73 65 20 74 68 69 73 20 |emacs,.u|se this |
|00000480| 63 6f 6d 6d 61 6e 64 2c | 20 61 6e 64 20 74 68 65 |command,| and the|
|00000490| 6e 20 73 61 76 65 20 74 | 68 65 20 66 69 6c 65 2e |n save t|he file.|
|000004a0| 22 20 28 69 6e 74 65 72 | 61 63 74 69 76 65 20 22 |" (inter|active "|
|000004b0| 43 49 6e 73 65 72 74 20 | 6b 62 64 20 6d 61 63 72 |CInsert |kbd macr|
|000004c0| 6f 20 28 6e 61 6d 65 29 | 3a 20 0a 50 22 29 20 28 |o (name)|: .P") (|
|000004d0| 62 79 74 65 2d 63 6f 64 | 65 20 22 c2 88 c3 63 88 |byte-cod|e "...c.|
|000004e0| c4 08 70 5c 22 88 c5 63 | 88 c4 08 4b 70 5c 22 88 |..p\"..c|...Kp\".|
|000004f0| c6 63 88 09 85 40 00 c7 | 08 c2 5c 22 19 09 85 3f |.c...@..|..\"...?|
|00000500| 00 c8 63 88 c4 09 40 70 | 5c 22 88 c9 63 88 c4 08 |..c...@p|\"..c...|
|00000510| 70 5c 22 88 c6 63 88 09 | 41 89 11 88 82 1f 00 29 |p\"..c..|A......)|
|00000520| 87 22 20 5b 6d 61 63 72 | 6f 6e 61 6d 65 20 6b 65 |." [macr|oname ke|
|00000530| 79 73 20 6e 69 6c 20 22 | 28 66 73 65 74 20 27 22 |ys nil "|(fset '"|
|00000540| 20 70 72 69 6e 31 20 22 | 0a 20 20 20 22 20 22 29 | prin1 "|. " ")|
|00000550| 0a 22 20 77 68 65 72 65 | 2d 69 73 2d 69 6e 74 65 |." where|-is-inte|
|00000560| 72 6e 61 6c 20 22 28 67 | 6c 6f 62 61 6c 2d 73 65 |rnal "(g|lobal-se|
|00000570| 74 2d 6b 65 79 20 22 20 | 22 20 27 22 5d 20 38 29 |t-key " |" '"] 8)|
|00000580| 29 0a 0a 28 64 65 66 75 | 6e 20 6b 62 64 2d 6d 61 |)..(defu|n kbd-ma|
|00000590| 63 72 6f 2d 71 75 65 72 | 79 20 28 66 6c 61 67 29 |cro-quer|y (flag)|
|000005a0| 20 22 5c 0a 51 75 65 72 | 79 20 75 73 65 72 20 64 | "\.Quer|y user d|
|000005b0| 75 72 69 6e 67 20 6b 62 | 64 20 6d 61 63 72 6f 20 |uring kb|d macro |
|000005c0| 65 78 65 63 75 74 69 6f | 6e 2e 0a 57 69 74 68 20 |executio|n..With |
|000005d0| 70 72 65 66 69 78 20 61 | 72 67 75 6d 65 6e 74 2c |prefix a|rgument,|
|000005e0| 20 65 6e 74 65 72 73 20 | 72 65 63 75 72 73 69 76 | enters |recursiv|
|000005f0| 65 20 65 64 69 74 2c 0a | 20 72 65 61 64 69 6e 67 |e edit,.| reading|
|00000600| 20 6b 65 79 62 6f 61 72 | 64 20 63 6f 6d 6d 61 6e | keyboar|d comman|
|00000610| 64 73 20 65 76 65 6e 20 | 77 69 74 68 69 6e 20 61 |ds even |within a|
|00000620| 20 6b 62 64 20 6d 61 63 | 72 6f 2e 0a 20 59 6f 75 | kbd mac|ro.. You|
|00000630| 20 63 61 6e 20 67 69 76 | 65 20 64 69 66 66 65 72 | can giv|e differ|
|00000640| 65 6e 74 20 63 6f 6d 6d | 61 6e 64 73 20 65 61 63 |ent comm|ands eac|
|00000650| 68 20 74 69 6d 65 20 74 | 68 65 20 6d 61 63 72 6f |h time t|he macro|
|00000660| 20 65 78 65 63 75 74 65 | 73 2e 0a 57 69 74 68 6f | execute|s..Witho|
|00000670| 75 74 20 70 72 65 66 69 | 78 20 61 72 67 75 6d 65 |ut prefi|x argume|
|00000680| 6e 74 2c 20 72 65 61 64 | 73 20 61 20 63 68 61 72 |nt, read|s a char|
|00000690| 61 63 74 65 72 2e 20 20 | 59 6f 75 72 20 6f 70 74 |acter. |Your opt|
|000006a0| 69 6f 6e 73 20 61 72 65 | 3a 0a 20 53 70 61 63 65 |ions are|:. Space|
|000006b0| 20 2d 2d 20 65 78 65 63 | 75 74 65 20 74 68 65 20 | -- exec|ute the |
|000006c0| 72 65 73 74 20 6f 66 20 | 74 68 65 20 6d 61 63 72 |rest of |the macr|
|000006d0| 6f 2e 0a 20 44 45 4c 20 | 2d 2d 20 73 6b 69 70 20 |o.. DEL |-- skip |
|000006e0| 74 68 65 20 72 65 73 74 | 20 6f 66 20 74 68 65 20 |the rest| of the |
|000006f0| 6d 61 63 72 6f 3b 20 73 | 74 61 72 74 20 6e 65 78 |macro; s|tart nex|
|00000700| 74 20 72 65 70 65 74 69 | 74 69 6f 6e 2e 0a 20 43 |t repeti|tion.. C|
|00000710| 2d 64 20 2d 2d 20 73 6b | 69 70 20 72 65 73 74 20 |-d -- sk|ip rest |
|00000720| 6f 66 20 74 68 65 20 6d | 61 63 72 6f 20 61 6e 64 |of the m|acro and|
|00000730| 20 64 6f 6e 27 74 20 72 | 65 70 65 61 74 20 69 74 | don't r|epeat it|
|00000740| 20 61 6e 79 20 6d 6f 72 | 65 2e 0a 20 43 2d 72 20 | any mor|e.. C-r |
|00000750| 2d 2d 20 65 6e 74 65 72 | 20 61 20 72 65 63 75 72 |-- enter| a recur|
|00000760| 73 69 76 65 20 65 64 69 | 74 2c 20 74 68 65 6e 20 |sive edi|t, then |
|00000770| 6f 6e 20 65 78 69 74 20 | 61 73 6b 20 61 67 61 69 |on exit |ask agai|
|00000780| 6e 20 66 6f 72 20 61 20 | 63 68 61 72 61 63 74 65 |n for a |characte|
|00000790| 72 0a 20 43 2d 6c 20 2d | 2d 20 72 65 64 69 73 70 |r. C-l -|- redisp|
|000007a0| 6c 61 79 20 73 63 72 65 | 65 6e 20 61 6e 64 20 61 |lay scre|en and a|
|000007b0| 73 6b 20 61 67 61 69 6e | 2e 22 20 28 69 6e 74 65 |sk again|." (inte|
|000007c0| 72 61 63 74 69 76 65 20 | 22 50 22 29 20 28 62 79 |ractive |"P") (by|
|000007d0| 74 65 2d 63 6f 64 65 20 | 22 c3 88 08 86 0d 00 09 |te-code |".......|
|000007e0| 86 0d 00 c7 c8 21 88 0a | 83 1c 00 c3 c3 19 18 c9 |.....!..|........|
|000007f0| 20 2a 82 87 00 08 3f 83 | 25 00 c3 82 87 00 c5 1c | *....?.|%.......|
|00000800| 0c 85 86 00 c3 c3 19 18 | ca cb 21 88 72 2a 1e 06 |........|..!.r*..|
|00000810| 0e 06 cc 55 83 44 00 c3 | 89 14 82 81 00 0e 06 cd |...U.D..|........|
|00000820| 55 83 55 00 c3 89 14 88 | ce 89 10 82 81 00 0e 06 |U.U.....|........|
|00000830| cf 55 83 66 00 c3 89 14 | 88 c5 89 10 82 81 00 0e |.U.f....|........|
|00000840| 06 d0 55 83 73 00 d1 c3 | 21 82 81 00 0e 06 d2 55 |..U.s...|!......U|
|00000850| 85 81 00 c3 c3 19 18 c9 | 20 2a 29 88 82 27 00 29 |........| *)..'.)|
|00000860| 87 22 20 5b 65 78 65 63 | 75 74 69 6e 67 2d 6d 61 |." [exec|uting-ma|
|00000870| 63 72 6f 20 64 65 66 69 | 6e 69 6e 67 2d 6b 62 64 |cro defi|ning-kbd|
|00000880| 2d 6d 61 63 72 6f 20 66 | 6c 61 67 20 6e 69 6c 20 |-macro f|lag nil |
|00000890| 6c 6f 6f 70 20 74 20 63 | 68 61 72 20 65 72 72 6f |loop t c|har erro|
|000008a0| 72 20 22 4e 6f 74 20 64 | 65 66 69 6e 69 6e 67 20 |r "Not d|efining |
|000008b0| 6f 72 20 65 78 65 63 75 | 74 69 6e 67 20 6b 62 64 |or execu|ting kbd|
|000008c0| 20 6d 61 63 72 6f 22 20 | 72 65 63 75 72 73 69 76 | macro" |recursiv|
|000008d0| 65 2d 65 64 69 74 20 6d | 65 73 73 61 67 65 20 22 |e-edit m|essage "|
|000008e0| 50 72 6f 63 65 65 64 20 | 77 69 74 68 20 6d 61 63 |Proceed |with mac|
|000008f0| 72 6f 3f 20 28 53 70 61 | 63 65 2c 20 44 45 4c 2c |ro? (Spa|ce, DEL,|
|00000900| 20 43 2d 64 2c 20 43 2d | 72 20 6f 72 20 43 2d 6c | C-d, C-|r or C-l|
|00000910| 29 20 22 20 33 32 20 31 | 32 37 20 22 22 20 34 20 |) " 32 1|27 "" 4 |
|00000920| 31 32 20 72 65 63 65 6e | 74 65 72 20 31 38 5d 20 |12 recen|ter 18] |
|00000930| 37 29 29 0a | |7)). | |
+--------+-------------------------+-------------------------+--------+--------+