zsh-users
 help / color / mirror / code / Atom feed
* compdef weirdness with function
@ 2006-02-11 19:57 Ian Langworth
  2006-02-11 20:45 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Langworth @ 2006-02-11 19:57 UTC (permalink / raw)
  To: zsh-users

If I add a completion definition for some arbitrary, undefined symbol,

   % compdef _perl_modules foo

The completion works normally:

   % foo Acme::<Tab>
   Acme::Bleach        Acme::Magpie        Acme::Morse
   Acme::DWIM          Acme::Magpie::l33t

However, if I then define foo:

  % foo () { echo "args are: $*" }

The completion stops working, even if I re-execute the compdef command
above. What am I doing wrong?

--
Ian Langworth


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

* Re: compdef weirdness with function
  2006-02-11 19:57 compdef weirdness with function Ian Langworth
@ 2006-02-11 20:45 ` Bart Schaefer
  2006-02-15  0:09   ` Ian Langworth
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2006-02-11 20:45 UTC (permalink / raw)
  To: zsh-users

On Feb 11,  2:57pm, Ian Langworth wrote:
}
} If I add a completion definition for some arbitrary, undefined symbol,
} 
}    % compdef _perl_modules foo

The problem is with _perl_modules.  It expects all commands for which it
complete to be synonyms for perl; it's attempting to run

	foo -e 'print @INC'

to find the include-path for the modules to complete.  When foo does not
exist it falls back to

	perl -e 'print @INC'

but when foo does exist and does not behave like perl, it simply fails.


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

* Re: compdef weirdness with function
  2006-02-11 20:45 ` Bart Schaefer
@ 2006-02-15  0:09   ` Ian Langworth
  0 siblings, 0 replies; 3+ messages in thread
From: Ian Langworth @ 2006-02-15  0:09 UTC (permalink / raw)
  To: zsh-users

On 2/11/06, Bart Schaefer <schaefer@brasslantern.com> wrote:

> On Feb 11,  2:57pm, Ian Langworth wrote:
> }
> } If I add a completion definition for some arbitrary, undefined symbol,
> }
> }    % compdef _perl_modules foo
>
> The problem is with _perl_modules.  It expects all commands for which it
> complete to be synonyms for perl; it's attempting to run
>
>         foo -e 'print @INC'

Weird and gross. Thanks :)

I've added an if [ "$1" = "-e" ] to my function as a workaround.

--
Ian Langworth


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

end of thread, other threads:[~2006-02-15  0:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-11 19:57 compdef weirdness with function Ian Langworth
2006-02-11 20:45 ` Bart Schaefer
2006-02-15  0:09   ` Ian Langworth

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