zsh-users
 help / color / mirror / code / Atom feed
* Filename expansion within a completion widget
@ 2004-11-02 23:36 DervishD
  2004-11-02 23:44 ` DervishD
  0 siblings, 1 reply; 4+ messages in thread
From: DervishD @ 2004-11-02 23:36 UTC (permalink / raw)
  To: Zsh Users

    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/


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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-02 23:36 Filename expansion within a completion widget DervishD
2004-11-02 23:44 ` DervishD
2004-11-04  2:19   ` Bart Schaefer
2004-11-04 10:33     ` DervishD

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