zsh-users
 help / color / mirror / code / Atom feed
* what zshcompsys-syntax is equals compctl -C -f ?
@ 2005-11-04  9:34 Eike Kroemer
  2005-11-04 10:21 ` DervishD
  2005-11-04 10:33 ` Peter Stephenson
  0 siblings, 2 replies; 3+ messages in thread
From: Eike Kroemer @ 2005-11-04  9:34 UTC (permalink / raw)
  To: zsh-users

Hi there,

just recently I had to upgrade from zsh 4.0.6 to zsh 4.2.1 and now I'm
unable to reproduce the filename-completion behaviour I'm used to.

My old .zshrc had the lines

-------------------------------->
#### options for zsh-behaviour
setopt always_to_end
setopt auto_list
unsetopt automenu
setopt auto_param_slash
setopt bsd_echo
setopt csh_null_glob
setopt extended_glob
unsetopt menu_complete
unsetopt rec_exact
setopt no_nomatch
setopt rmstarsilent
setopt sh_file_expansion
setopt nocorrect
setopt nocorrect_all
unsetopt auto_remove_slash
# expand only to filenames
compctl -C -f
--------------------------------<

and I used "compctl -C -f" to avoid path-lookup in completion.
For example assume my $PWD has a subdirectory "bin/" and I want to call
"Script" located in this dir.

As long as compctl -C -f worked I could enter "bi<tab>" and zsh would
expand to bin/, the only file or directory starting with "bi" present in
$PWD.

But now that compctl is deprecated I'm unable to configure the new-style
behaviour of zshcompsys to reproduce the desired result.
Default-behaviour is to include all executables in $PATH beginning with
"bi", sadly yielding

kroemer@pcma44:~ > bi<tab>
bibtex       bindkey      bioradtopgm  bitmap
bin/         binhex       bison

which is of no use to me :-(
Can anyone help?

Thanks in advance....
   Eike


-- 
           "...but plagiarize, plagiarize, plagiarize,
         only be sure to always call it please -- research"
                     (Tom Lehrer: Lobachevsky)


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

* Re: what zshcompsys-syntax is equals compctl -C -f ?
  2005-11-04  9:34 what zshcompsys-syntax is equals compctl -C -f ? Eike Kroemer
@ 2005-11-04 10:21 ` DervishD
  2005-11-04 10:33 ` Peter Stephenson
  1 sibling, 0 replies; 3+ messages in thread
From: DervishD @ 2005-11-04 10:21 UTC (permalink / raw)
  To: Eike Kroemer; +Cc: zsh-users

    Hi Eike :)

 * Eike Kroemer <kroemer@atlas.de> dixit:
> But now that compctl is deprecated I'm unable to configure the new-style
> behaviour of zshcompsys to reproduce the desired result.

    compctl may be deprecated, but for simple uses like yours (or
mine) is IMHO much better suited than the compsys thing. Stick to it
until compctl is removed (which I hope never happens)...

    Writing the simple completions I've set up with compctl using
compsys would be a nightmare for me. With compsys I feel like using a
hammer to crack nuts: not only excessive, it also doesn't have the
desired effect... A personal opinion, of course, but...

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...


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

* Re: what zshcompsys-syntax is equals compctl -C -f ?
  2005-11-04  9:34 what zshcompsys-syntax is equals compctl -C -f ? Eike Kroemer
  2005-11-04 10:21 ` DervishD
@ 2005-11-04 10:33 ` Peter Stephenson
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 2005-11-04 10:33 UTC (permalink / raw)
  To: zsh-users

Eike Kroemer <kroemer@atlas.de> wrote:
> I used "compctl -C -f" to avoid path-lookup in completion.
> For example assume my $PWD has a subdirectory "bin/" and I want to call
> "Script" located in this dir.

So you want local directories (not using CDPATH), and any executable
files in them, right?

Try adding:

  _local_exes() {
    _files -g "*(*)"
  }
  compdef _local_exes -command-

after the point where "compinit" runs.  This makes command context
(which means basically what you think) run your function instead of the
default.  The function uses a glob qualifier to match all executable files.
The _files function automatically lets you search for the file in subdirectories
(in fact, I've discovered I'm a bit vague on how to stop it doing that,
but luckily you don't need to).

All sorts of variations are possible.  You should be able to get away with
putting a suitable function in your $fpath, but I couldn't get that to work
(it get being overridden however I organised my fpath and deleted the
dumped configuration), so just stick with the lines above or similar.

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


This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com


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

end of thread, other threads:[~2005-11-04 10:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-04  9:34 what zshcompsys-syntax is equals compctl -C -f ? Eike Kroemer
2005-11-04 10:21 ` DervishD
2005-11-04 10:33 ` Peter Stephenson

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