zsh-users
 help / color / mirror / code / Atom feed
* compctl -g not working
@ 2001-10-03  2:53 Sweth Chandramouli
  2001-10-03  3:16 ` Philippe Troin
  0 siblings, 1 reply; 13+ messages in thread
From: Sweth Chandramouli @ 2001-10-03  2:53 UTC (permalink / raw)
  To: ZSH Users

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

	Any suggestions as to what I'm missing here?  I've had
this in my config for a while, but haven't used it in quite a while,
and now it isn't working; I have no idea what I might have changed
to break this:

$ echo $ZSH_VERSION 
3.1.9
$ echo RCS/*(:t:s/\,v//)
logwatchd m2s
$ compctl -g 'RCS/*(:t:s/\,v//)' co       
$ compctl -L | grep co\$                  
compctl -g 'RCS/*(:t:s/\,v//)' co
$ co <TAB>

	returns nothing.

	-- Sweth.

-- 
Sweth Chandramouli ; <svc@sweth.net>
President, Idiopathic Systems Consulting

[-- Attachment #2: Type: application/pgp-signature, Size: 236 bytes --]

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

* Re: compctl -g not working
  2001-10-03  2:53 compctl -g not working Sweth Chandramouli
@ 2001-10-03  3:16 ` Philippe Troin
  2001-10-03  3:18   ` Sweth Chandramouli
  0 siblings, 1 reply; 13+ messages in thread
From: Philippe Troin @ 2001-10-03  3:16 UTC (permalink / raw)
  To: Sweth Chandramouli; +Cc: ZSH Users

Sweth Chandramouli <svc@sweth.net> writes:

> 	Any suggestions as to what I'm missing here?  I've had
> this in my config for a while, but haven't used it in quite a while,
> and now it isn't working; I have no idea what I might have changed
> to break this:
> 
> $ echo $ZSH_VERSION 
> 3.1.9
> $ echo RCS/*(:t:s/\,v//)
> logwatchd m2s
> $ compctl -g 'RCS/*(:t:s/\,v//)' co       
> $ compctl -L | grep co\$                  
> compctl -g 'RCS/*(:t:s/\,v//)' co
                         ^-- remove this backslash
> $ co <TAB>

Phil.


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

* Re: compctl -g not working
  2001-10-03  3:16 ` Philippe Troin
@ 2001-10-03  3:18   ` Sweth Chandramouli
  2001-10-03  4:04     ` Bart Schaefer
  0 siblings, 1 reply; 13+ messages in thread
From: Sweth Chandramouli @ 2001-10-03  3:18 UTC (permalink / raw)
  To: ZSH Users

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

On Tue, Oct 02, 2001 at 08:16:05PM -0700, Philippe Troin wrote:
> Sweth Chandramouli <svc@sweth.net> writes:
> > compctl -g 'RCS/*(:t:s/\,v//)' co
>                          ^-- remove this backslash
	Doesn't help.  Checking a little more, I see that none
of my -g completions work, but if I change them all to use -s (which is
a superset of -g), they all work fine.  Is there some way I might have
inadvertently disabled glob completion?

	-- Sweth.

-- 
Sweth Chandramouli ; <svc@sweth.net>
President, Idiopathic Systems Consulting

[-- Attachment #2: Type: application/pgp-signature, Size: 236 bytes --]

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

* Re: compctl -g not working
  2001-10-03  3:18   ` Sweth Chandramouli
@ 2001-10-03  4:04     ` Bart Schaefer
  2001-10-03  4:12       ` Sweth Chandramouli
  0 siblings, 1 reply; 13+ messages in thread
From: Bart Schaefer @ 2001-10-03  4:04 UTC (permalink / raw)
  To: Sweth Chandramouli, ZSH Users

On Oct 2, 11:18pm, Sweth Chandramouli wrote:
} Subject: Re: compctl -g not working
}
} 
} On Tue, Oct 02, 2001 at 08:16:05PM -0700, Philippe Troin wrote:
} > Sweth Chandramouli <svc@sweth.net> writes:
} > > compctl -g 'RCS/*(:t:s/\,v//)' co
} >                          ^-- remove this backslash
} 	Doesn't help.  Checking a little more, I see that none
} of my -g completions work, but if I change them all to use -s (which is
} a superset of -g), they all work fine.  Is there some way I might have
} inadvertently disabled glob completion?

Glob completion shouldn't have anything to do with it.

This is with `zsh -f':

zagzig% echo $ZSH_VERSION
4.0.1
zagzig% mkdir RCS; touch RCS/{foo,bar},v
zagzig% compctl -g 'RCS/*(:t:s/\,v//)' co               
zagzig% co <TAB>
bar,v   foo,v
zagzig% compctl -g 'RCS/*(:t:s/,v//)' co               
zagzig% co <TAB>
bar   foo 
zagzig% compctl -s 'RCS/*(:t:s/\,v//)' co 
zagzig% co <TAB>
bar   foo

So you're going to have to give us some more clues.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

* Re: compctl -g not working
  2001-10-03  4:04     ` Bart Schaefer
@ 2001-10-03  4:12       ` Sweth Chandramouli
  2001-10-03  6:04         ` Bart Schaefer
  0 siblings, 1 reply; 13+ messages in thread
From: Sweth Chandramouli @ 2001-10-03  4:12 UTC (permalink / raw)
  To: ZSH Users

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

On Wed, Oct 03, 2001 at 04:04:49AM +0000, Bart Schaefer wrote:
> Glob completion shouldn't have anything to do with it.
	??? Why not, given that that's what I'm having problems
with?

> So you're going to have to give us some more clues.
	I don't suppose you could give me any clues as to where
I should look for more clues?  :)

	-- Sweth.

-- 
Sweth Chandramouli ; <svc@sweth.net>
President, Idiopathic Systems Consulting

[-- Attachment #2: Type: application/pgp-signature, Size: 236 bytes --]

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

* Re: compctl -g not working
  2001-10-03  4:12       ` Sweth Chandramouli
@ 2001-10-03  6:04         ` Bart Schaefer
  2001-10-03  6:15           ` Sweth Chandramouli
  0 siblings, 1 reply; 13+ messages in thread
From: Bart Schaefer @ 2001-10-03  6:04 UTC (permalink / raw)
  To: Sweth Chandramouli; +Cc: zsh-users

On Oct 3, 12:12am, Sweth Chandramouli wrote:
} 
} On Wed, Oct 03, 2001 at 04:04:49AM +0000, Bart Schaefer wrote:
} > Glob completion shouldn't have anything to do with it.
} 	??? Why not, given that that's what I'm having problems
} with?

Because `compctl -g' forces a glob to happen.  Glob completion (as in the
glob_complete option) only determines how completion proceeds when there
is a partial match.

} > So you're going to have to give us some more clues.
} 	I don't suppose you could give me any clues as to where
} I should look for more clues?  :)

Well, for one thing, you ought to try running a newer version than
3.1.9.

But what I meant was, for example, tell us what your setopts actually
are rather than ask us what they might not be, tell us in which version
of zsh these same compctls last worked if they ever did, what happens
if you run `zsh -f' and then add the suspicious compctls one at a time,
anything else that might have changed recently (are you using both the
compctl and the new systems?) etc.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

* Re: compctl -g not working
  2001-10-03  6:04         ` Bart Schaefer
@ 2001-10-03  6:15           ` Sweth Chandramouli
  2001-10-03 16:24             ` Bart Schaefer
  0 siblings, 1 reply; 13+ messages in thread
From: Sweth Chandramouli @ 2001-10-03  6:15 UTC (permalink / raw)
  To: zsh-users

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

On Wed, Oct 03, 2001 at 06:04:41AM +0000, Bart Schaefer wrote:
> On Oct 3, 12:12am, Sweth Chandramouli wrote:
> } 
> } On Wed, Oct 03, 2001 at 04:04:49AM +0000, Bart Schaefer wrote:
> } > Glob completion shouldn't have anything to do with it.
> } 	??? Why not, given that that's what I'm having problems
> } with?
> 
> Because `compctl -g' forces a glob to happen.  Glob completion (as in the
> glob_complete option) only determines how completion proceeds when there
> is a partial match.
	Ah.  I meant glob completion as in "compctl using
globs", rather than "completion using glob_complete", especially since
glob_complete doesn't actually use globbing (according to the man page).

> } > So you're going to have to give us some more clues.
> } 	I don't suppose you could give me any clues as to where
> } I should look for more clues?  :)
> 
> Well, for one thing, you ought to try running a newer version than
> 3.1.9.
	That wouldn't help me figure out what was broken,
however.  I'm stubborn enough to want to waste my time trying to
figure out what changed, rather than just changing other things until
it works.  Upgrading to 4.x is on my todo list, however.

> But what I meant was, for example, tell us what your setopts actually
> are rather than ask us what they might not be,
	OK; I was trying to not waste space with the full list if
others could give me tips as to where to focus my search.  Here's the
full list:
(astaroth)~: allopt
allexport             off
alwayslastprompt      on
alwaystoend           off
appendhistory         on
autocd                off
autolist              on
automenu              on
autonamedirs          off
autoparamkeys         off
autoparamslash        on
autopushd             on
autoremoveslash       on
autoresume            off
badpattern            on
banghist              on
bareglobqual          on
bashautolist          off
beep                  off
bgnice                on
braceccl              on
bsdecho               off
cdablevars            off
chasedots             off
chaselinks            off
checkjobs             on
clobber               off
completealiases       on
completeinword        on
correct               on
correctall            off
cshjunkiehistory      on
cshjunkieloops        off
cshjunkiequotes       off
cshnullcmd            off
cshnullglob           off
dvorak                off
equals                on
errexit               off
exec                  on
extendedglob          on
extendedhistory       on
flowcontrol           off
functionargzero       off
glob                  on
globalexport          on
globalrcs             on
globassign            off
globcomplete          off
globdots              on
globsubst             on
hashcmds              on
hashdirs              on
hashlistall           off
histallowclobber      off
histbeep              off
histexpiredupsfirst   on
histfindnodups        off
histignorealldups     on
histignoredups        on
histignorespace       off
histnofunctions       off
histnostore           on
histreduceblanks      on
histsavenodups        on
histverify            off
hup                   on
ignorebraces          off
ignoreeof             off
incappendhistory      on
interactive           on
interactivecomments   on
ksharrays             off
kshautoload           off
kshglob               on
kshoptionprint        on
listambiguous         on
listbeep              on
listpacked            off
listrowsfirst         off
listtypes             on
localoptions          on
localtraps            off
login                 off
longlistjobs          on
magicequalsubst       off
mailwarning           off
markdirs              on
menucomplete          off
monitor               off
multios               on
nomatch               on
notify                on
nullglob              off
numericglobsort       off
octalzeroes           off
overstrike            off
pathdirs              off
posixbuiltins         on
printeightbit         on
printexitvalue        off
privileged            off
promptbang            on
promptcr              on
promptpercent         on
promptsubst           on
pushdignoredups       off
pushdminus            off
pushdsilent           off
pushdtohome           on
rcexpandparam         on
rcquotes              off
rcs                   on
recexact              on
restricted            off
rmstarsilent          off
rmstarwait            off
sharehistory          on
shfileexpansion       off
shglob                on
shinstdin             on
shnullcmd             off
shoptionletters       off
shortloops            on
shwordsplit           off
singlecommand         off
singlelinezle         off
sunkeyboardhack       off
unset                 on
verbose               off
xtrace                off
zle                   off

> tell us in which version
> of zsh these same compctls last worked if they ever did, 
	3.1.9; I've been using it for at least a year, and at some
point the completion worked.  I made some changes many months ago,
but hadn't used any of the commands whose compctls used -g in at least
the last six months.

> what happens
> if you run `zsh -f' and then add the suspicious compctls one at a time,
	They work fine under zsh -f; sorry for not mentioning that
in my original post.

	-- Sweth.

-- 
Sweth Chandramouli ; <svc@sweth.net>
President, Idiopathic Systems Consulting

[-- Attachment #2: Type: application/pgp-signature, Size: 236 bytes --]

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

* Re: compctl -g not working
  2001-10-03  6:15           ` Sweth Chandramouli
@ 2001-10-03 16:24             ` Bart Schaefer
  2001-10-03 18:23               ` Sweth Chandramouli
  0 siblings, 1 reply; 13+ messages in thread
From: Bart Schaefer @ 2001-10-03 16:24 UTC (permalink / raw)
  To: Sweth Chandramouli, zsh-users

On Oct 3,  2:15am, Sweth Chandramouli wrote:
}
} 	That wouldn't help me figure out what was broken,
} however.  I'm stubborn enough to want to waste my time trying to
} figure out what changed, rather than just changing other things until
} it works.
} 
} kshglob               on

That's it right there.  `*(stuff)' means something different with kshglob.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

* Re: compctl -g not working
  2001-10-03 16:24             ` Bart Schaefer
@ 2001-10-03 18:23               ` Sweth Chandramouli
  2001-10-04  4:23                 ` Bart Schaefer
  0 siblings, 1 reply; 13+ messages in thread
From: Sweth Chandramouli @ 2001-10-03 18:23 UTC (permalink / raw)
  To: zsh-users

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

On Wed, Oct 03, 2001 at 04:24:22PM +0000, Bart Schaefer wrote:
> On Oct 3,  2:15am, Sweth Chandramouli wrote:
> } kshglob               on
> 
> That's it right there.  `*(stuff)' means something different with kshglob.
	True, and I hadn't thought of that; now I'm even more
confused, however, because the exact same syntax works fine from the
command-line in an explicit glob:

$ echo RCS/*(:t:s/\,v//)
logwatchd m2s

	.  Unsetting kshglob doesn't change the behaviour, either.
So now, in addition to my original question, I'm also wondering why
I've been able to use the *(:qualifiers) syntax for so long given that
I've had kshglob set.

	-- Sweth, increasingly perplexed.

-- 
Sweth Chandramouli ; <svc@sweth.net>
President, Idiopathic Systems Consulting

[-- Attachment #2: Type: application/pgp-signature, Size: 236 bytes --]

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

* Re: compctl -g not working
  2001-10-03 18:23               ` Sweth Chandramouli
@ 2001-10-04  4:23                 ` Bart Schaefer
  2001-10-04  4:43                   ` Sweth Chandramouli
  0 siblings, 1 reply; 13+ messages in thread
From: Bart Schaefer @ 2001-10-04  4:23 UTC (permalink / raw)
  To: Sweth Chandramouli, zsh-users

On Oct 3,  2:23pm, Sweth Chandramouli wrote:
} Subject: Re: compctl -g not working
}
} 
} On Wed, Oct 03, 2001 at 04:24:22PM +0000, Bart Schaefer wrote:
} > On Oct 3,  2:15am, Sweth Chandramouli wrote:
} > } kshglob               on
} > 
} > That's it right there.  `*(stuff)' means something different with kshglob.
} 
} 	.  Unsetting kshglob doesn't change the behaviour, either.

I apologize; it's not kshglob that's the problem, it's shglob.

SH_GLOB <K> <S>
     Disables the special meaning of `(', `|', `)' and '<' for globbing
     the result of parameter and command substitutions, and in some
     other places where the shell accepts patterns.  This option is
     set by default if zsh is invoked as sh or ksh.

One of the "some other places" is in compctl expressions.

} So now, in addition to my original question, I'm also wondering why
} I've been able to use the *(:qualifiers) syntax for so long given that
} I've had kshglob set.

Because you also have bare_glob_qual set, which I missed.  That takes
precedence over kshglob, so that *(stuff) at the -end- of a pattern is
still treated as a * followed by qualifiers.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

* Re: compctl -g not working
  2001-10-04  4:23                 ` Bart Schaefer
@ 2001-10-04  4:43                   ` Sweth Chandramouli
  2001-10-05 16:13                     ` Bart Schaefer
  0 siblings, 1 reply; 13+ messages in thread
From: Sweth Chandramouli @ 2001-10-04  4:43 UTC (permalink / raw)
  To: zsh-users

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

On Thu, Oct 04, 2001 at 04:23:05AM +0000, Bart Schaefer wrote:
> I apologize; it's not kshglob that's the problem, it's shglob.
> 
> SH_GLOB <K> <S>
>      Disables the special meaning of `(', `|', `)' and '<' for globbing
>      the result of parameter and command substitutions, and in some
>      other places where the shell accepts patterns.  This option is
>      set by default if zsh is invoked as sh or ksh.
> 
> One of the "some other places" is in compctl expressions.
	Aha!  That's it; I now remember that, some months ago, I
ran into a problem where the result of a command substitution was
getting globbed inappropriately (or at least in a way that I found very
non-intuitive), so I turned on SH_GLOB.  Since I still prefer that
behaviour, and compctl can use -s to acheive the same result, I'll
just switch to -s instead.  (What are the odds of the manpage getting
updated to note that "some other places" includes compctl -g, but not
compctl -s, and the fact that BARE_GLOB_QUAL overrides KSH_GLOB?)

	-- Sweth.

-- 
Sweth Chandramouli ; <svc@sweth.net>
President, Idiopathic Systems Consulting

[-- Attachment #2: Type: application/pgp-signature, Size: 236 bytes --]

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

* Re: compctl -g not working
  2001-10-04  4:43                   ` Sweth Chandramouli
@ 2001-10-05 16:13                     ` Bart Schaefer
  2001-10-05 16:23                       ` Zefram
  0 siblings, 1 reply; 13+ messages in thread
From: Bart Schaefer @ 2001-10-05 16:13 UTC (permalink / raw)
  To: zsh-users

On Oct 4, 12:43am, Sweth Chandramouli wrote:
}
} > SH_GLOB <K> <S>
} >      Disables the special meaning of `(', `|', `)' and '<' for globbing
} >      the result of parameter and command substitutions, and in some
} >      other places where the shell accepts patterns.  This option is
} >      set by default if zsh is invoked as sh or ksh.
} > 
} > One of the "some other places" is in compctl expressions.
}
} (What are the odds of the manpage getting updated to note that "some
} other places" includes compctl -g, but not compctl -s, and the fact
} that BARE_GLOB_QUAL overrides KSH_GLOB?)

I don't think it'd be appropriate to mention compctl specifically in the
doc for SH_GLOB, but see below.

BARE_GLOB_QUAL overrides everything else having to do with paren tokens
when they appear at the end of words -- it actually works by parsing the
pattern "backwards" when the final character is a close-paren token --
and is (sometimes) defeated by SH_GLOB only because that prevents the
parens from ever being tokenized in the first place.

Which is how we get into the "some other places" situation.  The lexer
knows whether or not it is in parameter or command substitution and so
does not apply SH_GLOB to "ordinary" glob patterns.  However, strings
that are originally parsed as quoted and then later converted into a
glob pattern are (usually) not passed through the lexer again -- they
go through a different tokenizer that always applies SH_GLOB.

The reason that "some other places" does not include `compctl -s' is
because -s actually *does* pass the string through the lexer again,
whereas -g passes it only through the tokenizer.

So the questions (hey, zsh-workers) are:

Should we fix `compctl -g' so that it behaves like "ordinary" globbing?
(I have a suggested implementation that I won't go into here.)

Should we make BARE_GLOB_QUAL a bit smarter so that it knows about
KSH_GLOB and looks back one more character to see if what precedes the
open-paren token is one of the ksh-glob-chars?  (It already treats a
`|' inside the parens as indicative of a glob alternation rather than
a list of qualifiers.)

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

* Re: compctl -g not working
  2001-10-05 16:13                     ` Bart Schaefer
@ 2001-10-05 16:23                       ` Zefram
  0 siblings, 0 replies; 13+ messages in thread
From: Zefram @ 2001-10-05 16:23 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-users

Bart Schaefer wrote:
>Should we make BARE_GLOB_QUAL a bit smarter so that it knows about
>KSH_GLOB and looks back one more character to see if what precedes the
>open-paren token is one of the ksh-glob-chars?

Is "*(.)" a pattern "*" followed by glob qualifiers, or a ksh-style
pattern?  With the current system it's easy to predict when part
of a pattern will be interpreted as glob qualifiers, so you know to
disambiguate it if you didn't intend it to be taken as qualifiers.
With your proposed change, you'd have to think about the opposite
ambiguity too -- a set of glob qualifiers might be interpreted as part of
a pattern, and you'd sometimes need extra effort to force interpretation
as glob qualifiers.  I recommend sticking with the current, simpler, rule.

This is why we made the BARE_GLOB_QUAL option -- we wanted an unambiguous
syntax for glob qualifiers, that wouldn't get in the way of globbing
syntax at all.  Unfortunately no one's yet come up with a really good
suggestion.

-zefram


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

end of thread, other threads:[~2001-10-05 16:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-03  2:53 compctl -g not working Sweth Chandramouli
2001-10-03  3:16 ` Philippe Troin
2001-10-03  3:18   ` Sweth Chandramouli
2001-10-03  4:04     ` Bart Schaefer
2001-10-03  4:12       ` Sweth Chandramouli
2001-10-03  6:04         ` Bart Schaefer
2001-10-03  6:15           ` Sweth Chandramouli
2001-10-03 16:24             ` Bart Schaefer
2001-10-03 18:23               ` Sweth Chandramouli
2001-10-04  4:23                 ` Bart Schaefer
2001-10-04  4:43                   ` Sweth Chandramouli
2001-10-05 16:13                     ` Bart Schaefer
2001-10-05 16:23                       ` Zefram

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