From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19564 invoked from network); 26 Jan 2009 03:30:34 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 26 Jan 2009 03:30:34 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 90142 invoked from network); 26 Jan 2009 03:30:29 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 26 Jan 2009 03:30:29 -0000 Received: (qmail 3060 invoked by alias); 26 Jan 2009 03:30:22 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26441 Received: (qmail 3041 invoked from network); 26 Jan 2009 03:30:22 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 26 Jan 2009 03:30:22 -0000 Received: from mail-ew0-f20.google.com (mail-ew0-f20.google.com [209.85.219.20]) by bifrost.dotsrc.org (Postfix) with ESMTP id 7A10F80271F0 for ; Mon, 26 Jan 2009 04:30:05 +0100 (CET) Received: by ewy13 with SMTP id 13so174453ewy.21 for ; Sun, 25 Jan 2009 19:30:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:references:in-reply-to:mime-version:message-id :content-type:content-transfer-encoding; bh=Qo/4jSyrabhwumF88lc1BtYD8PDcQD2ZBwRWuDnZODk=; b=KXwz3bEfMyF/5YdP4wnNgJ/nMtCG5YQUt7uo/x5Ee0cz0QDWB0w5FIZsBsN5QxzrEb olBG81LYG0UHHUQxTFJxU9KVf2vb39sVqkJzXoHZ+dWy4XG+Qi3lkpQdJCX8ea7nVFap J+MMwDugOHPIIT/5CIcqlwj98gwWkwz9NO2ow= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:references:in-reply-to:mime-version :message-id:content-type:content-transfer-encoding; b=TEvRb5Q1VM72aBLVz2FVmOhCfLW03JsnucAZ2KENT7gX2aUynjvg0UGpYBTZgn6ALw UCzFUhCUhMWkrQnF9zFUzXXBvlaa1TZYKtkGJ1YqfRq5Lxp94vTP9n59JDXZ64cRfm+P dwwPXdXkAmUYDlQYz59zEnBOMagvqKuoGCJTs= Received: by 10.210.66.1 with SMTP id o1mr11596035eba.0.1232940605503; Sun, 25 Jan 2009 19:30:05 -0800 (PST) Received: from cooker.localnet (ppp91-77-236-53.pppoe.mtu-net.ru [91.77.236.53]) by mx.google.com with ESMTPS id 23sm2176870eya.23.2009.01.25.19.30.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 25 Jan 2009 19:30:04 -0800 (PST) From: Andrey Borzenkov To: zsh-workers@sunsite.dk Subject: Re: [PATCH] modprobe: Complete loaded modules if nothing was found Date: Mon, 26 Jan 2009 06:29:58 +0300 User-Agent: KMail/1.11.0 (Linux/2.6.29-rc2-1avb; KDE/4.1.96; i686; ; ) References: <1232916306-3355-1-git-send-email-joerg@alea.gnuu.de> In-Reply-To: <1232916306-3355-1-git-send-email-joerg@alea.gnuu.de> MIME-Version: 1.0 Message-Id: <200901260629.59897.arvidjaar@gmail.com> Content-Type: multipart/signed; boundary="nextPart3843226.jRKU9a7rfR"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.92.1/8901/Sun Jan 25 11:10:36 2009 on bifrost X-Virus-Status: Clean --nextPart3843226.jRKU9a7rfR Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 25 =D1=8F=D0=BD=D0=B2=D0=B0=D1=80=D1=8F 2009 23:45:06 J=C3=B6rg Sommer w= rote: > In some cases it is useful when Zsh does complete the module names > while they aren't loadable. A module can't be loaded twice, so Zsh > doesn't suggest modules they are already loaded. But for commands > like this it is helpful: > > % rmmod snd_seq_device; modprobe snd_seq_device I am afraid this is close to "let's make shell read my mind". This=20 is very exotic case and (personally) I prefer to press ENTER after rmmod=20 =2D simply because rmmod may fail and I want to know it. I'd rather see modules completion synced with current module-init-tools=20 :) One obviously missing feature is completing modules from kernel=20 different from currently running (modinfo -k)=20 > --- > Completion/Linux/Command/_modutils | 9 ++++++++- > 1 files changed, 8 insertions(+), 1 deletions(-) > > diff --git a/Completion/Linux/Command/_modutils > b/Completion/Linux/Command/_modutils index eefb11f..40399ab 100644 > --- a/Completion/Linux/Command/_modutils > +++ b/Completion/Linux/Command/_modutils > @@ -87,7 +87,14 @@ case "$state" in > _tags files modules > while _tags; do > _requested files expl "module file" _files -g '*.ko' && ret=3D0 > - _requested modules expl module compadd -a modules && ret=3D0 > + if _requested modules expl module; then > + if compadd -a modules; then > + ret=3D0 > + else > + [[ $state =3D loadable_modules ]] && \ > + compadd -a loaded_modules && ret=3D0 > + fi > + fi > done > ;; --nextPart3843226.jRKU9a7rfR Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEABECAAYFAkl9LjcACgkQR6LMutpd94z7vQCZASHXbsBfcLrsyCMxdPDfBFK8 bLQAoNLk7VVHxZ9r97a6GCxcePDIUY9W =0CTH -----END PGP SIGNATURE----- --nextPart3843226.jRKU9a7rfR--