zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: Enhancing math expressions a bit
Date: Tue, 13 Jul 1999 15:03:26 +0200 (MET DST)	[thread overview]
Message-ID: <199907131303.PAA10232@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Sven Wischnowsky's message of Wed, 7 Jul 1999 10:15:38 +0200 (MET DST)


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


             reply	other threads:[~1999-07-13 13:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-13 13:03 Sven Wischnowsky [this message]
1999-07-13 12:40 ` Peter Stephenson
  -- strict thread matches above, loose matches on Subject: below --
1999-07-13 13:24 Sven Wischnowsky
1999-07-13 13:11 ` Peter Stephenson
1999-07-07 13:23 Sven Wischnowsky
1999-07-07 13:16 ` Peter Stephenson
1999-07-07 11:05 Sven Wischnowsky
1999-07-07  9:32 Sven Wischnowsky
1999-07-07  8:15 Sven Wischnowsky
1999-07-07 10:42 ` Andrej Borsenkow
1999-07-07 11:40 ` Andrej Borsenkow
1999-07-07 11:57 ` Peter Stephenson
1999-07-07 12:29   ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199907131303.PAA10232@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).