summary refs log tree commit diff
path: root/Src/Zle
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle')
-rw-r--r--Src/Zle/compcore.c6
-rw-r--r--Src/Zle/compctl.c16
-rw-r--r--Src/Zle/complete.c26
-rw-r--r--Src/Zle/complist.c8
-rw-r--r--Src/Zle/compresult.c10
-rw-r--r--Src/Zle/computil.c22
-rw-r--r--Src/Zle/deltochar.c60
-rw-r--r--Src/Zle/zle_hist.c22
-rw-r--r--Src/Zle/zle_keymap.c22
-rw-r--r--Src/Zle/zle_main.c18
-rw-r--r--Src/Zle/zle_misc.c46
-rw-r--r--Src/Zle/zle_move.c22
-rw-r--r--Src/Zle/zle_params.c60
-rw-r--r--Src/Zle/zle_refresh.c4
-rw-r--r--Src/Zle/zle_thingy.c30
-rw-r--r--Src/Zle/zle_tricky.c14
-rw-r--r--Src/Zle/zle_utils.c6
-rw-r--r--Src/Zle/zle_vi.c58
-rw-r--r--Src/Zle/zle_word.c198
-rw-r--r--Src/Zle/zleparameter.c14
20 files changed, 355 insertions, 307 deletions
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index b0411651f..cf821197b 100644
--- a/Src/Zle/compcore.c
+++ b/Src/Zle/compcore.c
@@ -285,7 +285,7 @@ mod_export int lastend;
 
 /**/
 int
-do_completion(Hookdef dummy, Compldat dat)
+do_completion(UNUSED(Hookdef dummy), Compldat dat)
 {
     int ret = 0, lst = dat->lst, incmd = dat->incmd, osl = showinglist;
     char *s = dat->s;
@@ -444,7 +444,7 @@ static int oldmenucmp;
 
 /**/
 int
-before_complete(Hookdef dummy, int *lst)
+before_complete(UNUSED(Hookdef dummy), int *lst)
 {
     oldmenucmp = menucmp;
 
@@ -483,7 +483,7 @@ before_complete(Hookdef dummy, int *lst)
 
 /**/
 int
-after_complete(Hookdef dummy, int *dat)
+after_complete(UNUSED(Hookdef dummy), int *dat)
 {
     if (menucmp && !oldmenucmp) {
 	struct chdata cdat;
diff --git a/Src/Zle/compctl.c b/Src/Zle/compctl.c
index 9023dbd69..689d28a30 100644
--- a/Src/Zle/compctl.c
+++ b/Src/Zle/compctl.c
@@ -1572,7 +1572,7 @@ printcompctlp(HashNode hn, int printflags)
 
 /**/
 static int
-bin_compctl(char *name, char **argv, Options ops, int func)
+bin_compctl(char *name, char **argv, UNUSED(Options ops), UNUSED(int func))
 {
     Compctl cc = NULL;
     int ret = 0;
@@ -1678,7 +1678,7 @@ bin_compctl(char *name, char **argv, Options ops, int func)
 #define CFN_DEFAULT 2
 
 static int
-bin_compcall(char *name, char **argv, Options ops, int func)
+bin_compcall(char *name, UNUSED(char **argv), Options ops, UNUSED(int func))
 {
     if (incompfunc != 1) {
 	zwarnnam(name, "can only be called from completion function", NULL, 0);
@@ -1755,7 +1755,7 @@ static int addwhat;
 /* Hook functions */
 
 static int
-ccmakehookfn(Hookdef dummy, struct ccmakedat *dat)
+ccmakehookfn(UNUSED(Hookdef dummy), struct ccmakedat *dat)
 {
     char *s = dat->str;
     int incmd = dat->incmd, lst = dat->lst;
@@ -1891,7 +1891,7 @@ ccmakehookfn(Hookdef dummy, struct ccmakedat *dat)
 }
 
 static int
-cccleanuphookfn(Hookdef dummy, void *dat)
+cccleanuphookfn(UNUSED(Hookdef dummy), UNUSED(void *dat))
 {
     ccused = ccstack = NULL;
     return 0;
@@ -2103,7 +2103,7 @@ dumphashtable(HashTable ht, int what)
 
 /**/
 static void
-addhnmatch(HashNode hn, int flags)
+addhnmatch(HashNode hn, UNUSED(int flags))
 {
     addmatch(hn->nam, NULL);
 }
@@ -2345,7 +2345,7 @@ makecomplistctl(int flags)
 
 /**/
 static int
-makecomplistglobal(char *os, int incmd, int lst, int flags)
+makecomplistglobal(char *os, int incmd, UNUSED(int lst), int flags)
 {
     Compctl cc = NULL;
     char *s;
@@ -3896,7 +3896,7 @@ static struct builtin bintab[] = {
 
 /**/
 int
-setup_(Module m)
+setup_(UNUSED(Module m))
 {
     compctlreadptr = compctlread;
     createcompctltable();
@@ -3935,7 +3935,7 @@ cleanup_(Module m)
 
 /**/
 int
-finish_(Module m)
+finish_(UNUSED(Module m))
 {
     deletehashtable(compctltab);
 
diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c
index 3939bdd07..d015ab356 100644
--- a/Src/Zle/complete.c
+++ b/Src/Zle/complete.c
@@ -421,7 +421,7 @@ parse_class(Cpattern p, unsigned char *s, unsigned char e)
 
 /**/
 static int
-bin_compadd(char *name, char **argv, Options ops, int func)
+bin_compadd(char *name, char **argv, UNUSED(Options ops), UNUSED(int func))
 {
     struct cadata dat;
     char *p, **sp, *e, *m = NULL, *mstr = NULL;
@@ -866,7 +866,7 @@ do_comp_vars(int test, int na, char *sa, int nb, char *sb, int mod)
 
 /**/
 static int
-bin_compset(char *name, char **argv, Options ops, int func)
+bin_compset(char *name, char **argv, UNUSED(Options ops), UNUSED(int func))
 {
     int test = 0, na = 0, nb = 0;
     char *sa = NULL, *sb = NULL;
@@ -1067,7 +1067,7 @@ get_compstate(Param pm)
 
 /**/
 static void
-set_compstate(Param pm, HashTable ht)
+set_compstate(UNUSED(Param pm), HashTable ht)
 {
     struct compparam *cp;
     Param *pp;
@@ -1103,42 +1103,42 @@ set_compstate(Param pm, HashTable ht)
 
 /**/
 static zlong
-get_nmatches(Param pm)
+get_nmatches(UNUSED(Param pm))
 {
     return (permmatches(0) ? 0 : nmatches);
 }
 
 /**/
 static zlong
-get_listlines(Param pm)
+get_listlines(UNUSED(Param pm))
 {
     return list_lines();
 }
 
 /**/
 static void
-set_complist(Param pm, char *v)
+set_complist(UNUSED(Param pm), char *v)
 {
     comp_list(v);
 }
 
 /**/
 static char *
-get_complist(Param pm)
+get_complist(UNUSED(Param pm))
 {
     return complist;
 }
 
 /**/
 static char *
-get_unambig(Param pm)
+get_unambig(UNUSED(Param pm))
 {
     return unambig_data(NULL, NULL, NULL);
 }
 
 /**/
 static zlong
-get_unambig_curs(Param pm)
+get_unambig_curs(UNUSED(Param pm))
 {
     int c;
 
@@ -1149,7 +1149,7 @@ get_unambig_curs(Param pm)
 
 /**/
 static char *
-get_unambig_pos(Param pm)
+get_unambig_pos(UNUSED(Param pm))
 {
     char *p;
 
@@ -1160,7 +1160,7 @@ get_unambig_pos(Param pm)
 
 /**/
 static char *
-get_insert_pos(Param pm)
+get_insert_pos(UNUSED(Param pm))
 {
     char *p;
 
@@ -1394,7 +1394,7 @@ struct hookdef comphooks[] = {
 
 /**/
 int
-setup_(Module m)
+setup_(UNUSED(Module m))
 {
     hasperm = 0;
 
@@ -1454,7 +1454,7 @@ cleanup_(Module m)
 
 /**/
 int
-finish_(Module m)
+finish_(UNUSED(Module m))
 {
     if (compwords)
 	freearray(compwords);
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index d43a03677..2c47b246b 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -1588,7 +1588,7 @@ singledraw()
 }
 
 static int
-complistmatches(Hookdef dummy, Chdata dat)
+complistmatches(UNUSED(Hookdef dummy), Chdata dat)
 {
     static int onlnct = -1;
 
@@ -2870,7 +2870,7 @@ menuselect(char **args)
 
 /**/
 int
-setup_(Module m)
+setup_(UNUSED(Module m))
 {
     return 0;
 }
@@ -2919,7 +2919,7 @@ boot_(Module m)
 
 /**/
 int
-cleanup_(Module m)
+cleanup_(UNUSED(Module m))
 {
     free(mtab);
     free(mgtab);
@@ -2934,7 +2934,7 @@ cleanup_(Module m)
 
 /**/
 int
-finish_(Module m)
+finish_(UNUSED(Module m))
 {
     return 0;
 }
diff --git a/Src/Zle/compresult.c b/Src/Zle/compresult.c
index c4c265c70..83de2bd28 100644
--- a/Src/Zle/compresult.c
+++ b/Src/Zle/compresult.c
@@ -870,7 +870,7 @@ ztat(char *nam, struct stat *buf, int ls)
 
 /**/
 void
-do_allmatches(int end)
+do_allmatches(UNUSED(int end))
 {
     int first = 1, nm = nmatches - 1, omc = menucmp, oma = menuacc, e;
     Cmatch *mc;
@@ -1176,7 +1176,7 @@ do_menucmp(int lst)
 
 /**/
 int
-reverse_menu(Hookdef dummy, void *dummy2)
+reverse_menu(UNUSED(Hookdef dummy), UNUSED(void *dummy2))
 {
     do {
 	if (minfo.cur == (minfo.group)->matches) {
@@ -2091,7 +2091,7 @@ bld_all_str(Cmatch all)
 
 /**/
 static void
-iprintm(Cmgroup g, Cmatch *mp, int mc, int ml, int lastc, int width)
+iprintm(Cmgroup g, Cmatch *mp, UNUSED(int mc), UNUSED(int ml), int lastc, int width)
 {
     Cmatch m;
     int len = 0;
@@ -2128,7 +2128,7 @@ iprintm(Cmgroup g, Cmatch *mp, int mc, int ml, int lastc, int width)
 
 /**/
 int
-ilistmatches(Hookdef dummy, Chdata dat)
+ilistmatches(UNUSED(Hookdef dummy), UNUSED(Chdata dat))
 {
     calclist(0);
 
@@ -2148,7 +2148,7 @@ ilistmatches(Hookdef dummy, Chdata dat)
 
 /**/
 int
-list_matches(Hookdef dummy, void *dummy2)
+list_matches(UNUSED(Hookdef dummy), UNUSED(void *dummy2))
 {
     struct chdata dat;
     int ret;
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index be9ad6bca..9450aa3ad 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -717,7 +717,7 @@ cd_get(char **params)
 
 /**/
 static int
-bin_compdescribe(char *nam, char **args, Options ops, int func)
+bin_compdescribe(char *nam, char **args, UNUSED(Options ops), UNUSED(int func))
 {
     int n = arrlen(args);
 
@@ -2259,7 +2259,7 @@ ca_set_data(LinkList descr, LinkList act, LinkList subc,
 }
 
 static int
-bin_comparguments(char *nam, char **args, Options ops, int func)
+bin_comparguments(char *nam, char **args, UNUSED(Options ops), UNUSED(int func))
 {
     int min, max, n;
     Castate lstate = &ca_laststate;
@@ -3136,7 +3136,7 @@ cv_parse_word(Cvdef d)
 }
 
 static int
-bin_compvalues(char *nam, char **args, Options ops, int func)
+bin_compvalues(char *nam, char **args, UNUSED(Options ops), UNUSED(int func))
 {
     int min, max, n;
 
@@ -3349,7 +3349,7 @@ comp_quote(char *str, int prefix)
 }
 
 static int
-bin_compquote(char *nam, char **args, Options ops, int func)
+bin_compquote(char *nam, char **args, Options ops, UNUSED(int func))
 {
     char *name;
     struct value vbuf;
@@ -3500,7 +3500,7 @@ arrcontains(char **a, char *s, int colon)
 }
 
 static int
-bin_comptags(char *nam, char **args, Options ops, int func)
+bin_comptags(char *nam, char **args, UNUSED(Options ops), UNUSED(int func))
 {
     int min, max, n, level;
 
@@ -3630,7 +3630,7 @@ bin_comptags(char *nam, char **args, Options ops, int func)
 }
 
 static int
-bin_comptry(char *nam, char **args, Options ops, int func)
+bin_comptry(char *nam, char **args, UNUSED(Options ops), UNUSED(int func))
 {
     if (incompfunc != 1) {
 	zwarnnam(nam, "can only be called from completion function", NULL, 0);
@@ -4092,7 +4092,7 @@ cfp_opt_pats(char **pats, char *matcher)
 }
 
 static LinkList
-cfp_bld_pats(int dirs, LinkList names, char *skipped, char **pats)
+cfp_bld_pats(UNUSED(int dirs), LinkList names, char *skipped, char **pats)
 {
     LinkList ret = newlinklist();
     LinkNode node;
@@ -4322,7 +4322,7 @@ cf_remove_other(char **names, char *pre, int *amb)
 }
 
 static int
-bin_compfiles(char *nam, char **args, Options ops, int func)
+bin_compfiles(char *nam, char **args, UNUSED(Options ops), UNUSED(int func))
 {
     if (incompfunc != 1) {
 	zwarnnam(nam, "can only be called from completion function", NULL, 0);
@@ -4424,7 +4424,7 @@ bin_compfiles(char *nam, char **args, Options ops, int func)
 }
 
 static int
-bin_compgroups(char *nam, char **args, Options ops, int func)
+bin_compgroups(char *nam, char **args, UNUSED(Options ops), UNUSED(int func))
 {
     Heap oldheap;
     char *n;
@@ -4467,7 +4467,7 @@ static struct builtin bintab[] = {
 
 /**/
 int
-setup_(Module m)
+setup_(UNUSED(Module m))
 {
     memset(cadef_cache, 0, sizeof(cadef_cache));
     memset(cvdef_cache, 0, sizeof(cvdef_cache));
@@ -4496,7 +4496,7 @@ cleanup_(Module m)
 
 /**/
 int
-finish_(Module m)
+finish_(UNUSED(Module m))
 {
     int i;
 
diff --git a/Src/Zle/deltochar.c b/Src/Zle/deltochar.c
index 87f8593b8..054e7fe23 100644
--- a/Src/Zle/deltochar.c
+++ b/Src/Zle/deltochar.c
@@ -31,21 +31,24 @@
 #include "deltochar.pro"
 
 static Widget w_deletetochar;
+static Widget w_zaptochar;
 
 /**/
-static void
-deltochar(void)
+static int
+deltochar(UNUSED(char **args))
 {
     int c = getkey(0), dest = cs, ok = 0, n = zmult;
+    int zap = (bindk->widget == w_zaptochar);
 
     if (n > 0) {
 	while (n-- && dest != ll) {
 	    while (dest != ll && line[dest] != c)
 		dest++;
 	    if (dest != ll) {
-		dest++;
+		if (!zap || n > 0)
+		    dest++;
 		if (!n) {
-		    foredel(dest - cs);
+		    forekill(dest - cs, 0);
 		    ok++;
 		}
 	    }
@@ -57,35 +60,56 @@ deltochar(void)
 	while (n++ && dest != 0) {
 	    while (dest != 0 && line[dest] != c)
 		dest--;
-	    if (line[dest] == c && !n) {
-		backdel(cs - dest);
-		ok++;
+	    if (line[dest] == c) {
+		if (!n) {
+		    backkill(cs - dest - zap, 1);
+		    ok++;
+		}
+		if (dest)
+		    dest--;
 	    }
 	}
     }
-    if (!ok)
-	feep();
+    return !ok;
+}
+
+/**/
+int
+setup_(UNUSED(Module m))
+{
+    return 0;
 }
 
 /**/
 int
-boot_deltochar(Module m)
+boot_(Module m)
 {
-    w_deletetochar = addzlefunction("delete-to-char", deltochar, ZLE_KEEPSUFFIX);
-    if (w_deletetochar)
-	return 0;
-    zwarnnam(m->nam, "name clash when adding ZLE function `delete-to-char'",
+    w_deletetochar = addzlefunction("delete-to-char", deltochar,
+                                    ZLE_KILL | ZLE_KEEPSUFFIX);
+    if (w_deletetochar) {
+	w_zaptochar = addzlefunction("zap-to-char", deltochar,
+				     ZLE_KILL | ZLE_KEEPSUFFIX);
+	if (w_zaptochar)
+	    return 0;
+	deletezlefunction(w_deletetochar);
+    }
+    zwarnnam(m->nam, "deltochar: name clash when adding ZLE functions",
 	     NULL, 0);
     return -1;
 }
 
-#ifdef MODULE
-
 /**/
 int
-cleanup_deltochar(Module m)
+cleanup_(UNUSED(Module m))
 {
     deletezlefunction(w_deletetochar);
+    deletezlefunction(w_zaptochar);
+    return 0;
+}
+
+/**/
+int
+finish_(UNUSED(Module m))
+{
     return 0;
 }
-#endif
diff --git a/Src/Zle/zle_hist.c b/Src/Zle/zle_hist.c
index f1463cd15..70d8699c0 100644
--- a/Src/Zle/zle_hist.c
+++ b/Src/Zle/zle_hist.c
@@ -76,7 +76,7 @@ forget_edits(void)
 
 /**/
 int
-uphistory(char **args)
+uphistory(UNUSED(char **args))
 {
     int nodups = isset(HISTIGNOREDUPS);
     if (!zle_goto_hist(histline, -zmult, nodups) && isset(HISTBEEP))
@@ -254,7 +254,7 @@ downlineorsearch(char **args)
 
 /**/
 int
-acceptlineanddownhistory(char **args)
+acceptlineanddownhistory(UNUSED(char **args))
 {
     Histent he = quietgethist(histline);
 
@@ -268,7 +268,7 @@ acceptlineanddownhistory(char **args)
 
 /**/
 int
-downhistory(char **args)
+downhistory(UNUSED(char **args))
 {
     int nodups = isset(HISTIGNOREDUPS);
     if (!zle_goto_hist(histline, zmult, nodups) && isset(HISTBEEP))
@@ -390,7 +390,7 @@ beginningofbufferorhistory(char **args)
 
 /**/
 int
-beginningofhistory(char **args)
+beginningofhistory(UNUSED(char **args))
 {
     if (!zle_goto_hist(firsthist(), 0, 0) && isset(HISTBEEP))
 	return 1;
@@ -410,7 +410,7 @@ endofbufferorhistory(char **args)
 
 /**/
 int
-endofhistory(char **args)
+endofhistory(UNUSED(char **args))
 {
     zle_goto_hist(curhist, 0, 0);
     return 0;
@@ -574,7 +574,7 @@ zle_setline(Histent he)
 
 /**/
 int
-setlocalhistory(char **args)
+setlocalhistory(UNUSED(char **args))
 {
     if (zmod.flags & MOD_MULT) {
 	hist_skip_flags = zmult? HIST_FOREIGN : 0;
@@ -604,7 +604,7 @@ zle_goto_hist(int ev, int n, int skipdups)
 
 /**/
 int
-pushline(char **args)
+pushline(UNUSED(char **args))
 {
     int n = zmult;
 
@@ -663,7 +663,7 @@ pushinput(char **args)
 /* Renamed to avoid clash with library function */
 /**/
 int
-zgetline(char **args)
+zgetline(UNUSED(char **args))
 {
     char *s = (char *)getlinknode(bufstack);
 
@@ -1000,7 +1000,7 @@ doisearch(char **args, int dir)
 }
 
 static Histent
-infernexthist(Histent he, char **args)
+infernexthist(Histent he, UNUSED(char **args))
 {
     for (he = movehistent(he, -2, HIST_FOREIGN);
 	 he; he = movehistent(he, -1, HIST_FOREIGN)) {
@@ -1038,7 +1038,7 @@ infernexthistory(char **args)
 
 /**/
 int
-vifetchhistory(char **args)
+vifetchhistory(UNUSED(char **args))
 {
     if (zmult < 0)
 	return 1;
@@ -1200,7 +1200,7 @@ vihistorysearchbackward(char **args)
 
 /**/
 int
-virepeatsearch(char **args)
+virepeatsearch(UNUSED(char **args))
 {
     Histent he;
     int t0;
diff --git a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c
index 7e5fd02ee..3aee499f0 100644
--- a/Src/Zle/zle_keymap.c
+++ b/Src/Zle/zle_keymap.c
@@ -248,7 +248,7 @@ newkeymap(Keymap tocopy, char *kmname)
 
 /**/
 static void
-scancopykeys(HashNode hn, int flags)
+scancopykeys(HashNode hn, UNUSED(int flags))
 {
     Key k = (Key) hn;
     Key kn = zalloc(sizeof(*k));
@@ -301,7 +301,7 @@ scankeymap(Keymap km, int sort, KeyScanFunc func, void *magic)
 
 /**/
 static void
-scankeys(HashNode hn, int flags)
+scankeys(HashNode hn, UNUSED(int flags))
 {
     Key k = (Key) hn;
     int f = k->nam[0] == Meta ? STOUC(k->nam[1])^32 : STOUC(k->nam[0]);
@@ -615,7 +615,7 @@ keyisprefix(Keymap km, char *seq)
 
 /**/
 int
-bin_bindkey(char *name, char **argv, Options ops, int func)
+bin_bindkey(char *name, char **argv, Options ops, UNUSED(int func))
 {
     static struct opn {
 	char o;
@@ -707,7 +707,7 @@ bin_bindkey(char *name, char **argv, Options ops, int func)
 
 /**/
 static int
-bin_bindkey_lsmaps(char *name, char *kmname, Keymap km, char **argv, Options ops, char func)
+bin_bindkey_lsmaps(UNUSED(char *name), UNUSED(char *kmname), UNUSED(Keymap km), UNUSED(char **argv), Options ops, UNUSED(char func))
 {
     scanhashtable(keymapnamtab, 1, 0, 0, scanlistmaps, OPT_ISSET(ops,'L'));
     return 0;
@@ -733,7 +733,7 @@ scanlistmaps(HashNode hn, int list)
 
 /**/
 static int
-bin_bindkey_delall(char *name, char *kmname, Keymap km, char **argv, Options ops, char func)
+bin_bindkey_delall(UNUSED(char *name), UNUSED(char *kmname), UNUSED(Keymap km), UNUSED(char **argv), UNUSED(Options ops), UNUSED(char func))
 {
     keymapnamtab->emptytable(keymapnamtab);
     default_bindings();
@@ -744,7 +744,7 @@ bin_bindkey_delall(char *name, char *kmname, Keymap km, char **argv, Options ops
 
 /**/
 static int
-bin_bindkey_del(char *name, char *kmname, Keymap km, char **argv, Options ops, char func)
+bin_bindkey_del(char *name, UNUSED(char *kmname), UNUSED(Keymap km), char **argv, UNUSED(Options ops), UNUSED(char func))
 {
     int ret = 0;
 
@@ -763,7 +763,7 @@ bin_bindkey_del(char *name, char *kmname, Keymap km, char **argv, Options ops, c
 
 /**/
 static int
-bin_bindkey_link(char *name, char *kmname, Keymap km, char **argv, Options ops, char func)
+bin_bindkey_link(char *name, UNUSED(char *kmname), Keymap km, char **argv, UNUSED(Options ops), UNUSED(char func))
 {
     km = openkeymap(argv[0]);
     if(!km) {
@@ -780,7 +780,7 @@ bin_bindkey_link(char *name, char *kmname, Keymap km, char **argv, Options ops,
 
 /**/
 static int
-bin_bindkey_new(char *name, char *kmname, Keymap km, char **argv, Options ops, char func)
+bin_bindkey_new(char *name, UNUSED(char *kmname), Keymap km, char **argv, UNUSED(Options ops), UNUSED(char func))
 {
     KeymapName kmn = (KeymapName) keymapnamtab->getnode(keymapnamtab, argv[0]);
 
@@ -808,7 +808,7 @@ bin_bindkey_new(char *name, char *kmname, Keymap km, char **argv, Options ops, c
 
 /**/
 static int
-bin_bindkey_meta(char *name, char *kmname, Keymap km, char **argv, Options ops, char func)
+bin_bindkey_meta(char *name, char *kmname, Keymap km, UNUSED(char **argv), UNUSED(Options ops), UNUSED(char func))
 {
     char m[3], *str;
     int i;
@@ -916,7 +916,7 @@ bin_bindkey_bind(char *name, char *kmname, Keymap km, char **argv, Options ops,
 
 /**/
 static void
-scanremoveprefix(char *seq, Thingy bind, char *str, void *magic)
+scanremoveprefix(char *seq, UNUSED(Thingy bind), UNUSED(char *str), void *magic)
 {
     struct remprefstate *rps = magic;
 
@@ -932,7 +932,7 @@ scanremoveprefix(char *seq, Thingy bind, char *str, void *magic)
 
 /**/
 static int
-bin_bindkey_list(char *name, char *kmname, Keymap km, char **argv, Options ops, char func)
+bin_bindkey_list(char *name, char *kmname, Keymap km, char **argv, Options ops, UNUSED(char func))
 {
     struct bindstate bs;
 
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 8a9a149b9..0cfb8d9f6 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -1035,7 +1035,7 @@ mod_export char *varedarg;
 
 /**/
 static int
-bin_vared(char *name, char **args, Options ops, int func)
+bin_vared(char *name, char **args, Options ops, UNUSED(int func))
 {
     char *s, *t, *ova = varedarg;
     struct value vbuf;
@@ -1217,7 +1217,7 @@ bin_vared(char *name, char **args, Options ops, int func)
 
 /**/
 int
-describekeybriefly(char **args)
+describekeybriefly(UNUSED(char **args))
 {
     char *seq, *str, *msg, *is;
     Thingy func;
@@ -1255,7 +1255,7 @@ struct findfunc {
 
 /**/
 static void
-scanfindfunc(char *seq, Thingy func, char *str, void *magic)
+scanfindfunc(char *seq, Thingy func, UNUSED(char *str), void *magic)
 {
     struct findfunc *ff = magic;
 
@@ -1274,7 +1274,7 @@ scanfindfunc(char *seq, Thingy func, char *str, void *magic)
 
 /**/
 int
-whereis(char **args)
+whereis(UNUSED(char **args))
 {
     struct findfunc ff;
 
@@ -1294,7 +1294,7 @@ whereis(char **args)
 
 /**/
 int
-recursiveedit(char **args)
+recursiveedit(UNUSED(char **args))
 {
     int locerror;
 
@@ -1341,7 +1341,7 @@ trashzle(void)
  * active. */
 
 static int
-zlebeforetrap(Hookdef dummy, void *dat)
+zlebeforetrap(UNUSED(Hookdef dummy), UNUSED(void *dat))
 {
     if (zleactive) {
 	startparamscope();
@@ -1351,7 +1351,7 @@ zlebeforetrap(Hookdef dummy, void *dat)
 }
 
 static int
-zleaftertrap(Hookdef dummy, void *dat)
+zleaftertrap(UNUSED(Hookdef dummy), UNUSED(void *dat))
 {
     if (zleactive)
 	endparamscope();
@@ -1381,7 +1381,7 @@ mod_export struct hookdef zlehooks[] = {
 
 /**/
 int
-setup_(Module m)
+setup_(UNUSED(Module m))
 {
     /* Set up editor entry points */
     trashzleptr = trashzle;
@@ -1444,7 +1444,7 @@ cleanup_(Module m)
 
 /**/
 int
-finish_(Module m)
+finish_(UNUSED(Module m))
 {
     int i;
 
diff --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c
index 1d274a93e..935de58af 100644
--- a/Src/Zle/zle_misc.c
+++ b/Src/Zle/zle_misc.c
@@ -58,7 +58,7 @@ doinsert(char *str)
 
 /**/
 mod_export int
-selfinsert(char **args)
+selfinsert(UNUSED(char **args))
 {
     char s[3], *p = s;
 
@@ -118,7 +118,7 @@ backwarddeletechar(char **args)
 
 /**/
 int
-killwholeline(char **args)
+killwholeline(UNUSED(char **args))
 {
     int i, fg, n = zmult;
 
@@ -138,7 +138,7 @@ killwholeline(char **args)
 
 /**/
 int
-killbuffer(char **args)
+killbuffer(UNUSED(char **args))
 {
     cs = 0;
     forekill(ll, 0);
@@ -173,7 +173,7 @@ backwardkillline(char **args)
 
 /**/
 int
-gosmacstransposechars(char **args)
+gosmacstransposechars(UNUSED(char **args))
 {
     int cc;
 
@@ -193,7 +193,7 @@ gosmacstransposechars(char **args)
 
 /**/
 int
-transposechars(char **args)
+transposechars(UNUSED(char **args))
 {
     int cc, ct;
     int n = zmult;
@@ -232,7 +232,7 @@ transposechars(char **args)
 
 /**/
 int
-poundinsert(char **args)
+poundinsert(UNUSED(char **args))
 {
     cs = 0;
     vifirstnonblank(zlenoargs);
@@ -264,7 +264,7 @@ poundinsert(char **args)
 
 /**/
 int
-acceptline(char **args)
+acceptline(UNUSED(char **args))
 {
     done = 1;
     return 0;
@@ -272,7 +272,7 @@ acceptline(char **args)
 
 /**/
 int
-acceptandhold(char **args)
+acceptandhold(UNUSED(char **args))
 {
     zpushnode(bufstack, metafy((char *)line, ll, META_DUP));
     stackcs = cs;
@@ -307,7 +307,7 @@ killline(char **args)
 
 /**/
 int
-killregion(char **args)
+killregion(UNUSED(char **args))
 {
     if (mark > ll)
 	mark = ll;
@@ -320,7 +320,7 @@ killregion(char **args)
 
 /**/
 int
-copyregionaskill(char **args)
+copyregionaskill(UNUSED(char **args))
 {
     if (mark > ll)
 	mark = ll;
@@ -341,7 +341,7 @@ static Cutbuffer kctbuf;
 
 /**/
 int
-yank(char **args)
+yank(UNUSED(char **args))
 {
     int n = zmult;
 
@@ -367,7 +367,7 @@ yank(char **args)
 
 /**/
 int
-yankpop(char **args)
+yankpop(UNUSED(char **args))
 {
     int cc, kctstart = kct;
     Cutbuffer buf;
@@ -426,7 +426,7 @@ yankpop(char **args)
 
 /**/
 int
-overwritemode(char **args)
+overwritemode(UNUSED(char **args))
 {
     insmode ^= 1;
     return 0;
@@ -434,7 +434,7 @@ overwritemode(char **args)
 
 /**/
 int
-whatcursorposition(char **args)
+whatcursorposition(UNUSED(char **args))
 {
     char msg[100];
     char *s = msg;
@@ -473,7 +473,7 @@ whatcursorposition(char **args)
 
 /**/
 int
-undefinedkey(char **args)
+undefinedkey(UNUSED(char **args))
 {
     return 1;
 }
@@ -501,7 +501,7 @@ quotedinsert(char **args)
 
 /**/
 int
-digitargument(char **args)
+digitargument(UNUSED(char **args))
 {
     int sign = (zmult < 0) ? -1 : 1;
 
@@ -525,7 +525,7 @@ digitargument(char **args)
 
 /**/
 int
-negargument(char **args)
+negargument(UNUSED(char **args))
 {
     if (zmod.flags & MOD_TMULT)
 	return 1;
@@ -568,7 +568,7 @@ universalargument(char **args)
 
 /**/
 int
-copyprevword(char **args)
+copyprevword(UNUSED(char **args))
 {
     int len, t0;
 
@@ -589,7 +589,7 @@ copyprevword(char **args)
 
 /**/
 int
-copyprevshellword(char **args)
+copyprevshellword(UNUSED(char **args))
 {
     LinkList l;
     LinkNode n;
@@ -615,7 +615,7 @@ copyprevshellword(char **args)
 
 /**/
 int
-sendbreak(char **args)
+sendbreak(UNUSED(char **args))
 {
     errflag = 1;
     return 1;
@@ -623,7 +623,7 @@ sendbreak(char **args)
 
 /**/
 int
-quoteregion(char **args)
+quoteregion(UNUSED(char **args))
 {
     char *str;
     size_t len;
@@ -648,7 +648,7 @@ quoteregion(char **args)
 
 /**/
 int
-quoteline(char **args)
+quoteline(UNUSED(char **args))
 {
     char *str;
     size_t len = ll;
@@ -692,7 +692,7 @@ static int cmdambig;
 
 /**/
 static void
-scancompcmd(HashNode hn, int flags)
+scancompcmd(HashNode hn, UNUSED(int flags))
 {
     int l;
     Thingy t = (Thingy) hn;
diff --git a/Src/Zle/zle_move.c b/Src/Zle/zle_move.c
index a7db7dc85..23db9dc4e 100644
--- a/Src/Zle/zle_move.c
+++ b/Src/Zle/zle_move.c
@@ -157,7 +157,7 @@ endoflinehist(char **args)
 
 /**/
 int
-forwardchar(char **args)
+forwardchar(UNUSED(char **args))
 {
     cs += zmult;
     if (cs > ll)
@@ -169,7 +169,7 @@ forwardchar(char **args)
 
 /**/
 int
-backwardchar(char **args)
+backwardchar(UNUSED(char **args))
 {
     cs -= zmult;
     if (cs > ll)
@@ -181,7 +181,7 @@ backwardchar(char **args)
 
 /**/
 int
-setmarkcommand(char **args)
+setmarkcommand(UNUSED(char **args))
 {
     mark = cs;
     return 0;
@@ -189,7 +189,7 @@ setmarkcommand(char **args)
 
 /**/
 int
-exchangepointandmark(char **args)
+exchangepointandmark(UNUSED(char **args))
 {
     int x;
 
@@ -203,7 +203,7 @@ exchangepointandmark(char **args)
 
 /**/
 int
-vigotocolumn(char **args)
+vigotocolumn(UNUSED(char **args))
 {
     int x, y;
 
@@ -221,7 +221,7 @@ vigotocolumn(char **args)
 
 /**/
 int
-vimatchbracket(char **args)
+vimatchbracket(UNUSED(char **args))
 {
     int ocs = cs, dir, ct;
     unsigned char oth, me;
@@ -327,7 +327,7 @@ vibackwardchar(char **args)
 
 /**/
 int
-viendofline(char **args)
+viendofline(UNUSED(char **args))
 {
     int oldcs = cs, n = zmult;
 
@@ -347,7 +347,7 @@ viendofline(char **args)
 
 /**/
 int
-vibeginningofline(char **args)
+vibeginningofline(UNUSED(char **args))
 {
     cs = findbol();
     return 0;
@@ -453,7 +453,7 @@ virevrepeatfind(char **args)
 
 /**/
 int
-vifirstnonblank(char **args)
+vifirstnonblank(UNUSED(char **args))
 {
     cs = findbol();
     while (cs != ll && iblank(line[cs]))
@@ -463,7 +463,7 @@ vifirstnonblank(char **args)
 
 /**/
 int
-visetmark(char **args)
+visetmark(UNUSED(char **args))
 {
     int ch;
 
@@ -478,7 +478,7 @@ visetmark(char **args)
 
 /**/
 int
-vigotomark(char **args)
+vigotomark(UNUSED(char **args))
 {
     int ch;
 
diff --git a/Src/Zle/zle_params.c b/Src/Zle/zle_params.c
index 2c3b2c007..f2eaea723 100644
--- a/Src/Zle/zle_params.c
+++ b/Src/Zle/zle_params.c
@@ -146,7 +146,7 @@ zleunsetfn(Param pm, int exp)
 
 /**/
 static void
-set_buffer(Param pm, char *x)
+set_buffer(UNUSED(Param pm), char *x)
 {
     if(x) {
 	unmetafy(x, &ll);
@@ -163,14 +163,14 @@ set_buffer(Param pm, char *x)
 
 /**/
 static char *
-get_buffer(Param pm)
+get_buffer(UNUSED(Param pm))
 {
     return metafy((char *)line, ll, META_HEAPDUP);
 }
 
 /**/
 static void
-set_cursor(Param pm, zlong x)
+set_cursor(UNUSED(Param pm), zlong x)
 {
     if(x < 0)
 	cs = 0;
@@ -184,14 +184,14 @@ set_cursor(Param pm, zlong x)
 
 /**/
 static zlong
-get_cursor(Param pm)
+get_cursor(UNUSED(Param pm))
 {
     return cs;
 }
 
 /**/
 static void
-set_mark(Param pm, zlong x)
+set_mark(UNUSED(Param pm), zlong x)
 {
     if (x < 0)
 	mark = 0;
@@ -203,14 +203,14 @@ set_mark(Param pm, zlong x)
 
 /**/
 static zlong
-get_mark(Param pm)
+get_mark(UNUSED(Param pm))
 {
     return mark;
 }
 
 /**/
 static void
-set_lbuffer(Param pm, char *x)
+set_lbuffer(UNUSED(Param pm), char *x)
 {
     char *y;
     int len;
@@ -231,14 +231,14 @@ set_lbuffer(Param pm, char *x)
 
 /**/
 static char *
-get_lbuffer(Param pm)
+get_lbuffer(UNUSED(Param pm))
 {
     return metafy((char *)line, cs, META_HEAPDUP);
 }
 
 /**/
 static void
-set_rbuffer(Param pm, char *x)
+set_rbuffer(UNUSED(Param pm), char *x)
 {
     char *y;
     int len;
@@ -256,14 +256,14 @@ set_rbuffer(Param pm, char *x)
 
 /**/
 static char *
-get_rbuffer(Param pm)
+get_rbuffer(UNUSED(Param pm))
 {
     return metafy((char *)line + cs, ll - cs, META_HEAPDUP);
 }
 
 /**/
 static char *
-get_prebuffer(Param pm)
+get_prebuffer(UNUSED(Param pm))
 {
     if (chline)
 	return dupstrpfx(chline, hptr - chline);
@@ -273,35 +273,35 @@ get_prebuffer(Param pm)
 
 /**/
 static char *
-get_widget(Param pm)
+get_widget(UNUSED(Param pm))
 {
     return bindk->nam;
 }
 
 /**/
 static char *
-get_lwidget(Param pm)
+get_lwidget(UNUSED(Param pm))
 {
     return (lbindk ? lbindk->nam : "");
 }
 
 /**/
 static char *
-get_keymap(Param pm)
+get_keymap(UNUSED(Param pm))
 {
     return dupstring(curkeymapname);
 }
 
 /**/
 static char *
-get_keys(Param pm)
+get_keys(UNUSED(Param pm))
 {
     return keybuf;
 }
 
 /**/
 static void
-set_numeric(Param pm, zlong x)
+set_numeric(UNUSED(Param pm), zlong x)
 {
     zmult = x;
     zmod.flags = MOD_MULT;
@@ -309,7 +309,7 @@ set_numeric(Param pm, zlong x)
 
 /**/
 static zlong
-get_numeric(Param pm)
+get_numeric(UNUSED(Param pm))
 {
     return zmult;
 }
@@ -327,28 +327,28 @@ unset_numeric(Param pm, int exp)
 
 /**/
 static zlong
-get_histno(Param pm)
+get_histno(UNUSED(Param pm))
 {
     return histline;
 }
 
 /**/
 static zlong
-get_bufferlines(Param pm)
+get_bufferlines(UNUSED(Param pm))
 {
     return nlnct;
 }
 
 /**/
 static zlong
-get_pending(Param pm)
+get_pending(UNUSED(Param pm))
 {
     return noquery(0);
 }
 
 /**/
 static char *
-get_cutbuffer(Param pm)
+get_cutbuffer(UNUSED(Param pm))
 {
     if (cutbuf.buf)
 	return metafy(cutbuf.buf, cutbuf.len, META_HEAPDUP);
@@ -359,7 +359,7 @@ get_cutbuffer(Param pm)
 
 /**/
 static void
-set_cutbuffer(Param pm, char *x)
+set_cutbuffer(UNUSED(Param pm), char *x)
 {
     if (cutbuf.buf)
 	free(cutbuf.buf);
@@ -393,7 +393,7 @@ unset_cutbuffer(Param pm, int exp)
 
 /**/
 static void
-set_killring(Param pm, char **x)
+set_killring(UNUSED(Param pm), char **x)
 {
     int kcnt;
     Cutbuffer kptr;
@@ -435,7 +435,7 @@ set_killring(Param pm, char **x)
 
 /**/
 static char **
-get_killring(Param pm)
+get_killring(UNUSED(Param pm))
 {
     /*
      * Return the kill ring with the most recently killed first.
@@ -508,28 +508,28 @@ get_prepost(unsigned char *text, int len)
 
 /**/
 static void
-set_predisplay(Param pm, char *x)
+set_predisplay(UNUSED(Param pm), char *x)
 {
     set_prepost(&predisplay, &predisplaylen, x);
 }
 
 /**/
 static char *
-get_predisplay(Param pm)
+get_predisplay(UNUSED(Param pm))
 {
     return get_prepost(predisplay, predisplaylen);
 }
 
 /**/
 static void
-set_postdisplay(Param pm, char *x)
+set_postdisplay(UNUSED(Param pm), char *x)
 {
     set_prepost(&postdisplay, &postdisplaylen, x);
 }
 
 /**/
 static char *
-get_postdisplay(Param pm)
+get_postdisplay(UNUSED(Param pm))
 {
     return get_prepost(postdisplay, postdisplaylen);
 }
@@ -546,7 +546,7 @@ free_prepostdisplay(void)
 
 /**/
 static char *
-get_lsearch(Param pm)
+get_lsearch(UNUSED(Param pm))
 {
     if (previous_search_len)
 	return metafy(previous_search, previous_search_len, META_HEAPDUP);
@@ -556,7 +556,7 @@ get_lsearch(Param pm)
 
 /**/
 static char *
-get_context(Param pm)
+get_context(UNUSED(Param pm))
 {
     switch (zlecontext) {
     case ZLCON_LINE_CONT:
diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c
index 2b90edd0c..08516939a 100644
--- a/Src/Zle/zle_refresh.c
+++ b/Src/Zle/zle_refresh.c
@@ -1096,7 +1096,7 @@ tcoutarg(int cap, int arg)
 
 /**/
 mod_export int
-clearscreen(char **args)
+clearscreen(UNUSED(char **args))
 {
     tcout(TCCLEARSCREEN);
     resetneeded = 1;
@@ -1106,7 +1106,7 @@ clearscreen(char **args)
 
 /**/
 mod_export int
-redisplay(char **args)
+redisplay(UNUSED(char **args))
 {
     moveto(0, 0);
     zputc('\r', shout);		/* extra care */
diff --git a/Src/Zle/zle_thingy.c b/Src/Zle/zle_thingy.c
index 91ee2c010..53eb927f9 100644
--- a/Src/Zle/zle_thingy.c
+++ b/Src/Zle/zle_thingy.c
@@ -77,7 +77,7 @@ createthingytab(void)
 
 /**/
 static void
-emptythingytab(HashTable ht)
+emptythingytab(UNUSED(HashTable ht))
 {
     /* This will only be called when deleting the thingy table, which *
      * is only done to unload the zle module.  A normal emptytable()  *
@@ -93,7 +93,7 @@ emptythingytab(HashTable ht)
 
 /**/
 static void
-scanemptythingies(HashNode hn, int flags)
+scanemptythingies(HashNode hn, UNUSED(int flags))
 {
     Thingy t = (Thingy) hn;
 
@@ -335,7 +335,7 @@ deletezlefunction(Widget w)
 
 /**/
 int
-bin_zle(char *name, char **args, Options ops, int func)
+bin_zle(char *name, char **args, Options ops, UNUSED(int func))
 {
     static struct opn {
 	char o;
@@ -384,7 +384,7 @@ bin_zle(char *name, char **args, Options ops, int func)
 
 /**/
 static int
-bin_zle_list(char *name, char **args, Options ops, char func)
+bin_zle_list(UNUSED(char *name), char **args, Options ops, UNUSED(char func))
 {
     if (!*args) {
 	scanhashtable(thingytab, 1, 0, DISABLED, scanlistwidgets,
@@ -405,7 +405,7 @@ bin_zle_list(char *name, char **args, Options ops, char func)
 
 /**/
 static int
-bin_zle_refresh(char *name, char **args, Options ops, char func)
+bin_zle_refresh(UNUSED(char *name), char **args, Options ops, UNUSED(char func))
 {
     char *s = statusline;
     int sl = statusll, ocl = clearlist;
@@ -450,7 +450,7 @@ bin_zle_refresh(char *name, char **args, Options ops, char func)
 
 /**/
 static int
-bin_zle_mesg(char *name, char **args, Options ops, char func)
+bin_zle_mesg(char *name, char **args, UNUSED(Options ops), UNUSED(char func))
 {
     if (!zleactive) {
 	zwarnnam(name, "can only be called from widget function", NULL, 0);
@@ -464,7 +464,7 @@ bin_zle_mesg(char *name, char **args, Options ops, char func)
 
 /**/
 static int
-bin_zle_unget(char *name, char **args, Options ops, char func)
+bin_zle_unget(char *name, char **args, UNUSED(Options ops), UNUSED(char func))
 {
     char *b = *args, *p = b + strlen(b);
 
@@ -479,7 +479,7 @@ bin_zle_unget(char *name, char **args, Options ops, char func)
 
 /**/
 static int
-bin_zle_keymap(char *name, char **args, Options ops, char func)
+bin_zle_keymap(char *name, char **args, UNUSED(Options ops), UNUSED(char func))
 {
     if (!zleactive) {
 	zwarnnam(name, "can only be called from widget function", NULL, 0);
@@ -533,7 +533,7 @@ scanlistwidgets(HashNode hn, int list)
 
 /**/
 static int
-bin_zle_del(char *name, char **args, Options ops, char func)
+bin_zle_del(char *name, char **args, UNUSED(Options ops), UNUSED(char func))
 {
     int ret = 0;
 
@@ -552,7 +552,7 @@ bin_zle_del(char *name, char **args, Options ops, char func)
 
 /**/
 static int
-bin_zle_link(char *name, char **args, Options ops, char func)
+bin_zle_link(char *name, char **args, UNUSED(Options ops), UNUSED(char func))
 {
     Thingy t = (Thingy) thingytab->getnode(thingytab, args[0]);
 
@@ -569,7 +569,7 @@ bin_zle_link(char *name, char **args, Options ops, char func)
 
 /**/
 static int
-bin_zle_new(char *name, char **args, Options ops, char func)
+bin_zle_new(char *name, char **args, UNUSED(Options ops), UNUSED(char func))
 {
     Widget w = zalloc(sizeof(*w));
 
@@ -585,7 +585,7 @@ bin_zle_new(char *name, char **args, Options ops, char func)
 
 /**/
 static int
-bin_zle_complete(char *name, char **args, Options ops, char func)
+bin_zle_complete(char *name, char **args, UNUSED(Options ops), UNUSED(char func))
 {
     Thingy t;
     Widget w, cw;
@@ -619,7 +619,7 @@ bin_zle_complete(char *name, char **args, Options ops, char func)
 
 /**/
 static int
-bin_zle_call(char *name, char **args, Options ops, char func)
+bin_zle_call(char *name, char **args, UNUSED(Options ops), UNUSED(char func))
 {
     Thingy t;
     struct modifier modsave;
@@ -683,7 +683,7 @@ bin_zle_call(char *name, char **args, Options ops, char func)
 
 /**/
 static int
-bin_zle_invalidate(char *name, char **args, Options ops, char func)
+bin_zle_invalidate(UNUSED(char *name), UNUSED(char **args), UNUSED(Options ops), UNUSED(char func))
 {
     if (zleactive) {
 	if (!trashedzle)
@@ -695,7 +695,7 @@ bin_zle_invalidate(char *name, char **args, Options ops, char func)
 
 /**/
 static int
-bin_zle_fd(char *name, char **args, Options ops, char func)
+bin_zle_fd(char *name, char **args, Options ops, UNUSED(char func))
 {
     int fd = 0, i, found = 0;
     char *endptr;
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 135e38f88..4fbf2b9c5 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -223,7 +223,7 @@ menucomplete(char **args)
 
 /**/
 int
-listchoices(char **args)
+listchoices(UNUSED(char **args))
 {
     usemenu = !!isset(MENUCOMPLETE);
     useglob = isset(GLOBCOMPLETE);
@@ -233,7 +233,7 @@ listchoices(char **args)
 
 /**/
 int
-spellword(char **args)
+spellword(UNUSED(char **args))
 {
     usemenu = useglob = 0;
     wouldinstab = 0;
@@ -305,7 +305,7 @@ menuexpandorcomplete(char **args)
 
 /**/
 int
-listexpand(char **args)
+listexpand(UNUSED(char **args))
 {
     usemenu = !!isset(MENUCOMPLETE);
     useglob = isset(GLOBCOMPLETE);
@@ -2305,7 +2305,7 @@ magicspace(char **args)
 
 /**/
 int
-expandhistory(char **args)
+expandhistory(UNUSED(char **args))
 {
     if (!doexpandhist())
 	return 1;
@@ -2352,7 +2352,7 @@ getcurcmd(void)
 
 /**/
 int
-processcmd(char **args)
+processcmd(UNUSED(char **args))
 {
     char *s;
     int m = zmult;
@@ -2376,7 +2376,7 @@ processcmd(char **args)
 
 /**/
 int
-expandcmdpath(char **args)
+expandcmdpath(UNUSED(char **args))
 {
     int oldcs = cs, na = noaliases;
     char *s, *str;
@@ -2421,7 +2421,7 @@ expandorcompleteprefix(char **args)
 
 /**/
 int
-endoflist(char **args)
+endoflist(UNUSED(char **args))
 {
     if (lastlistlen > 0) {
 	int i;
diff --git a/Src/Zle/zle_utils.c b/Src/Zle/zle_utils.c
index 69b4e6e42..8783e83f9 100644
--- a/Src/Zle/zle_utils.c
+++ b/Src/Zle/zle_utils.c
@@ -424,7 +424,7 @@ showmsg(char const *msg)
 
 /**/
 int
-handlefeep(char **args)
+handlefeep(UNUSED(char **args))
 {
     zbeep();
     return 0;
@@ -565,7 +565,7 @@ setlastline(void)
 
 /**/
 int
-undo(char **args)
+undo(UNUSED(char **args))
 {
     handleundo();
     do {
@@ -610,7 +610,7 @@ unapplychange(struct change *ch)
 
 /**/
 int
-redo(char **args)
+redo(UNUSED(char **args))
 {
     handleundo();
     do {
diff --git a/Src/Zle/zle_vi.c b/Src/Zle/zle_vi.c
index 9ba84aadc..81a095c71 100644
--- a/Src/Zle/zle_vi.c
+++ b/Src/Zle/zle_vi.c
@@ -259,7 +259,7 @@ dovilinerange(void)
 
 /**/
 int
-viaddnext(char **args)
+viaddnext(UNUSED(char **args))
 {
     if (cs != findeol())
 	cs++;
@@ -269,7 +269,7 @@ viaddnext(char **args)
 
 /**/
 int
-viaddeol(char **args)
+viaddeol(UNUSED(char **args))
 {
     cs = findeol();
     startvitext(1);
@@ -278,7 +278,7 @@ viaddeol(char **args)
 
 /**/
 int
-viinsert(char **args)
+viinsert(UNUSED(char **args))
 {
     startvitext(1);
     return 0;
@@ -286,7 +286,7 @@ viinsert(char **args)
 
 /**/
 int
-viinsertbol(char **args)
+viinsertbol(UNUSED(char **args))
 {
     vifirstnonblank(zlenoargs);
     startvitext(1);
@@ -295,7 +295,7 @@ viinsertbol(char **args)
 
 /**/
 int
-videlete(char **args)
+videlete(UNUSED(char **args))
 {
     int c2, ret = 1;
 
@@ -343,7 +343,7 @@ videletechar(char **args)
 
 /**/
 int
-vichange(char **args)
+vichange(UNUSED(char **args))
 {
     int c2, ret = 1;
 
@@ -360,7 +360,7 @@ vichange(char **args)
 
 /**/
 int
-visubstitute(char **args)
+visubstitute(UNUSED(char **args))
 {
     int n = zmult;
 
@@ -382,7 +382,7 @@ visubstitute(char **args)
 
 /**/
 int
-vichangeeol(char **args)
+vichangeeol(UNUSED(char **args))
 {
     forekill(findeol() - cs, 0);
     startvitext(1);
@@ -399,7 +399,7 @@ vichangewholeline(char **args)
 
 /**/
 int
-viyank(char **args)
+viyank(UNUSED(char **args))
 {
     int oldcs = cs, c2, ret = 1;
 
@@ -415,7 +415,7 @@ viyank(char **args)
 
 /**/
 int
-viyankeol(char **args)
+viyankeol(UNUSED(char **args))
 {
     int x = findeol();
 
@@ -428,7 +428,7 @@ viyankeol(char **args)
 
 /**/
 int
-viyankwholeline(char **args)
+viyankwholeline(UNUSED(char **args))
 {
     int bol = findbol(), oldcs = cs;
     int n = zmult;
@@ -451,7 +451,7 @@ viyankwholeline(char **args)
 
 /**/
 int
-vireplace(char **args)
+vireplace(UNUSED(char **args))
 {
     startvitext(0);
     return 0;
@@ -472,7 +472,7 @@ vireplace(char **args)
 
 /**/
 int
-vireplacechars(char **args)
+vireplacechars(UNUSED(char **args))
 {
     int ch, n = zmult;
 
@@ -510,7 +510,7 @@ vireplacechars(char **args)
 
 /**/
 int
-vicmdmode(char **args)
+vicmdmode(UNUSED(char **args))
 {
     if (invicmdmode() || selectkeymap("vicmd", 0))
 	return 1;
@@ -523,7 +523,7 @@ vicmdmode(char **args)
 
 /**/
 int
-viopenlinebelow(char **args)
+viopenlinebelow(UNUSED(char **args))
 {
     cs = findeol();
     spaceinline(1);
@@ -535,7 +535,7 @@ viopenlinebelow(char **args)
 
 /**/
 int
-viopenlineabove(char **args)
+viopenlineabove(UNUSED(char **args))
 {
     cs = findbol();
     spaceinline(1);
@@ -547,7 +547,7 @@ viopenlineabove(char **args)
 
 /**/
 int
-vioperswapcase(char **args)
+vioperswapcase(UNUSED(char **args))
 {
     int oldcs, c2, ret = 1;
 
@@ -576,7 +576,7 @@ vioperswapcase(char **args)
 
 /**/
 int
-virepeatchange(char **args)
+virepeatchange(UNUSED(char **args))
 {
     /* make sure we have a change to repeat */
     if (!vichgbuf || vichgflag)
@@ -599,7 +599,7 @@ virepeatchange(char **args)
 
 /**/
 int
-viindent(char **args)
+viindent(UNUSED(char **args))
 {
     int oldcs = cs, c2;
 
@@ -630,7 +630,7 @@ viindent(char **args)
 
 /**/
 int
-viunindent(char **args)
+viunindent(UNUSED(char **args))
 {
     int oldcs = cs, c2;
 
@@ -691,7 +691,7 @@ vibackwarddeletechar(char **args)
 
 /**/
 int
-vikillline(char **args)
+vikillline(UNUSED(char **args))
 {
     if (viinsbegin > cs)
 	return 1;
@@ -701,7 +701,7 @@ vikillline(char **args)
 
 /**/
 int
-viputbefore(char **args)
+viputbefore(UNUSED(char **args))
 {
     Cutbuffer buf = &cutbuf;
     int n = zmult;
@@ -733,7 +733,7 @@ viputbefore(char **args)
 
 /**/
 int
-viputafter(char **args)
+viputafter(UNUSED(char **args))
 {
     Cutbuffer buf = &cutbuf;
     int n = zmult;
@@ -767,7 +767,7 @@ viputafter(char **args)
 
 /**/
 int
-vijoin(char **args)
+vijoin(UNUSED(char **args))
 {
     int x;
 
@@ -788,7 +788,7 @@ vijoin(char **args)
 
 /**/
 int
-viswapcase(char **args)
+viswapcase(UNUSED(char **args))
 {
     int eol, n = zmult;
 
@@ -810,7 +810,7 @@ viswapcase(char **args)
 
 /**/
 int
-vicapslockpanic(char **args)
+vicapslockpanic(UNUSED(char **args))
 {
     clearlist = 1;
     zbeep();
@@ -824,7 +824,7 @@ vicapslockpanic(char **args)
 
 /**/
 int
-visetbuffer(char **args)
+visetbuffer(UNUSED(char **args))
 {
     int ch;
 
@@ -844,7 +844,7 @@ visetbuffer(char **args)
 
 /**/
 int
-vikilleol(char **args)
+vikilleol(UNUSED(char **args))
 {
     int n = findeol() - cs;
 
@@ -860,7 +860,7 @@ vikilleol(char **args)
 
 /**/
 int
-vipoundinsert(char **args)
+vipoundinsert(UNUSED(char **args))
 {
     int oldcs = cs;
 
diff --git a/Src/Zle/zle_word.c b/Src/Zle/zle_word.c
index 923216ef8..5c096e5d3 100644
--- a/Src/Zle/zle_word.c
+++ b/Src/Zle/zle_word.c
@@ -31,38 +31,41 @@
 #include "zle_word.pro"
 
 /**/
-void
-forwardword(void)
+int
+forwardword(char **args)
 {
     int n = zmult;
 
     if (n < 0) {
+	int ret;
 	zmult = -n;
-	backwardword();
+	ret = backwardword(args);
 	zmult = n;
-	return;
+	return ret;
     }
     while (n--) {
 	while (cs != ll && iword(line[cs]))
 	    cs++;
 	if (wordflag && !n)
-	    return;
+	    return 0;
 	while (cs != ll && !iword(line[cs]))
 	    cs++;
     }
+    return 0;
 }
 
 /**/
-void
-viforwardword(void)
+int
+viforwardword(char **args)
 {
     int n = zmult;
 
     if (n < 0) {
+	int ret;
 	zmult = -n;
-	backwardword();
+	ret = backwardword(args);
 	zmult = n;
-	return;
+	return ret;
     }
     while (n--) {
 	if (iident(line[cs]))
@@ -72,64 +75,69 @@ viforwardword(void)
 	    while (cs != ll && !iident(line[cs]) && !iblank(line[cs]))
 		cs++;
 	if (wordflag && !n)
-	    return;
-	while (cs != ll && iblank(line[cs]))
+	    return 0;
+	while (cs != ll && (iblank(line[cs]) || line[cs] == '\n'))
 	    cs++;
     }
+    return 0;
 }
 
 /**/
-void
-viforwardblankword(void)
+int
+viforwardblankword(char **args)
 {
     int n = zmult;
 
     if (n < 0) {
+	int ret;
 	zmult = -n;
-	vibackwardblankword();
+	ret = vibackwardblankword(args);
 	zmult = n;
-	return;
+	return ret;
     }
     while (n--) {
 	while (cs != ll && !iblank(line[cs]))
 	    cs++;
 	if (wordflag && !n)
-	    return;
+	    return 0;
 	while (cs != ll && iblank(line[cs]))
 	    cs++;
     }
+    return 0;
 }
 
 /**/
-void
-emacsforwardword(void)
+int
+emacsforwardword(char **args)
 {
     int n = zmult;
 
     if (n < 0) {
+	int ret;
 	zmult = -n;
-	emacsbackwardword();
+	ret = emacsbackwardword(args);
 	zmult = n;
-	return;
+	return ret;
     }
     while (n--) {
 	while (cs != ll && !iword(line[cs]))
 	    cs++;
 	if (wordflag && !n)
-	    return;
+	    return 0;
 	while (cs != ll && iword(line[cs]))
 	    cs++;
     }
+    return 0;
 }
 
 /**/
-void
-viforwardblankwordend(void)
+int
+viforwardblankwordend(UNUSED(char **args))
 {
     int n = zmult;
 
     if (n < 0)
-	return;
+	return 1;
     while (n--) {
 	while (cs != ll && iblank(line[cs + 1]))
 	    cs++;
@@ -138,19 +146,21 @@ viforwardblankwordend(void)
     }
     if (cs != ll && virangeflag)
 	cs++;
+    return 0;
 }
 
 /**/
-void
-viforwardwordend(void)
+int
+viforwardwordend(char **args)
 {
     int n = zmult;
 
     if (n < 0) {
+	int ret;
 	zmult = -n;
-	backwardword();
+	ret = backwardword(args);
 	zmult = n;
-	return;
+	return ret;
     }
     while (n--) {
 	if (iblank(line[cs + 1]))
@@ -165,19 +175,21 @@ viforwardwordend(void)
     }
     if (cs != ll && virangeflag)
 	cs++;
+    return 0;
 }
 
 /**/
-void
-backwardword(void)
+int
+backwardword(char **args)
 {
     int n = zmult;
 
     if (n < 0) {
+	int ret;
 	zmult = -n;
-	forwardword();
+	ret = forwardword(args);
 	zmult = n;
-	return;
+	return ret;
     }
     while (n--) {
 	while (cs && !iword(line[cs - 1]))
@@ -185,19 +197,21 @@ backwardword(void)
 	while (cs && iword(line[cs - 1]))
 	    cs--;
     }
+    return 0;
 }
 
 /**/
-void
-vibackwardword(void)
+int
+vibackwardword(char **args)
 {
     int n = zmult;
 
     if (n < 0) {
+	int ret;
 	zmult = -n;
-	backwardword();
+	ret = backwardword(args);
 	zmult = n;
-	return;
+	return ret;
     }
     while (n--) {
 	while (cs && iblank(line[cs - 1]))
@@ -209,19 +223,21 @@ vibackwardword(void)
 	    while (cs && !iident(line[cs - 1]) && !iblank(line[cs - 1]))
 		cs--;
     }
+    return 0;
 }
 
 /**/
-void
-vibackwardblankword(void)
+int
+vibackwardblankword(char **args)
 {
     int n = zmult;
 
     if (n < 0) {
+	int ret;
 	zmult = -n;
-	viforwardblankword();
+	ret = viforwardblankword(args);
 	zmult = n;
-	return;
+	return ret;
     }
     while (n--) {
 	while (cs && iblank(line[cs - 1]))
@@ -229,19 +245,21 @@ vibackwardblankword(void)
 	while (cs && !iblank(line[cs - 1]))
 	    cs--;
     }
+    return 0;
 }
 
 /**/
-void
-emacsbackwardword(void)
+int
+emacsbackwardword(char **args)
 {
     int n = zmult;
 
     if (n < 0) {
+	int ret;
 	zmult = -n;
-	emacsforwardword();
+	ret = emacsforwardword(args);
 	zmult = n;
-	return;
+	return ret;
     }
     while (n--) {
 	while (cs && !iword(line[cs - 1]))
@@ -249,19 +267,21 @@ emacsbackwardword(void)
 	while (cs && iword(line[cs - 1]))
 	    cs--;
     }
+    return 0;
 }
 
 /**/
-void
-backwarddeleteword(void)
+int
+backwarddeleteword(char **args)
 {
     int x = cs, n = zmult;
 
     if (n < 0) {
+	int ret;
 	zmult = -n;
-	deleteword();
+	ret = deleteword(args);
 	zmult = n;
-	return;
+	return ret;
     }
     while (n--) {
 	while (x && !iword(line[x - 1]))
@@ -270,19 +290,18 @@ backwarddeleteword(void)
 	    x--;
     }
     backdel(cs - x);
+    return 0;
 }
 
 /**/
-void
-vibackwardkillword(void)
+int
+vibackwardkillword(UNUSED(char **args))
 {
     int x = cs, lim = (viinsbegin > findbol()) ? viinsbegin : findbol();
     int n = zmult;
 
-    if (n < 0) {
-	feep();
-	return;
-    }
+    if (n < 0)
+	return 1;
 /* this taken from "vibackwardword" */
     while (n--) {
 	while ((x > lim) && iblank(line[x - 1]))
@@ -295,20 +314,22 @@ vibackwardkillword(void)
 		x--;
     }
     backkill(cs - x, 1);
+    return 0;
 }
 
 /**/
-void
-backwardkillword(void)
+int
+backwardkillword(char **args)
 {
     int x = cs;
     int n = zmult;
 
     if (n < 0) {
+	int ret;
 	zmult = -n;
-	killword();
+	ret = killword(args);
 	zmult = n;
-	return;
+	return ret;
     }
     while (n--) {
 	while (x && !iword(line[x - 1]))
@@ -317,11 +338,12 @@ backwardkillword(void)
 	    x--;
     }
     backkill(cs - x, 1);
+    return 0;
 }
 
 /**/
-void
-upcaseword(void)
+int
+upcaseword(UNUSED(char **args))
 {
     int n = zmult;
     int neg = n < 0, ocs = cs;
@@ -338,11 +360,12 @@ upcaseword(void)
     }
     if (neg)
 	cs = ocs;
+    return 0;
 }
 
 /**/
-void
-downcaseword(void)
+int
+downcaseword(UNUSED(char **args))
 {
     int n = zmult;
     int neg = n < 0, ocs = cs;
@@ -359,11 +382,12 @@ downcaseword(void)
     }
     if (neg)
 	cs = ocs;
+    return 0;
 }
 
 /**/
-void
-capitalizeword(void)
+int
+capitalizeword(UNUSED(char **args))
 {
     int first, n = zmult;
     int neg = n < 0, ocs = cs;
@@ -384,20 +408,22 @@ capitalizeword(void)
     }
     if (neg)
 	cs = ocs;
+    return 0;
 }
 
 /**/
-void
-deleteword(void)
+int
+deleteword(char **args)
 {
     int x = cs;
     int n = zmult;
 
     if (n < 0) {
+	int ret;
 	zmult = -n;
-	backwarddeleteword();
+	ret = backwarddeleteword(args);
 	zmult = n;
-	return;
+	return ret;
     }
     while (n--) {
 	while (x != ll && !iword(line[x]))
@@ -406,20 +432,22 @@ deleteword(void)
 	    x++;
     }
     foredel(x - cs);
+    return 0;
 }
 
 /**/
-void
-killword(void)
+int
+killword(char **args)
 {
     int x = cs;
     int n = zmult;
 
     if (n < 0) {
+	int ret;
 	zmult = -n;
-	backwardkillword();
+	ret = backwardkillword(args);
 	zmult = n;
-	return;
+	return ret;
     }
     while (n--) {
 	while (x != ll && !iword(line[x]))
@@ -428,11 +456,12 @@ killword(void)
 	    x++;
     }
     forekill(x - cs, 0);
+    return 0;
 }
 
 /**/
-void
-transposewords(void)
+int
+transposewords(UNUSED(char **args))
 {
     int p1, p2, p3, p4, x = cs;
     char *temp, *pp;
@@ -448,24 +477,18 @@ transposewords(void)
 	    x = cs;
 	    while (x && line[x - 1] != '\n' && !iword(line[x]))
 		x--;
-	    if (!x || line[x - 1] == '\n') {
-		feep();
-		return;
-	    }
+	    if (!x || line[x - 1] == '\n')
+		return 1;
 	}
 	for (p4 = x; p4 != ll && iword(line[p4]); p4++);
 	for (p3 = p4; p3 && iword(line[p3 - 1]); p3--);
-	if (!p3) {
-	    feep();
-	    return;
-	}
+	if (!p3)
+	    return 1;
 	for (p2 = p3; p2 && !iword(line[p2 - 1]); p2--);
-	if (!p2) {
-	    feep();
-	    return;
-	}
+	if (!p2)
+	    return 1;
 	for (p1 = p2; p1 && iword(line[p1 - 1]); p1--);
-	pp = temp = (char *)halloc(p4 - p1 + 1);
+	pp = temp = (char *)zhalloc(p4 - p1 + 1);
 	struncpy(&pp, (char *) line + p3, p4 - p3);
 	struncpy(&pp, (char *) line + p2, p3 - p2);
 	struncpy(&pp, (char *) line + p1, p2 - p1);
@@ -474,4 +497,5 @@ transposewords(void)
     }
     if (neg)
 	cs = ocs;
+    return 0;
 }
diff --git a/Src/Zle/zleparameter.c b/Src/Zle/zleparameter.c
index cce421897..38b2a3608 100644
--- a/Src/Zle/zleparameter.c
+++ b/Src/Zle/zleparameter.c
@@ -96,7 +96,7 @@ widgetstr(Widget w)
 
 /**/
 static HashNode
-getpmwidgets(HashTable ht, char *name)
+getpmwidgets(UNUSED(HashTable ht), char *name)
 {
     Param pm = NULL;
     Thingy th;
@@ -124,7 +124,7 @@ getpmwidgets(HashTable ht, char *name)
 
 /**/
 static void
-scanpmwidgets(HashTable ht, ScanFunc func, int flags)
+scanpmwidgets(UNUSED(HashTable ht), ScanFunc func, int flags)
 {
     struct param pm;
     int i;
@@ -154,7 +154,7 @@ scanpmwidgets(HashTable ht, ScanFunc func, int flags)
 /* Functions for the zlekeymaps special parameter. */
 
 static char **
-keymapsgetfn(Param pm)
+keymapsgetfn(UNUSED(Param pm))
 {
     int i;
     HashNode hn;
@@ -196,14 +196,14 @@ static struct pardef partab[] = {
 
 /**/
 int
-setup_(Module m)
+setup_(UNUSED(Module m))
 {
     return 0;
 }
 
 /**/
 int
-boot_(Module m)
+boot_(UNUSED(Module m))
 {
     struct pardef *def;
 
@@ -230,7 +230,7 @@ boot_(Module m)
 
 /**/
 int
-cleanup_(Module m)
+cleanup_(UNUSED(Module m))
 {
     Param pm;
     struct pardef *def;
@@ -247,7 +247,7 @@ cleanup_(Module m)
 
 /**/
 int
-finish_(Module m)
+finish_(UNUSED(Module m))
 {
     return 0;
 }