zsh-workers
 help / color / mirror / code / Atom feed
* Re: expansion of environment variables
       [not found]       ` <200903051746.n25HkB77026580@news01.csr.com>
@ 2009-03-06  4:54         ` Bart Schaefer
  2009-03-06  9:51           ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2009-03-06  4:54 UTC (permalink / raw)
  To: zsh-workers

[>workers]

On Mar 5,  5:46pm, Peter Stephenson wrote:
}
} You're right, I missed that last step, there is indeed stuff in tmp1
} including the correct completion.

I've been staring at this and I've concluded (possibly wrongly) that
even the stuff in tmp1 is a bit of a red herring.

Correct me, but isn't the real problem that the string on the line
still looks like "$key." but all of the possible matches look like
"2345.xml"?  The literal string "$key" is not going to match the
literal string "2345" no matter what we do with prefixes, and the
-U option (if it helps at all) is merely going to overwrite "$key."
with "2345." which is exactly the behavior we were asked how avoid
in the first place.

This may be a case where the factoring of the old internals into the
set of comp* builtins has resulted in a loss of information.  We can
figure out that [[ 2345.xml = $key.* ]] but it's a lot harder to
figure out based on that, that "$key.xml" is what needs to be fed
into compadd instead of "2345.xml".

What we need is something that recurses along the strings the way
that the internals of matchers do, but that knows about parameter
replacements instead of (or as well as) matching classes.

-- 


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

* Re: expansion of environment variables
  2009-03-06  4:54         ` expansion of environment variables Bart Schaefer
@ 2009-03-06  9:51           ` Peter Stephenson
  2009-03-06 17:17             ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2009-03-06  9:51 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers

Bart Schaefer wrote:
> [>workers]
> 
> On Mar 5,  5:46pm, Peter Stephenson wrote:
> }
> } You're right, I missed that last step, there is indeed stuff in tmp1
> } including the correct completion.
> 
> I've been staring at this and I've concluded (possibly wrongly) that
> even the stuff in tmp1 is a bit of a red herring.
> 
> Correct me, but isn't the real problem that the string on the line
> still looks like "$key." but all of the possible matches look like
> "2345.xml"?

Yep, I'd eventually come to that conclusion.  I think compfiles is
generating files without doing any matching at this stage (I think it
would do clever stuff with globbing if requested for limiting the
matches, but that's not the case here), so we get a complete list of
files that may or may not match the command line.  Then the compadd -D
is doing the matching, and that's where it all falls over for the reason
you say.  We'd need at the least to massage or hide the $PREFIX/$SUFFIX
seen by that second step, or equivalent sneaky trick.

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


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

* Re: expansion of environment variables
  2009-03-06  9:51           ` Peter Stephenson
@ 2009-03-06 17:17             ` Bart Schaefer
  0 siblings, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2009-03-06 17:17 UTC (permalink / raw)
  To: zsh-workers

On Mar 6,  9:51am, Peter Stephenson wrote:
}
} Yep, I'd eventually come to that conclusion.  I think compfiles is
} generating files without doing any matching at this stage

This leaves us with the question of what changed (and why) in the builtin
(compctl) widgets that has caused the new behavior there.


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

end of thread, other threads:[~2009-03-06 17:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <d5baa8100903050235ofd66039jf2c29b58684bc8d8@mail.gmail.com>
     [not found] ` <090305081548.ZM4603@torch.brasslantern.com>
     [not found]   ` <20090305165400.3fd18bc6@news01>
     [not found]     ` <090305092126.ZM4727@torch.brasslantern.com>
     [not found]       ` <200903051746.n25HkB77026580@news01.csr.com>
2009-03-06  4:54         ` expansion of environment variables Bart Schaefer
2009-03-06  9:51           ` Peter Stephenson
2009-03-06 17:17             ` 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).