summaryrefslogtreecommitdiff
path: root/lisp/macros.elc
blob: 9410bfd5dd9e5698759436d293f8bd4fafd27e85 (plain)
ofshex dumpascii
0000 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
0020 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
0040 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
0060 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
0080 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.
00a0 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.
00c0 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\
00e0 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
0100 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
0120 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."
0140 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
0160 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."........
0180 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
01a0 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.
01c0 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.
01e0 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.
0200 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)).
0220 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
0240 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
0260 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
0280 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
02a0 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.
02c0 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
02e0 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
0300 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
0320 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
0340 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
0360 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
0380 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
03a0 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
03c0 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
03e0 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
0400 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
0420 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
0440 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.
0460 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.
0480 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.
04a0 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
04c0 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.
04e0 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...@....\"...?
0500 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......)
0520 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.'"
0540 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
0560 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)
0580 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)
05a0 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.
05c0 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,
05e0 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
0600 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
0620 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
0640 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
0660 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
0680 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
06a0 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.
06c0 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.
06e0 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
0700 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.
0720 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
0740 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
0760 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
0780 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
07a0 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
07c0 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.".......
07e0 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 .....!...........*....?.%.......
0800 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..........
0820 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............
0840 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.........*)..'.)
0860 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
0880 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
08a0 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
08c0 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."
08e0 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,
0900 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.
0920 31 32 20 72 65 63 65 6e 74 65 72 20 31 38 5d 20 37 29 29 0a 12.recenter.18].7)).