Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Filename expansion within a completion widget
- X-seq: zsh-users 8149
- From: DervishD <zsh@xxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxxxxx>
- Subject: Filename expansion within a completion widget
- Date: Wed, 3 Nov 2004 00:36:59 +0100
- Mail-followup-to: Zsh Users <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: DervishD
Hi all :)
Let's say I run the following script:
---
#!/bin/zsh
zle -C expand-or-complete expand-or-complete _completer
function _completer () {
emulate -L zsh
setopt extendedglob globdots globassign null_glob
compstate[insert]=${compstate[insert]//tab /}
compset -P '*/'
BASEDIR=""
[[ $IPREFIX[1] != "/" ]] && BASEDIR="$PWD/"
compadd -W $BASEDIR$IPREFIX -f - ${IPREFIX}*(:t)
return 0
}
---
Well, it handles both relative and absolute directories
correctly, but doesn't handle named directories :(( I don't
understand why because if I type 'cd ~X<TAB>' the named dir should be
expanded, shouldn't it?
If it shouldn't, could anyone hint me how to do it? Should I
bother with any other similar problems (I mean, like mangling IPREFIX
for absolute directories and the like)?
Thanks a lot, as always :)
Raúl Núñez de Arenas Coronado
--
Linux Registered User 88736
http://www.dervishd.net & http://www.pleyades.net/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author