Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: numeric argument in widgets
- X-seq: zsh-workers 5565
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: PATCH: numeric argument in widgets
- Date: Mon, 1 Mar 1999 13:19:06 +0100 (MET)
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Dunno if you think this is the right way to do it. The patch below
adds the special zle parameter `NUMERIC' which makes the numeric
argument available inside zle widgets. (Should I have used
`NUMERICARG'?)
Bye
Sven
diff -u os/Zle/zle_params.c Src/Zle/zle_params.c
--- os/Zle/zle_params.c Mon Mar 1 13:11:31 1999
+++ Src/Zle/zle_params.c Mon Mar 1 13:16:36 1999
@@ -67,6 +67,8 @@
zleunsetfn, NULL },
{ "keys", PM_ARRAY | PM_READONLY, NULL, FN(get_keys),
zleunsetfn, NULL },
+ { "NUMERIC", PM_INTEGER | PM_READONLY, FN(set_numeric), FN(get_numeric),
+ zleunsetfn, NULL },
{ NULL, 0, NULL, NULL, NULL, NULL }
};
@@ -244,4 +246,18 @@
*q = NULL;
return r;
+}
+
+/**/
+static void
+set_cursor(Param pm, long x)
+{
+ zmult = x;
+}
+
+/**/
+static long
+get_numeric(Param pm)
+{
+ return zmult;
}
diff -u od/Zsh/zle.yo Doc/Zsh/zle.yo
--- od/Zsh/zle.yo Mon Mar 1 13:11:46 1999
+++ Doc/Zsh/zle.yo Mon Mar 1 13:15:19 1999
@@ -154,6 +154,10 @@
and meta-keys are repoted with a leading `tt(M-)', as in `tt(M-a)' and
`tt(M-^A)'.
)
+vindex(NUMERIC)
+item(tt(NUMERIC) (integer))(
+The numeric argument.
+)
enditem()
sect(Standard Widgets)
cindex(widgets, standard)
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author