From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: John Buttery <john@io.com>
Cc: zsh-users@sunsite.dk
Subject: Re: Interesting tidbit about bash completion
Date: Fri, 28 Feb 2003 12:09:35 +0100 [thread overview]
Message-ID: <25499.1046430575@finches.logica.co.uk> (raw)
In-Reply-To: <20030228095300.GA19785@io.com>
On 28 Feb, you wrote:
>
>
> Just saw this in the "bash programmable completion" freshmeat projects
> update:
>
> # bash completion is now compatible with the new bash completion
> # emulation feature of zsh.
>
> What does this mean (if anything) to us?
The change is little more than changing a few ugly bashisms like:
if [ ${BASH_VERSINFO[1]} '>' 04 ]; then
to:
if [[ ${BASH_VERSINFO[1]} > 04 ]]; then
I sent them a patch to do that to save me the hassle of having to modify
/etc/bash_completion before sourcing it from zsh.
If anyone is interested, I use this function to source it:
bash_source() {
alias shopt=':'
alias _expand=_bash_expand
alias _complete=_bash_comp
emulate -L sh
setopt kshglob noshglob braceexpand
source "$@"
}
This is only useful for testing bashcompinit because it will override
lots of zsh completions. You could alias around all zsh functions with:
for f in ${(kM)functions:#_*}; alias $f=_bash_$f
and then use:
alias compdef='compdef -n'
when running bashcompinit (so don't use the -U option to autoload)
I could perhaps put _bash_source in bashcompinit and add a -n option so
that it uses compdef -n.
Oliver
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
prev parent reply other threads:[~2003-02-28 11:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-28 9:53 John Buttery
2003-02-28 11:09 ` Oliver Kiddle [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=25499.1046430575@finches.logica.co.uk \
--to=okiddle@yahoo.co.uk \
--cc=john@io.com \
--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).