From: DervishD <zsh@dervishd.net>
To: Zsh Users <zsh-users@sunsite.dk>
Subject: Filename expansion within a completion widget
Date: Wed, 3 Nov 2004 00:36:59 +0100 [thread overview]
Message-ID: <20041102233658.GA21654@DervishD> (raw)
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/
next reply other threads:[~2004-11-02 23:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-02 23:36 DervishD [this message]
2004-11-02 23:44 ` DervishD
2004-11-04 2:19 ` Bart Schaefer
2004-11-04 10:33 ` DervishD
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20041102233658.GA21654@DervishD \
--to=zsh@dervishd.net \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).