zsh-users
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Zsh users <zsh-users@sunsite.auc.dk>
Subject: Re: Completion in the first character position
Date: Tue, 25 Jul 2000 15:39:22 +0000	[thread overview]
Message-ID: <1000725153922.ZM20015@candle.brasslantern.com> (raw)
In-Reply-To: <200007251314.OAA90882@cm01.ess>
In-Reply-To: <200007251339.PAA08266@beta.informatik.hu-berlin.de>

On Jul 25,  2:14pm, Oliver Kiddle wrote:
} Subject: Completion in the first character position
}
} I am writing a shell script where I'm prompting the user to enter
} various information. I'm using vared to read what is entered into a
} variable after using compctl -C to setup completions (and a setopt
} autolist). I could have used the new style completions but it is a
} fairly simple case and I use 3.0.8 where the script will run.

I have a similar script and a similar situation, but I used

  compctl -Tx 'p[1,-1]' -f - 'W[0,*]' -k l ${${ZSH_VERSION##3.0*}:+-tn}

where `l' holds the list of words to be completed.  Hmm, I guess I'm
also using a `select' loop to read what is entered, as ZLE is enabled
at the PS3 prompt.

} The problem is that when I press tab to complete in the first character
} position, a tab is inserted and the completions are not listed.

Even sillier is that ^D in this same position _does_ produce a list,
rather than exiting from `select'.  That doesn't appear to be the case
any longer with the new completion system.

I suppose that might even be worthy of a patch for 3.0.8 ...

} Is there an option or something to turn this off? I've looked through
} the manual but can't see one. As a feature, it is probably less useful
} with the new completion system because the same can be achieved with a
} style anyway.

On Jul 25,  3:39pm, Sven Wischnowsky replied:
} Subject: Re: Completion in the first character position
}
} Yes, since this is possible in the new completion system (even the
} default there, inside vared), I guess we won't add an option for it.

My aforementioned script does

    local curcontext=${0}:::
    zstyle ":completion:${0}:*" completer _null
    zstyle ":completion:${0}:*" insert-tab no
    _null() { compcall -T -D }

to bypass new completion after the compctl -Tx has been installed and
stop tabs being inserted at the beginnings of lines.

Which reminds me:  `zed' should do something similar.  As should vared
when editing an element of the functions assoc -- is there a way to be
that specific about the vared context?

}   bindkey -s '\t' '\ec'  # or something better than \ec
}   bindkey '\ec' complete-word

Cute.

} And now you wish for vared-local keymaps, of course ;-)

The trick used by zed to set and restore bindings should be sufficient.

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

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


      reply	other threads:[~2000-07-25 15:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-25 13:14 Oliver Kiddle
2000-07-25 13:39 ` Sven Wischnowsky
2000-07-25 15:39   ` Bart Schaefer [this message]

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=1000725153922.ZM20015@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=zsh-users@sunsite.auc.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).