zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: print -D and ${(D)} quoting
Date: Tue, 12 Oct 2010 18:56:49 -0700	[thread overview]
Message-ID: <101012185649.ZM20220@torch.brasslantern.com> (raw)
In-Reply-To: <20101012215339.26037042@pws-pc>

On Oct 12,  9:53pm, Peter Stephenson wrote:
}
} Here, I think, is the uncontroversial part, that changes the (D)
} substitution flag.

Naturally, asserting lack of controversy means I have a question ...

} Index: Doc/Zsh/expn.yo
} ===================================================================
}  item(tt(D))(
}  Assume the string or array elements contain directories and attempt
} +to substitute the leading part of these by names.  The remainder of
} +the path (the whole of it if the leading part was not subsituted)
} +is then quoted so that the whole string can be used as a shell
} +argument.  This is the reverse of `tt(~)' substitution:  see
}  ifnzman(noderef(Filename Expansion))\
}  ifzman(the section FILENAME EXPANSION below).
}  )

Is quoting the rest of the string really the correct thing to do?
Consider ${${(D)foo}:r} or ${=${(D)foo}}.  Why do you believe 
${(Q)$(D)foo}} should be necessary to operate on the original
string, modulo tilde contraction?  Is it because that's easier
on a zsh script programmer than figuring out where to use (q)?
Perhaps steps 13 and 14 from the "rules" should be combined in
some way, so (qD) together differs from either used alone?  

Non-sequitur:

The implementation of the (q-) flag is still a bit confusing; the
form (q-q) behaves like (qq), but (qq-) is "error in flags" whereas
(q-qq), (q-qqq), etc. for any number of "q" after the "-", reports:
    Src/utils.c:4685: BUG: bad quote type in quotestring
and then behaves like (qq).


  reply	other threads:[~2010-10-13  1:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-12 16:52 Peter Stephenson
2010-10-12 20:53 ` Peter Stephenson
2010-10-13  1:56   ` Bart Schaefer [this message]
2010-10-13  9:04     ` Peter Stephenson
2010-10-13 16:14       ` Bart Schaefer
2010-10-13 16:45         ` 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=101012185649.ZM20220@torch.brasslantern.com \
    --to=schaefer@brasslantern.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).