zsh-workers
 help / color / mirror / code / Atom feed
* Re: PATCH: Re: globsubst and =command
@ 2000-05-16 13:06 Sven Wischnowsky
  2000-05-16 13:39 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Sven Wischnowsky @ 2000-05-16 13:06 UTC (permalink / raw)
  To: zsh-workers


Peter Stephenson wrote:

> Sven wrote:
> > Tanaka Akira wrote:
> > > serein% print -r - $~a
> > > =ls
> > > 
> > > Since the expansion of =command is kind of filename expansion and ~
> > > enables filename expansion on the result, I think $~a should be expand
> > > to /bin/ls.  Do I miss something?
> > 
> > I don't think it should do that because it really is something
> > completely different.
> 
> $~a does do ~dir expansion (that's where the ~ originally came from, before
> it ever tokenized the rest of the pattern), which is performed at the same
> time as =cmd expansion, so it is a little odd.  The real issue is that `='
> don't get tokenized by on-the-fly tokenization.  This patch would do that.
> But if you can think of a good reason for not...?

Actually, I don't care that much, I was only thinking of cases where
something like this is used in test (`[[ \=foo = $~bar ]]') and didn't 
think of the `~' handling. And now that I have actually looked at the
docs: they are described together so...


Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


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

* Re: PATCH: Re: globsubst and =command
  2000-05-16 13:06 PATCH: Re: globsubst and =command Sven Wischnowsky
@ 2000-05-16 13:39 ` Peter Stephenson
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 2000-05-16 13:39 UTC (permalink / raw)
  To: Zsh hackers list

> Actually, I don't care that much, I was only thinking of cases where
> something like this is used in test (`[[ \=foo = $~bar ]]') and didn't 
> think of the `~' handling.

That could certainly be a nuisance.  A quick look for ` \=' in the
completion functions didn't seem to throw up any real problems, however.
Maybe it's OK to try it.

-- 
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] 3+ messages in thread

* PATCH: Re: globsubst and =command
  2000-05-16 12:41 Sven Wischnowsky
@ 2000-05-16 12:58 ` Peter Stephenson
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 2000-05-16 12:58 UTC (permalink / raw)
  To: Zsh hackers list

Sven wrote:
> Tanaka Akira wrote:
> > serein% print -r - $~a
> > =ls
> > 
> > Since the expansion of =command is kind of filename expansion and ~
> > enables filename expansion on the result, I think $~a should be expand
> > to /bin/ls.  Do I miss something?
> 
> I don't think it should do that because it really is something
> completely different.

$~a does do ~dir expansion (that's where the ~ originally came from, before
it ever tokenized the rest of the pattern), which is performed at the same
time as =cmd expansion, so it is a little odd.  The real issue is that `='
don't get tokenized by on-the-fly tokenization.  This patch would do that.
But if you can think of a good reason for not...?

Index: Src/glob.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/glob.c,v
retrieving revision 1.5
diff -u -r1.5 glob.c
--- Src/glob.c	2000/04/30 17:58:35	1.5
+++ Src/glob.c	2000/05/16 12:56:28
@@ -2395,6 +2395,7 @@
 	case ']':
 	case '*':
 	case '?':
+	case '=':
 	    for (t = ztokens; *t; t++)
 		if (*t == *s) {
 		    if (bslash)

-- 
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] 3+ messages in thread

end of thread, other threads:[~2000-05-16 13:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-16 13:06 PATCH: Re: globsubst and =command Sven Wischnowsky
2000-05-16 13:39 ` Peter Stephenson
  -- strict thread matches above, loose matches on Subject: below --
2000-05-16 12:41 Sven Wischnowsky
2000-05-16 12:58 ` PATCH: " Peter Stephenson

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