From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19908 invoked from network); 5 Jan 1997 15:44:58 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 5 Jan 1997 15:44:58 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id KAA14546; Sun, 5 Jan 1997 10:49:31 -0500 (EST) Resent-Date: Sun, 5 Jan 1997 10:49:31 -0500 (EST) From: Zefram Message-Id: <4180.199701051550@stone.dcs.warwick.ac.uk> Subject: z_* list To: zsh-workers@math.gatech.edu (Z Shell workers mailing list) Date: Sun, 5 Jan 1997 15:50:41 +0000 (GMT) X-Patch: 186 X-Loop: zefram@dcs.warwick.ac.uk X-Stardate: [-31]8683.30 X-US-Congress: Moronic fuckers Content-Type: text Resent-Message-ID: <"z7fAh3.0.DZ3.Asypo"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2731 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu -----BEGIN PGP SIGNED MESSAGE----- This patch makes the list of z_* indices be generated automatically from zle_bindings.c. This makes maintenance easier. It also adds a full set of t_* macros, patterned after t_undefinedkey -- these macros are now more useful than the z_* indices. This patch depends on patch 2710. -zefram *** Src/Zle/Makefile.in 1997/01/03 07:23:25 1.18 --- Src/Zle/Makefile.in 1997/01/05 11:47:17 *************** *** 117,123 **** OTHERDOBJS = comp1..o compctl..o deltochar..o ALLOBJS = $(ZLEOBJS) $(OTHEROBJS) $(ZLEDOBJS) $(OTHERDOBJS) ! HDRS = comp.h zle.h # target modules MODULES = zle.so comp1.so compctl.so deltochar.so --- 117,123 ---- OTHERDOBJS = comp1..o compctl..o deltochar..o ALLOBJS = $(ZLEOBJS) $(OTHEROBJS) $(ZLEDOBJS) $(OTHERDOBJS) ! HDRS = comp.h zle.h zle_things.h # target modules MODULES = zle.so comp1.so compctl.so deltochar.so *************** *** 134,139 **** --- 134,150 ---- zle.so: $(ZLEDOBJS) $(DLLINK) $(ZLEDOBJS) + zle_things.h: zle_bindings.c zle_things.sed + ( \ + echo '/** zle_things.h **/'; \ + echo '/** list of thingies that are used internally **/'; \ + echo; \ + echo 'enum {'; \ + sed -n -f $(srcdir)/zle_things.sed < $(srcdir)/zle_bindings.c; \ + echo ' ZLE_BUILTIN_THINGY_COUNT'; \ + echo '};'; \ + ) > $@ + $(ALLOBJS): $(HDRS) $(ZHDRS) $(HDRS): proto *************** *** 171,177 **** rm -f core stamp-modobjs* *.o *.$(DL_EXT) *~ clean: mostlyclean ! rm -f *.*.c *.pro distclean: clean rm -f Makefile --- 182,188 ---- rm -f core stamp-modobjs* *.o *.$(DL_EXT) *~ clean: mostlyclean ! rm -f zle_things.h *.*.c *.pro distclean: clean rm -f Makefile *** Src/Zle/zle.h 1997/01/04 17:47:25 1.10 --- Src/Zle/zle.h 1997/01/05 11:56:14 *************** *** 213,219 **** extern struct thingy zlecmds[]; #define Th(X) (&zlecmds[X]) ! #define t_undefinedkey (&zlecmds[z_undefinedkey]) /* opaque keymap type */ --- 213,220 ---- extern struct thingy zlecmds[]; #define Th(X) (&zlecmds[X]) ! ! #include "zle_things.h" /* opaque keymap type */ *************** *** 258,429 **** * 26-34 are the numbered buffer stack "1 to "9. */ ZLEXTERN struct cutbuffer vibuf[35]; - - /* ZLE command table indices */ - - enum { - z_acceptandhold, - z_acceptandinfernexthistory, - z_acceptandmenucomplete, - z_acceptline, - z_acceptlineanddownhistory, - z_backwardchar, - z_backwarddeletechar, - z_backwarddeleteword, - z_backwardkillline, - z_backwardkillword, - z_backwardword, - z_beginningofbufferorhistory, - z_beginningofhistory, - z_beginningofline, - z_beginningoflinehist, - z_capitalizeword, - z_clearscreen, - z_completeword, - z_copyprevword, - z_copyregionaskill, - z_deletechar, - z_deletecharorlist, - z_deleteword, - z_describekeybriefly, - z_digitargument, - z_downcaseword, - z_downhistory, - z_downlineorhistory, - z_downlineorsearch, - z_emacsbackwardword, - z_emacsforwardword, - z_endofbufferorhistory, - z_endofhistory, - z_endofline, - z_endoflinehist, - z_exchangepointandmark, - z_executelastnamedcmd, - z_executenamedcmd, - z_expandcmdpath, - z_expandhistory, - z_expandorcomplete, - z_expandorcompleteprefix, - z_expandword, - z_forwardchar, - z_forwardword, - z_getline, - z_gosmacstransposechars, - z_historybeginningsearchbackward, - z_historybeginningsearchforward, - z_historyincrementalsearchbackward, - z_historyincrementalsearchforward, - z_historysearchbackward, - z_historysearchforward, - z_infernexthistory, - z_insertlastword, - z_killbuffer, - z_killline, - z_killregion, - z_killwholeline, - z_killword, - z_listchoices, - z_listexpand, - z_magicspace, - z_menucomplete, - z_menuexpandorcomplete, - z_negargument, - z_overwritemode, - z_poundinsert, - z_pushinput, - z_pushline, - z_pushlineoredit, - z_quotedinsert, - z_quoteline, - z_quoteregion, - z_redisplay, - z_reversemenucomplete, - z_runhelp, - z_selfinsert, - z_selfinsertunmeta, - z_sendbreak, - z_setmarkcommand, - z_spellword, - z_transposechars, - z_transposewords, - z_undefinedkey, - z_undo, - z_universalargument, - z_upcaseword, - z_uphistory, - z_uplineorhistory, - z_uplineorsearch, - z_viaddeol, - z_viaddnext, - z_vibackwardblankword, - z_vibackwardchar, - z_vibackwarddeletechar, - z_vibackwardkillword, - z_vibackwardword, - z_vibeginningofline, - z_vicapslockpanic, - z_vichange, - z_vichangeeol, - z_vichangewholeline, - z_vicmdmode, - z_videlete, - z_videletechar, - z_vidigitorbeginningofline, - z_vidownlineorhistory, - z_viendofline, - z_vifetchhistory, - z_vifindnextchar, - z_vifindnextcharskip, - z_vifindprevchar, - z_vifindprevcharskip, - z_vifirstnonblank, - z_viforwardblankword, - z_viforwardblankwordend, - z_viforwardchar, - z_viforwardword, - z_viforwardwordend, - z_vigotocolumn, - z_vigotomark, - z_vigotomarkline, - z_vihistorysearchbackward, - z_vihistorysearchforward, - z_viindent, - z_viinsert, - z_viinsertbol, - z_vijoin, - z_vikilleol, - z_vikillline, - z_vimatchbracket, - z_viopenlineabove, - z_viopenlinebelow, - z_vioperswapcases, - z_vipoundinsert, - z_viputafter, - z_viputbefore, - z_viquotedinsert, - z_virepeatchange, - z_virepeatfind, - z_virepeatsearch, - z_vireplace, - z_vireplacechars, - z_virevrepeatfind, - z_virevrepeatsearch, - z_visetbuffer, - z_visetmark, - z_visubstitute, - z_viswapcase, - z_viundochange, - z_viunindent, - z_viuplineorhistory, - z_viyank, - z_viyankeol, - z_viyankwholeline, - z_whereis, - z_whichcommand, - z_yank, - z_yankpop, - ZLECMDCOUNT - }; /* prototypes */ --- 259,264 ---- *** Src/Zle/zle_keymap.c 1997/01/04 17:47:26 1.6 --- Src/Zle/zle_keymap.c 1997/01/05 11:53:59 *************** *** 787,793 **** m[0] = i; metafy(m, 1, META_NOALLOC); fn = keybind(km, m, &str); ! if(fn == Th(z_selfinsert) || fn == t_undefinedkey) bindkey(km, m, refthingy(Th(metabind[i - 128])), NULL); } return 0; --- 787,793 ---- m[0] = i; metafy(m, 1, META_NOALLOC); fn = keybind(km, m, &str); ! if(fn == t_selfinsert || fn == t_undefinedkey) bindkey(km, m, refthingy(Th(metabind[i - 128])), NULL); } return 0; *************** *** 1003,1013 **** emap->first[i] = refthingy(Th(emacsbind[i])); } for (i = 32; i < 256; i++) { ! vmap->first[i] = refthingy(Th(z_selfinsert)); ! emap->first[i] = refthingy(Th(z_selfinsert)); } ! unrefthingy(Th(z_selfinsert)); ! unrefthingy(Th(z_selfinsert)); vmap->first[127] = refthingy(vmap->first[8]); emap->first[127] = refthingy(emap->first[8]); --- 1003,1013 ---- emap->first[i] = refthingy(Th(emacsbind[i])); } for (i = 32; i < 256; i++) { ! vmap->first[i] = refthingy(t_selfinsert); ! emap->first[i] = refthingy(t_selfinsert); } ! unrefthingy(t_selfinsert); ! unrefthingy(t_selfinsert); vmap->first[127] = refthingy(vmap->first[8]); emap->first[127] = refthingy(emap->first[8]); *************** *** 1024,1063 **** * '\n' accept-line * * '\r' accept-line */ for (i = 0; i < 256; i++) ! smap->first[i] = refthingy(Th(z_selfinsert)); ! unrefthingy(Th(z_selfinsert)); ! unrefthingy(Th(z_selfinsert)); ! smap->first['\n'] = refthingy(Th(z_acceptline)); ! smap->first['\r'] = refthingy(Th(z_acceptline)); /* vi command mode: arrow keys */ ! bindkey(amap, "\33[C", refthingy(Th(z_forwardchar)), NULL); ! bindkey(amap, "\33[D", refthingy(Th(z_backwardchar)), NULL); ! bindkey(amap, "\33[A", refthingy(Th(z_uplineorhistory)), NULL); ! bindkey(amap, "\33[B", refthingy(Th(z_downlineorhistory)), NULL); /* emacs mode: arrow keys */ ! bindkey(emap, "\33[C", refthingy(Th(z_forwardchar)), NULL); ! bindkey(emap, "\33[D", refthingy(Th(z_backwardchar)), NULL); ! bindkey(emap, "\33[A", refthingy(Th(z_uplineorhistory)), NULL); ! bindkey(emap, "\33[B", refthingy(Th(z_downlineorhistory)), NULL); /* emacs mode: ^X sequences */ ! bindkey(emap, "\30*", refthingy(Th(z_expandword)), NULL); ! bindkey(emap, "\30g", refthingy(Th(z_listexpand)), NULL); ! bindkey(emap, "\30G", refthingy(Th(z_listexpand)), NULL); ! bindkey(emap, "\30\16", refthingy(Th(z_infernexthistory)), NULL); ! bindkey(emap, "\30\13", refthingy(Th(z_killbuffer)), NULL); ! bindkey(emap, "\30\6", refthingy(Th(z_vifindnextchar)), NULL); ! bindkey(emap, "\30\17", refthingy(Th(z_overwritemode)), NULL); ! bindkey(emap, "\30\25", refthingy(Th(z_undo)), NULL); ! bindkey(emap, "\30\26", refthingy(Th(z_vicmdmode)), NULL); ! bindkey(emap, "\30\12", refthingy(Th(z_vijoin)), NULL); ! bindkey(emap, "\30\2", refthingy(Th(z_vimatchbracket)), NULL); ! bindkey(emap, "\30s", refthingy(Th(z_historyincrementalsearchforward)), NULL); ! bindkey(emap, "\30r", refthingy(Th(z_historyincrementalsearchbackward)), NULL); ! bindkey(emap, "\30u", refthingy(Th(z_undo)), NULL); ! bindkey(emap, "\30\30", refthingy(Th(z_exchangepointandmark)), NULL); /* emacs mode: ESC sequences, all taken from the meta binding table */ buf[0] = '\33'; --- 1024,1063 ---- * '\n' accept-line * * '\r' accept-line */ for (i = 0; i < 256; i++) ! smap->first[i] = refthingy(t_selfinsert); ! unrefthingy(t_selfinsert); ! unrefthingy(t_selfinsert); ! smap->first['\n'] = refthingy(t_acceptline); ! smap->first['\r'] = refthingy(t_acceptline); /* vi command mode: arrow keys */ ! bindkey(amap, "\33[C", refthingy(t_forwardchar), NULL); ! bindkey(amap, "\33[D", refthingy(t_backwardchar), NULL); ! bindkey(amap, "\33[A", refthingy(t_uplineorhistory), NULL); ! bindkey(amap, "\33[B", refthingy(t_downlineorhistory), NULL); /* emacs mode: arrow keys */ ! bindkey(emap, "\33[C", refthingy(t_forwardchar), NULL); ! bindkey(emap, "\33[D", refthingy(t_backwardchar), NULL); ! bindkey(emap, "\33[A", refthingy(t_uplineorhistory), NULL); ! bindkey(emap, "\33[B", refthingy(t_downlineorhistory), NULL); /* emacs mode: ^X sequences */ ! bindkey(emap, "\30*", refthingy(t_expandword), NULL); ! bindkey(emap, "\30g", refthingy(t_listexpand), NULL); ! bindkey(emap, "\30G", refthingy(t_listexpand), NULL); ! bindkey(emap, "\30\16", refthingy(t_infernexthistory), NULL); ! bindkey(emap, "\30\13", refthingy(t_killbuffer), NULL); ! bindkey(emap, "\30\6", refthingy(t_vifindnextchar), NULL); ! bindkey(emap, "\30\17", refthingy(t_overwritemode), NULL); ! bindkey(emap, "\30\25", refthingy(t_undo), NULL); ! bindkey(emap, "\30\26", refthingy(t_vicmdmode), NULL); ! bindkey(emap, "\30\12", refthingy(t_vijoin), NULL); ! bindkey(emap, "\30\2", refthingy(t_vimatchbracket), NULL); ! bindkey(emap, "\30s", refthingy(t_historyincrementalsearchforward), NULL); ! bindkey(emap, "\30r", refthingy(t_historyincrementalsearchbackward), NULL); ! bindkey(emap, "\30u", refthingy(t_undo), NULL); ! bindkey(emap, "\30\30", refthingy(t_exchangepointandmark), NULL); /* emacs mode: ESC sequences, all taken from the meta binding table */ buf[0] = '\33'; *** ....................../dev/null Thu Sep 7 20:04:30 1995 --- Src/Zle/zle_things.sed Sun Jan 5 11:42:06 1997 *************** *** 0 **** --- 1,8 ---- + /^ *[A-Z]("/{ + s/^ *[A-Z]("/ z_/ + s/".*$/,/ + s/-//g + P + s/ z_\(.*\),/#define t_\1 (\&zlecmds[z_\1])/ + P + } -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBMs+hv3D/+HJTpU/hAQFU6wQArrH37AH/4V4X+ORxNYdnYdiPwnvqITcz K21/OWi7+mCh/jKg/QJc567FkpedWCkIS3l/xfvABH4c1eQ4R+cyv6Wu6YHJ9i1L yLs74W2JgLzBvxTpCBrt7z3uDPFW91nrk23091wjFEYf1LyW/z/BnGOzB6Tu884f xCg8IL9UOZY= =F8pT -----END PGP SIGNATURE-----