about summary refs log tree commit diff
path: root/Src/Zle/zle_main.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-06-27 06:54:32 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-06-27 06:54:32 +0000
commitb09922bb063ddf44c7850b182fec4795fbe1ae90 (patch)
tree8a6dfa5ef6c6012753c0dc5a6e93e6f820b51a58 /Src/Zle/zle_main.c
parent346825df86466cf151be61b9429ef2c1734e66ea (diff)
downloadzsh-b09922bb063ddf44c7850b182fec4795fbe1ae90.tar.gz
zsh-b09922bb063ddf44c7850b182fec4795fbe1ae90.tar.xz
zsh-b09922bb063ddf44c7850b182fec4795fbe1ae90.zip
zsh-3.1.5-pws-23 zsh-3.1.5-pws-23
Diffstat (limited to 'Src/Zle/zle_main.c')
-rw-r--r--Src/Zle/zle_main.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 8f6dfdf75..e2b64cb3c 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -106,7 +106,13 @@ struct modifier zmod;
 /**/
 int prefixflag;
 
+/* != 0 if there is a pending beep (usually indicating an error) */
+
+/**/
+int feepflag;
+ 
 /* Number of characters waiting to be read by the ungetkeys mechanism */
+
 /**/
 int kungetct;
 
@@ -501,7 +507,6 @@ zleread(char *lp, char *rp, int flags)
 	viinsbegin = 0;
 	statusline = NULL;
 	selectkeymap("main", 1);
-	selectlocalmap(NULL);
 	fixsuffix();
 	if ((s = (unsigned char *)getlinknode(bufstack))) {
 	    setline((char *)s);
@@ -530,21 +535,20 @@ zleread(char *lp, char *rp, int flags)
 	lastcol = -1;
 	initmodifier(&zmod);
 	prefixflag = 0;
+	feepflag = 0;
 	zrefresh();
 	while (!done && !errflag) {
 
 	    statusline = NULL;
 	    vilinerange = 0;
 	    reselectkeymap();
-	    selectlocalmap(NULL);
 	    bindk = getkeycmd();
 	    if (!ll && isfirstln && c == eofchar) {
 		eofsent = 1;
 		break;
 	    }
 	    if (bindk) {
-		if (execzlefunc(bindk, zlenoargs))
-		    handlefeep(zlenoargs);
+		execzlefunc(bindk, zlenoargs);
 		handleprefixes();
 		/* for vi mode, make sure the cursor isn't somewhere illegal */
 		if (invicmdmode() && cs > findbol() &&
@@ -569,6 +573,7 @@ zleread(char *lp, char *rp, int flags)
 #endif
 		if (!kungetct)
 		    zrefresh();
+	    handlefeep();
 	}
 	statusline = NULL;
 	invalidatelist();
@@ -608,7 +613,7 @@ execzlefunc(Thingy func, char **args)
 	zsfree(nm);
 	showmsg(msg);
 	zsfree(msg);
-	ret = 1;
+	feep();
     } else if((w = func->widget)->flags & (WIDGET_INT|WIDGET_NCOMP)) {
 	int wflags = w->flags;
 
@@ -641,7 +646,7 @@ execzlefunc(Thingy func, char **args)
 	    zsfree(nm);
 	    showmsg(msg);
 	    zsfree(msg);
-	    ret = 1;
+	    feep();
 	} else {
 	    int osc = sfcontext, osi = movefd(0), olv = lastval;
 	    LinkList largs = NULL;
@@ -948,17 +953,7 @@ trashzle(void)
 static struct builtin bintab[] = {
     BUILTIN("bindkey", 0, bin_bindkey, 0, -1, 0, "evaMldDANmrsLR", NULL),
     BUILTIN("vared",   0, bin_vared,   1,  7, 0, NULL,             NULL),
-    BUILTIN("zle",     0, bin_zle,     0, -1, 0, "lDANCLmMgGcRa",  NULL),
-};
-
-/* The order of the entries in this table has to match the *HOOK
- * macros in zle.h */
-
-/**/
-struct hookdef zlehooks[] = {
-    HOOKDEF("list_matches", ilistmatches, 0),
-    HOOKDEF("insert_match", NULL, HOOKF_ALL),
-    HOOKDEF("menu_start", NULL, HOOKF_ALL),
+    BUILTIN("zle",     0, bin_zle,     0, -1, 0, "lDANCLmMgGcR",  NULL),
 };
 
 /**/
@@ -1004,7 +999,6 @@ int
 boot_zle(Module m)
 {
     addbuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab));
-    addhookdefs(m->nam, zlehooks, sizeof(zlehooks)/sizeof(*zlehooks));
     return 0;
 }
 
@@ -1020,7 +1014,6 @@ cleanup_zle(Module m)
 	return 1;
     }
     deletebuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab));
-    deletehookdefs(m->nam, zlehooks, sizeof(zlehooks)/sizeof(*zlehooks));
     return 0;
 }