From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 19773 invoked from network); 29 Aug 2020 19:28:16 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 29 Aug 2020 19:28:16 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=jJvfif+BvoUNjWMHVIYFcbL+2RV/m/K1xUeFIhDG4N0=; b=Soc8xgdmZwvJtLLrnA4x+Trd0k QRKBqeXbj4swH9bdp8J77ACb8SmWUtB3MfOUA0HU20i7haYp8lugMwky4uJcWxww6yYWTtm1DTVzJ WnHWeDbv2WRzA9sKajDfizJpBMzwME+PucpA7zwvdE0p6HZ4feDJQB7gRk6o+sohE/zpKxF9Cq70z LeNdFgCXwQJE+PlhAYpv42XQtNOTe7s5J2ZsV6Hm1K2pQxagy5C+rvI2kxxaHM5Vo8GpQrCZoVDBY eydeGnA5kI1hwFgLM3Yu0wKuE2s5DwAnc8MlSglMc8FfEGPjwWJxkqS5KO5YGZL3AfhZAzxkf34nM BmKX1J8A==; Received: from authenticated user by zero.zsh.org with local id 1kC6WI-000GUL-Gq; Sat, 29 Aug 2020 19:28:10 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ot1-f49.google.com) smtp.remote-ip=209.85.210.49; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=skipped; arc=none Received: from mail-ot1-f49.google.com ([209.85.210.49]:34155) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kC6Vo-000G6y-Gn; Sat, 29 Aug 2020 19:27:42 +0000 Received: by mail-ot1-f49.google.com with SMTP id k20so2147698otr.1 for ; Sat, 29 Aug 2020 12:27:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=jJvfif+BvoUNjWMHVIYFcbL+2RV/m/K1xUeFIhDG4N0=; b=ITSNmGKhdwiiqcQNpZoJyGLEtE5or2VjWhps8Y6IlQTuLCITjVs7EJ2J2sc0UEuU2m JRM9Shv0K04g7L1KMoOZ0rHLXgk/suzVhguKo9CD7Srk2O/A48q2VHHe+iQZxctu9YuV vNBVKi0F7kQwcUbEU1FgUWRA34lEIXdtnssI26b0aqZsgrlcwda1n67cMPmzASVYScuG qikQSU+qWf2dOSlb11A0SMUiPespZ2CnGtdNlDh7Ze3pOLBb4bVsUIHhlulUJXIR1CYN /uem+EFHEfVPCP6ed9vtAXKTm+I5EbIZjI42CIAYT7K+s9mLJtKJoPf0LmKCPx0j8PeI jVKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=jJvfif+BvoUNjWMHVIYFcbL+2RV/m/K1xUeFIhDG4N0=; b=kRs7QaXhr/Us9ijbDMMo0N2hTS7VRMDe8BEwKVfNGx37dyahygTctl0AUwNDvI234X NinRftmpJ7uBlCOoAzbZjWAjrhZFg+X714Zcpvm80ZE24vOZZ1oaP7YmFMZLyJW0X7b/ WVI94VfYVjw0v4XBlgah1Sr95kvzBS5/ub4Ehc0sbmc1rf4++vHeCBUKsjLXZdc0fVa4 QAMCwD2RT8v6R+lJDET+MklOYig3ibd8zPrR9MtsTBhcSKemGFvLN78rmzMBAR1vgWBa 852BA4jMltnRMNpJREmErOOMSFH7jG6LaPUgVtBnvT5OfKNH23ivWukUnjlzLlJMb+pq bLUw== X-Gm-Message-State: AOAM5313r0GxuObt9lFFV6reDGfDIglcGlWka7iZQ0S4EZLNS8hmkXLG czvNgzPK5BDv6EBLLLiKyOqqhm3Dkw2zkbAABt8tgICpzLl/Sw== X-Google-Smtp-Source: ABdhPJzow1pbQw1wrwxmvVgETCIQd5/uaJ3+oetwoK3m14uVkVe4R/0SI+jXeBWgKy9UwX1ROp6y5Tq6oveBzZ91el4= X-Received: by 2002:a9d:ae8:: with SMTP id 95mr2281224otq.260.1598729259260; Sat, 29 Aug 2020 12:27:39 -0700 (PDT) MIME-Version: 1.0 References: <301108111.164161.1598719628682.ref@mail.yahoo.com> <301108111.164161.1598719628682@mail.yahoo.com> In-Reply-To: From: Bart Schaefer Date: Sat, 29 Aug 2020 12:27:28 -0700 Message-ID: Subject: Re: detect if command has a completion function To: Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 26048 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: On Sat, Aug 29, 2020 at 11:33 AM Bart Schaefer wrote: > > Don't bother removing the compdef lines, just remove their results. This could be taken a step further: all_comps=( ${(v)_comps} ) completed=( ${(k)_comps:#-*} ) installed=( ${(k)builtins} ${(k)functions} ${(k)commands} ) not_installed=( ${completed:|installed} ) unset '_comps['${^not_installed}']' used_comps=( ${(v)_comps} ) unused_comps=( ${all_comps:|used_comps} ) unfunction ${(k)functions:*unused_comps} (Note the tweak to completed=(...), I think -* covers what needs ignoring.)