From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28046 invoked from network); 12 Jun 2000 09:21:59 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 12 Jun 2000 09:21:59 -0000 Received: (qmail 20608 invoked by alias); 12 Jun 2000 09:21:24 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11867 Received: (qmail 20600 invoked from network); 12 Jun 2000 09:21:24 -0000 Date: Mon, 12 Jun 2000 10:20:56 +0100 From: Peter Stephenson Subject: Re: `typeset -H' is a bit too thorough In-reply-to: Your message of "Sun, 11 Jun 2000 20:48:56 -0000." To: zsh-workers@sunsite.auc.dk (Zsh hackers list) Message-id: <0FW100LBJBAW1J@la-la.cambridgesiliconradio.com> Content-transfer-encoding: 7BIT > There needs to be some way to get the value to display without actually > turning off the HIDEVAL bit. E.g., perhaps HIDEVAL should not apply to > parameters named explicitly as arguments of typeset? (Still not getting incoming mail here, unfortunately, which means getting message from the archive and stripping off the HTML. It would be useful to be able to get individual messages in plain text, e.g. as an option on the HTML display.) The easiest fix is to turn this off whenever the parameter is referred to by name or by pattern. I'm not sure if that's the right thing to do with patterns, but that's always behaved just as if the parameter was picked by name, so I suppose it's OK. Index: Doc/Zsh/builtins.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/builtins.yo,v retrieving revision 1.10 diff -u -r1.10 builtins.yo --- Doc/Zsh/builtins.yo 2000/06/09 15:37:05 1.10 +++ Doc/Zsh/builtins.yo 2000/06/12 09:16:33 @@ -1132,9 +1132,11 @@ Hide value: specifies that tt(typeset) will not display the value of the parameter when listing parameters; the display for such parameters is always as if the `tt(PLUS())' flag had been given. Use of the parameter is -in other respects normal. This is on by default for the parameters in the -tt(zsh/parameter) and tt(zsh/mapfile) modules. Note, however, that unlike -the tt(-h) flag this is also useful for non-special parameters. +in other respects normal, and the option does not apply if the parameter is +specified by name, or by pattern with the tt(-m) option. This is on by +default for the parameters in the tt(zsh/parameter) and tt(zsh/mapfile) +modules. Note, however, that unlike the tt(-h) flag this is also useful +for non-special parameters. ) item(tt(-i))( Use an internal integer representation. If var(n) is nonzero it Index: Src/builtin.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v retrieving revision 1.22 diff -u -r1.22 builtin.c --- Src/builtin.c 2000/06/09 15:37:05 1.22 +++ Src/builtin.c 2000/06/12 09:16:33 @@ -1598,7 +1598,7 @@ if (usepm) { on &= ~PM_LOCAL; if (!on && !roff && !value) { - paramtab->printnode((HashNode)pm, 0); + paramtab->printnode((HashNode)pm, PRINT_INCLUDEVALUE); return pm; } if ((pm->flags & PM_RESTRICTED) && isset(RESTRICTED)) { Index: Src/params.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/params.c,v retrieving revision 1.18 diff -u -r1.18 params.c --- Src/params.c 2000/06/09 15:37:05 1.18 +++ Src/params.c 2000/06/12 09:16:33 @@ -3181,7 +3181,8 @@ printf("exported "); } - if ((printflags & PRINT_NAMEONLY) || (p->flags & PM_HIDEVAL)) { + if ((printflags & PRINT_NAMEONLY) || + ((p->flags & PM_HIDEVAL) && !(printflags & PRINT_INCLUDEVALUE))) { zputs(p->nam, stdout); putchar('\n'); return; Index: Src/zsh.h =================================================================== RCS file: /cvsroot/zsh/zsh/Src/zsh.h,v retrieving revision 1.13 diff -u -r1.13 zsh.h --- Src/zsh.h 2000/06/09 15:37:05 1.13 +++ Src/zsh.h 2000/06/12 09:16:33 @@ -1213,6 +1213,7 @@ #define PRINT_TYPE (1<<1) #define PRINT_LIST (1<<2) #define PRINT_KV_PAIR (1<<3) +#define PRINT_INCLUDEVALUE (1<<4) /* flags for printing for the whence builtin */ #define PRINT_WHENCE_CSH (1<<4) -- Peter Stephenson Cambridge Silicon Radio, Unit 300, Science Park, Milton Road, Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070