From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18721 invoked from network); 1 Mar 1999 12:20:46 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 1 Mar 1999 12:20:46 -0000 Received: (qmail 20425 invoked by alias); 1 Mar 1999 12:19:50 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5565 Received: (qmail 20418 invoked from network); 1 Mar 1999 12:19:49 -0000 Date: Mon, 1 Mar 1999 13:19:06 +0100 (MET) Message-Id: <199903011219.NAA14496@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk Subject: PATCH: numeric argument in widgets 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@informatik.hu-berlin.de