Message-Id: <199710131307.PAA28866@hydra.ifh.de>
To: zsh-workers@math.gatech.edu (Zsh hackers list), zsh@peak.org
Subject: PATCH: zsh 3.1.2+: implementation of keyboard macros
Date: Mon, 13 Oct 1997 15:07:35 +0200
From: Peter Stephenson <pws@ifh.de>
Here's an implementation of keyboard macros for zsh 3.1, providing
^X(, ^X) and ^Xe, as well as `bindkey -k' which maps the macro to a
key sequence. It's quite possible I've missed something from Zefram
which would stop parts of this applying properly. I can't answer the
question whether we need this, or can make do with `bindkey -s';
unfortunately it's not possible to turn this into an add-on module as
it has to interact with the low-level routine to read a key. It does
do one thing better than `bindkey -s' at the moment: a numerical
prefix repeats the macro instead of just applying to the first command
in the string.
One glitch is that I've forgotten how to get yodl to make ( or )
inside ()'s, so the documentation currently says `<left-paren>' and
`<right-paren>'.
begin 644 macros.dif.gz
M'XL(`*H;0C0``]5;;7/;-A+^[/P*V#>32C;%B'J7W+3C)DZ;JQUG8J5OF9R/
M(B&+8XI42<J.D_J_WRY>2``$G;CMW,UY,C&YQ#Y8["Z>!4!Z?W^?/$^#)[_E
MJR>+;10749*[MZE[M=XY31/RSVU"2(]T)[/A=#88$F\Z'3_J=#HV':9P%A3$
MZ\._V7`\Z_6YPK[^@_=DVG6F0\)N$0]O1P2N.H\(^1`5=-TJBM8B2L(K>MLF
M[\BUG[7231&E2=XF[PD\[*S;[2]OG+69-$HZ>9%%R66;N*[[`/W<T"?IMM"A
M#KX4ZLHTY0O-T/L/TO7:3\)R')_7?V=ZX'V[!8J*SE<Y$>U)X"=D04D874<A
M#4F4%"DI5AFE\*2@EVD6T7Q&0&GM;TA.8QJ@GF.-M3?J.MY(B;8W\D`PE?$N
MS;]GA&CI=V`FH7ZP,@<"MI5BJ>5"0#`H=>`V@!UPL&)%+5@HC?V\P.$M4C\+
MR=H/LI3D19K1T%4M;O#I2<2U"7H6Y+E+R,LE`9\:S:.<Y!L:1,N(A@[K6&B0
M=,E\)R?:QYB*>?DBBV!>QH0,B#><=;U9OU^?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
-- Peter Stephenson <pws@ifh.de> Tel: +49 33762 77366 WWW: http://www.ifh.de/~pws/ Fax: +49 33762 77413 Deutsches Elektronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen DESY-IfH, Platanenallee 6, 15738 Zeuthen, Germany.