From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16352 invoked by alias); 4 Feb 2011 03:25:01 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28698 Received: (qmail 22964 invoked from network); 4 Feb 2011 03:24:58 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.214.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type:content-transfer-encoding; bh=OQlKX11azajBb+rU21iG2DCzelCKAZro9p2S6MQG8R8=; b=tlG9leNHauJVyieR3MG03F990ni2jziD0zk2U/d6HgL2GG7EMAqDH8p0/iBTayueO2 vvslO4ekBGmfexxPntpWT8q0rGe0kb/V0o2zB+IG8o3M8ZpKX5mSCnIAzmiYNNiz/vOK 8KnXt+4TGQaYjrACdDBVNtKvzqZkWmAEOT6Ro= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=LIvcGXOyBYKMQXQL0yhs8GrHh79GWr0892LlqymXnpErSY1zeMuUTiazapm7RjysF2 9sSJvHRmsZPv6XDDDkJd2i3CA3IGjy/ulhaaQFzNxD1anjJgJcXBpy3kApvFO9FPRJ05 sraf3TbeUSkG3JmDb7S/9V/TvOy+LV/2XkiUw= MIME-Version: 1.0 In-Reply-To: <110203065608.ZM21224@torch.brasslantern.com> References: <87oc74dpuy.fsf@ft.bewatermyfriend.org> <87d3njemu9.fsf@ft.bewatermyfriend.org> <110126090508.ZM2111@torch.brasslantern.com> <110126092944.ZM2205@torch.brasslantern.com> <110129211610.ZM21714@torch.brasslantern.com> <110129231514.ZM21967@torch.brasslantern.com> <110130160220.ZM15815@torch.brasslantern.com> <110203065608.ZM21224@torch.brasslantern.com> From: cheer_xiao Date: Fri, 4 Feb 2011 11:24:32 +0800 Message-ID: Subject: Re: Slow completion when using aptitude To: zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, Feb 3, 2011 at 10:56 PM, Bart Schaefer wrote: > On Feb 3, =C2=A06:21pm, cheer_xiao wrote: > } Subject: Re: Slow completion when using aptitude > } > } On Mon, Jan 31, 2011 at 8:02 AM, Bart Schaefer > } wrote: > } > > } > So try using this instead: > } > > } > _deb_packages_update_uninstalled () { > } > =C2=A0_deb_packages_update_avail > } > =C2=A0_deb_packages_update_installed > } > =C2=A0if (( ! $+_deb_packages_cache_uninstalled )); then > } > =C2=A0 =C2=A0local avail > } > =C2=A0 =C2=A0for avail in $_deb_packages_cache_avail > } > =C2=A0 =C2=A0do > } > =C2=A0 =C2=A0 =C2=A0 =C2=A0(( ${+_deb_packages_cache_installed[(r)$av= ail]} )) && continue > } > =C2=A0 =C2=A0 =C2=A0 =C2=A0_deb_packages_cache_uninstalledr+=3D( $ava= il ) > } > =C2=A0 =C2=A0done > } > =C2=A0fi > } > =C2=A0cachevar=3D_deb_packages_cache_uninstalled > } > } > } > } Was I supposed to include this in my .zshrc and that would solve my > } problem, or was it meant to be a hint for developers on fixing the > } bug? I have tried the former but nothing seems to change. > > Sorry, I could have been more specific. > > Putting it in your .zshrc is unlikely to work because it'll get > clobbered when the completion system autoloads the other _deb* > functions later. > > You need to find the file ${^fpath}/_deb_packages and edit it > to replace _deb_packages_update_uninstalled with the above. I tried this, but after typing "sudo aptitude install a" and hit Tab, zsh seems to be trapped in an infinite loop, with one of the CPU cores fully loaded. Should I turn on something else like caching, or is there a flaw in the code you provided? Thanks for your patience.