zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@cambridgesiliconradio.com>
To: zsh-workers@sunsite.auc.dk (Zsh hackers list)
Subject: Re: `typeset -H' is a bit too thorough
Date: Mon, 12 Jun 2000 10:20:56 +0100	[thread overview]
Message-ID: <0FW100LBJBAW1J@la-la.cambridgesiliconradio.com> (raw)
In-Reply-To: Your message of "Sun, 11 Jun 2000 20:48:56 -0000."

> 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 <pws@cambridgesiliconradio.com>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070


             reply	other threads:[~2000-06-12  9:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-12  9:20 Peter Stephenson [this message]
2000-06-12 11:59 ` Bart Schaefer
2000-06-13  8:56   ` Peter Stephenson
2000-06-13 17:42   ` Peter Stephenson
  -- strict thread matches above, loose matches on Subject: below --
2000-06-11 20:48 Bart Schaefer

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=0FW100LBJBAW1J@la-la.cambridgesiliconradio.com \
    --to=pws@cambridgesiliconradio.com \
    --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).