From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17790 invoked from network); 13 Jul 1999 13:03:43 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 13 Jul 1999 13:03:43 -0000 Received: (qmail 24985 invoked by alias); 13 Jul 1999 13:03:29 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7111 Received: (qmail 24978 invoked from network); 13 Jul 1999 13:03:29 -0000 Date: Tue, 13 Jul 1999 15:03:26 +0200 (MET DST) Message-Id: <199907131303.PAA10232@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Sven Wischnowsky's message of Wed, 7 Jul 1999 10:15:38 +0200 (MET DST) Subject: Re: PATCH: Enhancing math expressions a bit I wrote: > If we once agree to use this patch, we should probably change > the `keys' special parameter to a special scalar with just the literal > characters. This does that: it replaces `keys' with `KEYS' and that contains the literal character codes. I hope you agree that it's better to have this consistent with `read'. Now, should we add a way to turn such codes into a readable form? Bye Sven P.S.: I should have sent this before test-1. diff -u os/Zle/zle_params.c Src/Zle/zle_params.c --- os/Zle/zle_params.c Tue Jul 13 10:59:34 1999 +++ Src/Zle/zle_params.c Tue Jul 13 14:52:46 1999 @@ -67,7 +67,7 @@ zleunsetfn, NULL }, { "LASTWIDGET", PM_SCALAR | PM_READONLY, NULL, FN(get_lwidget), zleunsetfn, NULL }, - { "keys", PM_ARRAY | PM_READONLY, NULL, FN(get_keys), + { "KEYS", PM_SCALAR | PM_READONLY, NULL, FN(get_keys), zleunsetfn, NULL }, { "NUMERIC", PM_INTEGER | PM_UNSET, FN(set_numeric), FN(get_numeric), unset_numeric, NULL }, @@ -247,29 +247,10 @@ } /**/ -static char ** +static char * get_keys(Param pm) { - char **r, **q, *p, *k, c; - - r = (char **) zhalloc((strlen(keybuf) + 1) * sizeof(char *)); - for (q = r, p = keybuf; (c = *p); q++, p++) { - k = *q = (char *) zhalloc(5); - if (c & 0x80) { - *k++ = 'M'; - *k++ = '-'; - c &= 0x7f; - } - if (c < 32 || c == 0x7f) { - *k++ = '^'; - c ^= 64; - } - *k++ = c; - *k = '\0'; - } - *q = NULL; - - return r; + return keybuf; } /**/ -- Sven Wischnowsky wischnow@informatik.hu-berlin.de