zsh-workers
 help / color / mirror / code / Atom feed
From: "Rocky Bernstein" <rocky.bernstein@gmail.com>
To: "Peter Stephenson" <pws@csr.com>
Cc: "Zsh Hackers' List" <zsh-workers@sunsite.dk>
Subject: Re: preventing the leading space in process substitution
Date: Thu, 11 Sep 2008 08:44:07 -0400	[thread overview]
Message-ID: <6cd6de210809110544u569838dk5a93a739fa267822@mail.gmail.com> (raw)
In-Reply-To: <20080911130005.7c5e2b7c@news01>

[-- Attachment #1: Type: text/plain, Size: 3989 bytes --]

Thanks. I think this will be a big improvement.

A gentle nudge on having trap DEBUG (if not other traps as well) inherited
in subshells. ;-)

Thanks again.

On Thu, Sep 11, 2008 at 8:00 AM, Peter Stephenson <pws@csr.com> wrote:

> On Wed, 10 Sep 2008 14:51:04 -0400
> "Rocky Bernstein" <rocky.bernstein@gmail.com> wrote:
> > Also (mentioned previously), I think the multiple function definition
> with a
> > single body syntax should be removed when sh or bash emulation is in
> effect.
> > Those POSIX shell variants neither support this form and having it around
> > allows it to get confused causing a more obscure error message when one
> > writes "typeset -a foo=(list)" which is valid in those other POSIX shell
> > variants.
>
> (Moved to zsh-workers.)
>
> That's probably useful; it's been spotted before that multiple function
> definitions of this form can be pretty confusing to zsh users, too.
>
> Note, however, that the case you showed already gives a different error,
> since the parentheses aren't empty.  In bash/ksh emulation you should get
> the reasonable "typeset: foo: can't assign initial value for array".
>
> Index: Doc/Zsh/options.yo
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Doc/Zsh/options.yo,v
> retrieving revision 1.63
> diff -u -r1.63 options.yo
> --- Doc/Zsh/options.yo  7 Aug 2008 16:27:15 -0000       1.63
> +++ Doc/Zsh/options.yo  11 Sep 2008 11:43:08 -0000
> @@ -1133,6 +1133,14 @@
>
>  will restore normally handling of tt(SIGINT) after the function exits.
>  )
> +pindex(MULTI_FUNC_DEF)
> +item(tt(MULTI_FUNC_DEF) <Z>)(
> +Allow definitions of multiple functions at once in the form `tt(fn1
> +fn2)var(...)tt(LPAR()RPAR())'; if the option is not set, this causes
> +a parse error.  Definition of multiple functions with the tt(function)
> +keyword is always allowed.  Multiple function definitions are not often
> +used and can cause obscure errors.
> +)
>  pindex(MULTIOS)
>  item(tt(MULTIOS) <Z>)(
>  Perform implicit bf(tee)s or bf(cat)s when multiple
> Index: Src/options.c
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Src/options.c,v
> retrieving revision 1.45
> diff -u -r1.45 options.c
> --- Src/options.c       7 Aug 2008 16:27:15 -0000       1.45
> +++ Src/options.c       11 Sep 2008 11:43:08 -0000
> @@ -181,6 +181,7 @@
>                              0
>  #endif
>                              },                         MULTIBYTE},
> +{{NULL, "multifuncdef",              OPT_EMULATE|OPT_ZSH},
>  MULTIFUNCDEF},
>  {{NULL, "multios",           OPT_EMULATE|OPT_ZSH},      MULTIOS},
>  {{NULL, "nomatch",           OPT_EMULATE|OPT_NONBOURNE},NOMATCH},
>  {{NULL, "notify",            OPT_ZSH},                  NOTIFY},
> Index: Src/parse.c
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Src/parse.c,v
> retrieving revision 1.73
> diff -u -r1.73 parse.c
> --- Src/parse.c 1 Sep 2008 20:18:48 -0000       1.73
> +++ Src/parse.c 11 Sep 2008 11:43:08 -0000
> @@ -1663,6 +1663,9 @@
>            zlong oldlineno = lineno;
>            int onp, so, oecssub = ecssub;
>
> +           if (!isset(MULTIFUNCDEF) && argc > 1)
> +               YYERROR(oecused);
> +
>            *complex = c;
>            lineno = 0;
>            incmdpos = 1;
> Index: Src/zsh.h
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Src/zsh.h,v
> retrieving revision 1.145
> diff -u -r1.145 zsh.h
> --- Src/zsh.h   3 Sep 2008 09:08:22 -0000       1.145
> +++ Src/zsh.h   11 Sep 2008 11:43:08 -0000
> @@ -1882,6 +1882,7 @@
>     MENUCOMPLETE,
>     MONITOR,
>     MULTIBYTE,
> +    MULTIFUNCDEF,
>     MULTIOS,
>     NOMATCH,
>     NOTIFY,
>
>
> --
> 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
>

[-- Attachment #2: Type: text/html, Size: 5712 bytes --]

  reply	other threads:[~2008-09-11 12:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080909144101.GA30693@lapse.rw.madduck.net>
     [not found] ` <200809101124.m8ABOlKI005063@news01.csr.com>
     [not found]   ` <080910074842.ZM19151@torch.brasslantern.com>
     [not found]     ` <200809101510.m8AFAajX007203@news01.csr.com>
     [not found]       ` <080910090554.ZM19272@torch.brasslantern.com>
     [not found]         ` <6cd6de210809101151q4d0a2a35p452fe656e0ee7dd5@mail.gmail.com>
2008-09-11 12:00           ` Peter Stephenson
2008-09-11 12:44             ` Rocky Bernstein [this message]
2008-09-11 13:05               ` Peter Stephenson
2008-09-11 14:35                 ` Bart Schaefer
2008-09-11 14:54                   ` Peter Stephenson
2008-09-11 15:59                     ` Rocky Bernstein
2008-09-11 17:11                     ` PATCH: indent in code output (was Re: preventing the leading space ...) 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=6cd6de210809110544u569838dk5a93a739fa267822@mail.gmail.com \
    --to=rocky.bernstein@gmail.com \
    --cc=pws@csr.com \
    --cc=zsh-workers@sunsite.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).