zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: Any comment on users/15442 ?
Date: Thu, 7 Oct 2010 21:24:46 +0100	[thread overview]
Message-ID: <20101007212446.06a476b0@pws-pc> (raw)
In-Reply-To: <101005185057.ZM5374@torch.brasslantern.com>

/* Er, yeah. */

> } host# IFS=
> } host# set - "a b" "c   d" e$'\0'f 'gxh'
> } host# setopt sh_wordsplit
> } host# print -l $*
> } a bc   defgxh
> 
> This might in fact be a bug.  Fix (?) below; everyone but PWS can stop
> reading when their eyes begin to glaze over, as this is zsh-workers
> material.  I took the approach of basing this on emulation mode rather
> than on the SH_WORD_SPLIT option, to minimize zsh-mode disruption, but
> that can easily be adjusted.

I think the option would be better.  I'm not very keen on things that
can only be adjusted by changing the entire emulation.  Anything
beginning "SH_" means "do this like sh, you are now leaving the world of
zsh", in my book [it's still selling], so the usual guarantees that we
won't change the behaviour are superseded by sh compatibility.  That
also makes it easier to test.

> The following implements the ksh-equivalent behavior by initializing the
> state of the (@) flag based upon the value of $IFS when we are in sh/ksh
> emulation mode, and then by requiring later joining to pay attention.
> However, it also has the side-effect of changing the behavior of ${=...}
> in a related way.

I doubt that's a problem.  I think they should split in the same way.
We're now in sh-land using a zsh-specific feature with an unusual
setting for IFS.  It probably just needs to follow sh behaviour.

> There no longer is a chunk marked "YUK" that I can find so I'm not sure
> what either of these refers to.

I think this went when Wayne fixed up word splitting so it worked
properly on strings that occur inside braced parameter substitutions.
Look at the 4.2 branch if you want to see what it looked like before.
Hence many of the comments may be out of date.  It also may have made
isarr operate differently.

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


      reply	other threads:[~2010-10-07 20:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-06  1:50 Bart Schaefer
2010-10-07 20:24 ` Peter Stephenson [this message]

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=20101007212446.06a476b0@pws-pc \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \
    /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).