zsh-workers
 help / color / mirror / code / Atom feed
* Re: `typeset -H' is a bit too thorough
@ 2000-06-12  9:20 Peter Stephenson
  2000-06-12 11:59 ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 2000-06-12  9:20 UTC (permalink / raw)
  To: Zsh hackers list

> 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: `typeset -H' is a bit too thorough
  2000-06-12  9:20 `typeset -H' is a bit too thorough Peter Stephenson
@ 2000-06-12 11:59 ` Bart Schaefer
  2000-06-13  8:56   ` Peter Stephenson
  2000-06-13 17:42   ` Peter Stephenson
  0 siblings, 2 replies; 5+ messages in thread
From: Bart Schaefer @ 2000-06-12 11:59 UTC (permalink / raw)
  To: Peter Stephenson, Zsh hackers list

On Jun 12, 10:20am, Peter Stephenson wrote:
} Subject: Re: `typeset -H' is a bit too thorough
}
} (Still not getting incoming mail here, unfortunately

Which of your addresses is "here"?

} +#define PRINT_INCLUDEVALUE	(1<<4)
}  
}  /* flags for printing for the whence builtin */
}  #define PRINT_WHENCE_CSH	(1<<4)

Is it really OK for those two to overlap?  They haven't before ...

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: `typeset -H' is a bit too thorough
  2000-06-12 11:59 ` Bart Schaefer
@ 2000-06-13  8:56   ` Peter Stephenson
  2000-06-13 17:42   ` Peter Stephenson
  1 sibling, 0 replies; 5+ messages in thread
From: Peter Stephenson @ 2000-06-13  8:56 UTC (permalink / raw)
  To: Zsh hackers list

> On Jun 12, 10:20am, Peter Stephenson wrote:
> } Subject: Re: `typeset -H' is a bit too thorough
> }
> } (Still not getting incoming mail here, unfortunately
> 
> Which of your addresses is "here"?

CSR, but part of the problem was fetchmail hung after the mail server went
down.

> } +#define PRINT_INCLUDEVALUE	(1<<4)
> }  
> }  /* flags for printing for the whence builtin */
> }  #define PRINT_WHENCE_CSH	(1<<4)
> 
> Is it really OK for those two to overlap?  They haven't before ...

I suspect it's OK here, since this flag only gets passed directly to the
print routine for a param node, but it would have been better to keep up
appearances.

Index: Src/zsh.h
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/zsh.h,v
retrieving revision 1.14
diff -u -r1.14 zsh.h
--- Src/zsh.h	2000/06/12 09:27:09	1.14
+++ Src/zsh.h	2000/06/13 08:54:43
@@ -1216,11 +1216,11 @@
 #define PRINT_INCLUDEVALUE	(1<<4)
 
 /* flags for printing for the whence builtin */
-#define PRINT_WHENCE_CSH	(1<<4)
-#define PRINT_WHENCE_VERBOSE	(1<<5)
-#define PRINT_WHENCE_SIMPLE	(1<<6)
-#define PRINT_WHENCE_FUNCDEF	(1<<7)
-#define PRINT_WHENCE_WORD	(1<<8)
+#define PRINT_WHENCE_CSH	(1<<5)
+#define PRINT_WHENCE_VERBOSE	(1<<6)
+#define PRINT_WHENCE_SIMPLE	(1<<7)
+#define PRINT_WHENCE_FUNCDEF	(1<<9)
+#define PRINT_WHENCE_WORD	(1<<10)
 
 /***********************************/
 /* Definitions for history control */

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: `typeset -H' is a bit too thorough
  2000-06-12 11:59 ` Bart Schaefer
  2000-06-13  8:56   ` Peter Stephenson
@ 2000-06-13 17:42   ` Peter Stephenson
  1 sibling, 0 replies; 5+ messages in thread
From: Peter Stephenson @ 2000-06-13 17:42 UTC (permalink / raw)
  To: Zsh hackers list

[The original version of this is probably sitting in a retry queue and
could appear at any moment.  Our mail server is very temperamental.  Be
alert.  I've already committed this change.]

Bart wrote:
> On Jun 12, 10:20am, Peter Stephenson wrote:
> } Subject: Re: `typeset -H' is a bit too thorough
> }
> } (Still not getting incoming mail here, unfortunately
> 
> Which of your addresses is "here"?

CSR, but part of the problem was fetchmail hung after the mail server went
down, so I've actually got most of the missing messages (the ones before
sunsite.auc.dk disappeared off the scopes).

> } +#define PRINT_INCLUDEVALUE	(1<<4)
> }  
> }  /* flags for printing for the whence builtin */
> }  #define PRINT_WHENCE_CSH	(1<<4)
> 
> Is it really OK for those two to overlap?  They haven't before ...

I suspect it's OK here, since this flag only gets passed directly to the
print routine for a param node, but it would have been better to keep up
appearances.

Index: Src/zsh.h
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/zsh.h,v
retrieving revision 1.14
diff -u -r1.14 zsh.h
--- Src/zsh.h	2000/06/12 09:27:09	1.14
+++ Src/zsh.h	2000/06/13 08:54:43
@@ -1216,11 +1216,11 @@
 #define PRINT_INCLUDEVALUE	(1<<4)
 
 /* flags for printing for the whence builtin */
-#define PRINT_WHENCE_CSH	(1<<4)
-#define PRINT_WHENCE_VERBOSE	(1<<5)
-#define PRINT_WHENCE_SIMPLE	(1<<6)
-#define PRINT_WHENCE_FUNCDEF	(1<<7)
-#define PRINT_WHENCE_WORD	(1<<8)
+#define PRINT_WHENCE_CSH	(1<<5)
+#define PRINT_WHENCE_VERBOSE	(1<<6)
+#define PRINT_WHENCE_SIMPLE	(1<<7)
+#define PRINT_WHENCE_FUNCDEF	(1<<9)
+#define PRINT_WHENCE_WORD	(1<<10)
 
 /***********************************/
 /* Definitions for history control */

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* `typeset -H' is a bit too thorough
@ 2000-06-11 20:48 Bart Schaefer
  0 siblings, 0 replies; 5+ messages in thread
From: Bart Schaefer @ 2000-06-11 20:48 UTC (permalink / raw)
  To: zsh-workers

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?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-06-13 19:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-12  9:20 `typeset -H' is a bit too thorough Peter Stephenson
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

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).