zsh-users
 help / color / mirror / code / Atom feed
* Compctl completion tweaking
@ 1998-06-23 14:57 Johan Sundström
  1998-06-23 19:38 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Johan Sundström @ 1998-06-23 14:57 UTC (permalink / raw)
  To: zsh mailinglist

I've been trying for some time to limit completion behaviour for some
commands in an intelligent manner. What I am trying to do is mask out
files not matching a given pattern, keeping directories intact, or,
better still, matching files according to some pattern and directories
according to some other pattern. Shouldn't that be possible using
something like -g '(*.rpm(.))|(*(-/))'? I tried for a while with some
print -m magic, but didn't quite manage to get it to work.

(Sure, -g '*.rmp(.)' + -g '*(-/)' does a fair job, but I find it
irritating that I cant tab my way down into a subdirectory of a
directory containing *.rpm files this way.)

Secondly, is there any way I can influence the sorting compctl does? I'd
be very happy if some commands' completion list would be sorted
files-first, others' directories-first, and yet others mixed-alpha-sort
(the only method I am aware of being possible). I thought this behaviour
could be mimiced crudely using -K functions, but it seems the function's
output is being sorted. It sure took me a while realizing that... :\

/Johan Sundström


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

* Re: Compctl completion tweaking
  1998-06-23 14:57 Compctl completion tweaking Johan Sundström
@ 1998-06-23 19:38 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 1998-06-23 19:38 UTC (permalink / raw)
  To: johan_sundstrom, zsh mailinglist

On Jun 23,  4:57pm, Johan Sundström wrote:
} Subject: Compctl completion tweaking
}
} I've been trying for some time to limit completion behaviour for some
} commands in an intelligent manner. What I am trying to do is mask out
} files not matching a given pattern, keeping directories intact

In 3.1.4, what you'd want (I think) is

	compctl -g '*.rpm(.)' -/ rpm

The -/ flag is new and means "filesystem paths".  You may not even need
the (.) in the -g pattern, unless you have some files with .rpm extensions
that aren't plain files.

} better still, matching files according to some pattern and directories
} according to some other pattern. Shouldn't that be possible using
} something like -g '(*.rpm(.))|(*(-/))'?

Unfortunately, qualifiers can only be appended at the end of an entire
glob.  If you parenthesize them in an alternation like that, they're
taken as part of the pattern rather than as qualifiers.

} Secondly, is there any way I can influence the sorting compctl does?

Not at present.

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


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

end of thread, other threads:[~1998-06-23 20:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-06-23 14:57 Compctl completion tweaking Johan Sundström
1998-06-23 19:38 ` 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).