zsh-workers
 help / color / mirror / code / Atom feed
* set - $foo resets set -x
@ 2006-09-19 16:23 Andrey Borzenkov
  2006-09-19 16:54 ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Andrey Borzenkov @ 2006-09-19 16:23 UTC (permalink / raw)
  To: zsh-workers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Well, specifically debugging completion functions you do not actually have 
control over it; functions just appear to return out of the middle without 
any apparent reason.

It looks intentional:

    /* Obsolescent sh compatibility: set - is the same as set +xv *
     * and set - args is the same as set +xv -- args              */
    if (*args && **args == '-' && !args[0][1]) {
        dosetopt(VERBOSE, 0, 0);
        dosetopt(XTRACE, 0, 0);
        if (!args[1])
            return 0;
    }

Anyone remembers the reasons for that? May be we can at least relax it if 
running in emulate zsh mode?

- -andrey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFEBlqR6LMutpd94wRAuFZAJ9chUUsudM6P+tygd3Vc0WJf4UOoQCfZcid
tTH42YOo9iY1UML8TdDZgWs=
=XjoF
-----END PGP SIGNATURE-----


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

* Re: set - $foo resets set -x
  2006-09-19 16:23 set - $foo resets set -x Andrey Borzenkov
@ 2006-09-19 16:54 ` Peter Stephenson
  2006-09-20  4:52   ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 2006-09-19 16:54 UTC (permalink / raw)
  To: Zsh hackers list

Andrey Borzenkov wrote:
>     /* Obsolescent sh compatibility: set - is the same as set +xv *
>      * and set - args is the same as set +xv -- args              */
>     if (*args && **args == '-' && !args[0][1]) {
>         dosetopt(VERBOSE, 0, 0);
>         dosetopt(XTRACE, 0, 0);
>         if (!args[1])
>             return 0;
>     }
> 
> Anyone remembers the reasons for that? May be we can at least relax it if 
> running in emulate zsh mode?

I'm inclined to agree, since zsh's native emulation tends to remove the
worst idiocies from prehistory, and currently it doesn't even seem to be
documented...

Index: Doc/Zsh/builtins.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/builtins.yo,v
retrieving revision 1.86
diff -u -r1.86 builtins.yo
--- Doc/Zsh/builtins.yo	24 Jul 2006 22:00:20 -0000	1.86
+++ Doc/Zsh/builtins.yo	19 Sep 2006 16:51:40 -0000
@@ -1160,6 +1160,10 @@
 If no arguments and no `tt(-)tt(-)' are given, then the names and values of
 all parameters are printed on the standard output.  If the only argument is
 `tt(PLUS())', the names of all parameters are printed.
+
+For historical reasons, `tt(set -)' is treated as `tt(set +xv)'
+and `tt(set -) var(args)' as `tt(set +xv --) var(args)' when in
+any other emulation mode than zsh's native mode.
 )
 module(setcap)(zsh/cap)
 findex(setopt)
Index: Src/builtin.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v
retrieving revision 1.162
diff -u -r1.162 builtin.c
--- Src/builtin.c	10 Sep 2006 19:11:54 -0000	1.162
+++ Src/builtin.c	19 Sep 2006 16:51:41 -0000
@@ -535,7 +535,7 @@
 
     /* Obsolescent sh compatibility: set - is the same as set +xv *
      * and set - args is the same as set +xv -- args              */
-    if (*args && **args == '-' && !args[0][1]) {
+    if (emulation != EMULATE_ZSH && *args && **args == '-' && !args[0][1]) {
 	dosetopt(VERBOSE, 0, 0);
 	dosetopt(XTRACE, 0, 0);
 	if (!args[1])

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php


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

* Re: set - $foo resets set -x
  2006-09-19 16:54 ` Peter Stephenson
@ 2006-09-20  4:52   ` Bart Schaefer
  2006-09-20 15:40     ` Andrey Borzenkov
  0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2006-09-20  4:52 UTC (permalink / raw)
  To: Zsh hackers list

On Sep 19,  5:54pm, Peter Stephenson wrote:
}
} > Anyone remembers the reasons for that? May be we can at least relax
} > it if running in emulate zsh mode?
} 
} I'm inclined to agree, since zsh's native emulation tends to remove
} the worst idiocies from prehistory, and currently it doesn't even seem
} to be documented...

This was not present in zsh 2.4, but is in 3.0 as far back as I have
records (1997-ish).  This allowed me to track it down in the mailing
list archives:

http://www.zsh.org/mla/workers/1996/msg01233.html
http://www.zsh.org/mla/workers/1996/msg01238.html

Andrey, you have no one but yourself to blame, even if you were using
j and w back then. :-)


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

* Re: set - $foo resets set -x
  2006-09-20  4:52   ` Bart Schaefer
@ 2006-09-20 15:40     ` Andrey Borzenkov
  2006-09-20 16:04       ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Andrey Borzenkov @ 2006-09-20 15:40 UTC (permalink / raw)
  To: zsh-workers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 20 September 2006 08:52, Bart Schaefer wrote:
> This was not present in zsh 2.4,

do you keep every version?

> but is in 3.0 as far back as I have 
> records (1997-ish).  This allowed me to track it down in the mailing
> list archives:
>
> http://www.zsh.org/mla/workers/1996/msg01233.html
> http://www.zsh.org/mla/workers/1996/msg01238.html
>
> Andrey, you have no one but yourself to blame,

We did not have completion system at this time :) Well, I was actually 
concerned about unintentional clobbering of positional arguments ...

> even if you were using 
> j and w back then. :-)

It was nice time :)

tnx
 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFEWD8R6LMutpd94wRAiHBAJ9T7jNK9tpdt4zcNpsNAcFia7ujvACfYPLi
rEYlb94u9PoGBCogI9n1XBA=
=p7Rz
-----END PGP SIGNATURE-----


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

* Re: set - $foo resets set -x
  2006-09-20 15:40     ` Andrey Borzenkov
@ 2006-09-20 16:04       ` Bart Schaefer
  0 siblings, 0 replies; 5+ messages in thread
From: Bart Schaefer @ 2006-09-20 16:04 UTC (permalink / raw)
  To: zsh-workers

On Sep 20,  7:40pm, Andrey Borzenkov wrote:
}
} do you keep every version?

No.  I believe I have tarballs of 2.1.something, 2.2, and 2.6.something
in backups of my files from old computers.  I have an extracted source
tree of 2.4 on my present home computer because I dug it out of one
such backup years ago to compare something to 3.0, and it was still
sitting there when I transferred my whole disk image last time.  I've
been keeping my own CVS repository since early in the 3.0 series but
most of my commit logs now say "merge from SourceForge ..." where the
"..." is a set of mailing list article numbers cribbed from ChangeLog.

I had a falling-out with the maintainer who took over for the 2.5
series because he was dead-set on removing all the csh-isms and making
zsh into a POSIX-conformant ksh clone, so I just stopped upgrading zsh
for a few years and don't have any records of what went on during that
time.  Saner heads prevailed around the advent of 2.6 and I came back.

Tracking this particular thing to the mailing list was as much thanks
to Zoltan not being able to spell "obsolescent" as anything else.  His
same typo appears in both very old sources and those list postings. :-)

-- 


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

end of thread, other threads:[~2006-09-20 16:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-19 16:23 set - $foo resets set -x Andrey Borzenkov
2006-09-19 16:54 ` Peter Stephenson
2006-09-20  4:52   ` Bart Schaefer
2006-09-20 15:40     ` Andrey Borzenkov
2006-09-20 16:04       ` 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).