zsh-users
 help / color / mirror / code / Atom feed
* Perl completion
@ 2003-05-09 14:02 Dominic Mitchell
  2003-05-09 14:12 ` Dominic Mitchell
  0 siblings, 1 reply; 4+ messages in thread
From: Dominic Mitchell @ 2003-05-09 14:02 UTC (permalink / raw)
  To: zsh-users

I've just noticed in _perl that it only completes *.p[ml].  Is there a
way that I can change this using zstyle somehow?  I would like to also
complete '*.t' files too (perl tests).

I've had a look at the docs, but I'm still not entirely clear on how
things hang together, I'm afraid...

Thanks,
-Dom


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

* Re: Perl completion
  2003-05-09 14:02 Perl completion Dominic Mitchell
@ 2003-05-09 14:12 ` Dominic Mitchell
  2003-05-09 15:36   ` Paul Johnson
  0 siblings, 1 reply; 4+ messages in thread
From: Dominic Mitchell @ 2003-05-09 14:12 UTC (permalink / raw)
  To: zsh-users

On Fri, May 09, 2003 at 03:02:06PM +0100, Dominic Mitchell wrote:
> I've just noticed in _perl that it only completes *.p[ml].  Is there a
> way that I can change this using zstyle somehow?  I would like to also
> complete '*.t' files too (perl tests).
> 
> I've had a look at the docs, but I'm still not entirely clear on how
> things hang together, I'm afraid...

Doh.  It's always after you send the mail you find the answer...

zstyle ':completion:*:complete:perl:*' file-patterns \
    '*.(p[ml]|t):perl-files' '%p:all-files'

My apologies,
-Dom


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

* Re: Perl completion
  2003-05-09 14:12 ` Dominic Mitchell
@ 2003-05-09 15:36   ` Paul Johnson
  2003-05-11 18:35     ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Johnson @ 2003-05-09 15:36 UTC (permalink / raw)
  To: dom; +Cc: zsh-users


dom@happygiraffe.net said:

> On Fri, May 09, 2003 at 03:02:06PM +0100, Dominic Mitchell wrote:
>> I've just noticed in _perl that it only completes *.p[ml].

Which is actually wrong, I think.

.pm files are Perl modules and shouldn't be directly executed, although
that would be valid after -c to check the syntax.

.pl files are officially Perl libraries, and again they shouldn't be
directly executed.  Many people do use .pl as an extension for Perl
programs, though if an extension is required, .plx is recommended.

Many people don't use an extension at all.  Some standard Perl programs
have other extensions such as .t (tests) or .PL (often used in build
processes).

It seems to me that it would be better not to pay any heed to the extension.

-- 
Paul Johnson - paul@pjcj.net
http://www.pjcj.net


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

* Re: Perl completion
  2003-05-09 15:36   ` Paul Johnson
@ 2003-05-11 18:35     ` Bart Schaefer
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2003-05-11 18:35 UTC (permalink / raw)
  To: zsh-users

On May 9,  5:36pm, Paul Johnson wrote:
} 
} >> I've just noticed in _perl that it only completes *.p[ml].
} 
} Which is actually wrong, I think.

It's not precisely wrong, it's just that _perl isn't as clever as it
could be.  It doesn't use the state-machine mechanism for _arguments,
so it doesn't complete differently when -c is [not] among the flags.
It's easier to skip the .pm files when they appear in the completion
listing when they aren't useful, than to know they're available if they
don't appear when you want them.

} It seems to me that it would be better not to pay any heed to the
} extension.

I can't agree with that.  `perl foo<TAB>' should not complete `foo.c' or
`foo.sh' etc.  On the other hand it probably should recognize names with
no extension, such as `foobar'.


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

end of thread, other threads:[~2003-05-11 18:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-09 14:02 Perl completion Dominic Mitchell
2003-05-09 14:12 ` Dominic Mitchell
2003-05-09 15:36   ` Paul Johnson
2003-05-11 18:35     ` 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).