Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Qmail-Scanner-Diagnostics: from mail-pa0-f43.google.com by f.primenet.com.au (envelope-from <schaefer@brasslantern.com>, uid 7791) with qmail-scanner-2.11 
 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1.  
 Clear:RC:0(209.85.220.43):SA:0(0.0/5.0):. 
 Processed in 0.105304 secs); 17 Jul 2016 19:20:55 -0000
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID
	autolearn=unavailable autolearn_force=no version=3.4.1
X-Envelope-From: schaefer@brasslantern.com
X-Qmail-Scanner-Mime-Attachments: |
X-Qmail-Scanner-Zip-Files: |
Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=brasslantern-com.20150623.gappssmtp.com; s=20150623;
        h=from:message-id:date:in-reply-to:comments:references:to:subject
         :mime-version;
        bh=pEZ2asxQf1k0k0Q1lTrBKctZUpY/Kp01mmZykU6mA9E=;
        b=RuahuF6BN2/IY19AWgrktksecqR7pYxLc86Gy6xeEnhzc5rlr29Yuy4J+kh2qygOpe
         Zv0TeFN4m9KxJ0pHQbSDzOTNaUEIvgoD4kO60OVODGaeE/hL6u2/1arWfCC3jSB+zAIH
         rrviYMPophVzEeAHkDmQqroa61r2Pr8Kh2qLtN814QGVYJwlSjYAzXR3s5/ntWerDyT4
         ZOASKrn2SYwT0g0fBNFr4MZbPc0EwmW4MvLsKePgRumjyuQstOjNdPjuiKNFZFduIdsx
         sGuK3mgzwzd70jf3ufNzc1tuuYv5T5pwm8YO50UfgQZ9scT2pROy9jmBp0HNfUIAIgWs
         so5g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:message-id:date:in-reply-to:comments
         :references:to:subject:mime-version;
        bh=pEZ2asxQf1k0k0Q1lTrBKctZUpY/Kp01mmZykU6mA9E=;
        b=Jf/RPvSJdAzkuuSQaG5kv8ZDz5bOVN/4MIDPRmfALeEps3V0P3PeqmPA4iA8zBpMJ7
         rNg8teoHf4VIFzt8J6lfTXVSa+3siEKcoFJGrAp3CVD3lCeIo0FV7fTWDkRhgNF9QLH3
         F8AR1nzBmP6wqp0admYKI5ajSaMgTLSWLexS1c+BLSEOyEdrheLbo+yEPpU+TK4tQ75a
         HWUmSoUJig4OuuC3qOlOQx3l8bmF7zt5L33HvmpEfCAViTa/r/I56oSAq0naYw/gF7iD
         d1oz+yBgn5znHEvxuQxjE6jhSACVTOiRQbhBgfmh2YIu7im9RQTUzGDEMX80v/2nAyCe
         Ja+w==
X-Gm-Message-State: ALyK8tKpx+ifWMHspcbEY70EFX3tfWo/apLGUBJ/S1k2bN2Y//rhid8AT29OSEZZ+LZhig==
X-Received: by 10.66.117.105 with SMTP id kd9mr49927312pab.40.1468783249171;
        Sun, 17 Jul 2016 12:20:49 -0700 (PDT)
From: Bart Schaefer <schaefer@brasslantern.com>
Message-Id: <160717122119.ZM1765@torch.brasslantern.com>
Date: Sun, 17 Jul 2016 12:21:19 -0700
In-Reply-To: <1468767614-9635-1-git-send-email-danielsh@tarsus.local2>
Comments: In reply to Daniel Shahaf <d.s@daniel.shahaf.name>
        "[PATCH] _add-zle-hook-widget: New completion." (Jul 17,  3:00pm)
References: <160716185103.ZM5258@torch.brasslantern.com> 
	<1468767614-9635-1-git-send-email-danielsh@tarsus.local2>
X-Mailer: OpenZMail Classic (0.9.2 24April2005)
To: zsh-workers@zsh.org
Subject: Re: [PATCH] _add-zle-hook-widget: New completion.
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Seq: zsh-workers 38873

On Jul 17,  3:00pm, Daniel Shahaf wrote:
}
} I wanted to use 'autoload +X add-zle-hook-widget; zstyle -g reply
} zle-hook types' to avoid duplicating $hooktypes, but couldn't get it
} to work. (Neither with -k nor with -z was the style defined)

Er, yeah:

     The flag +X attempts to load each NAME as an autoloaded function,
     but does _not_ execute it.

This is in part why I went to some lengths to be able to "source" the
file as well as autoload it.

You could do this:

_add-zle-hook-widget_classes() {
  local -a hooktypes=( ${^${=${(f)"$( add-zle-hook-widget -h )"}[3]}} )
  compadd "$@" -M 'L:|zle-=' -a hooktypes
}

