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 hermes.apache.org by f.primenet.com.au (envelope-from <danielsh@apache.org>, uid 7791) with qmail-scanner-2.11 
 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1.  
 Clear:RC:0(140.211.11.3):SA:0(-1.3/5.0):. 
 Processed in 0.147449 secs); 17 Jul 2016 14:59:39 -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=-1.3 required=5.0 tests=FAKE_REPLY_C,
	HEADER_FROM_DIFFERENT_DOMAINS,RP_MATCHES_RCVD autolearn=unavailable
	autolearn_force=no version=3.4.1
X-Envelope-From: danielsh@apache.org
X-Qmail-Scanner-Mime-Attachments: |
X-Qmail-Scanner-Zip-Files: |
Received-SPF: none (ns1.primenet.com.au: domain at apache.org does not designate permitted sender hosts)
Date: Sun, 17 Jul 2016 14:59:33 +0000
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Zsh Hackers' List <zsh-workers@zsh.org>
Subject: Re: add-zle-hook-widget Re: Next release (5.3)
Message-ID: <20160717145933.GA9239@tarsus.local2>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <160716185103.ZM5258@torch.brasslantern.com>
 <160713171152.ZM22376@torch.brasslantern.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Seq: zsh-workers 38869

Bart Schaefer wrote on Wed, Jul 13, 2016 at 17:11:52 -0700:
> -# Handle zsh autoloading conventions
> -if [[ "$zsh_eval_context" = *loadautofunc && ! -o kshautoload ]]; then
> -    add-zle-hook-widget "$@"
> -fi
> +# Handle zsh autoloading conventions:
> +# - "file" appears last in zsh_eval_context when "source"-ing
> +# - "evalautofunc" appears with kshautoload set or autoload -k
> +# - "loadautofunc" appears with kshautoload unset or autoload -z
> +# - use of autoload +X cannot reliably be detected, use best guess
> +case "$zsh_eval_context" in
> +*file) ;;
> +*evalautofunc) ;;
> +*loadautofunc) add-zle-hook-widget "$@";;
> +*) [[ -o kshautoload ]] || add-zle-hook-widget "$@";;

The [[ -o ]] test will be always false because of the 'emulate -L zsh'
at the top, won't it?

This hunk should also be applied to bracketed-paste-magic; there there
is no toplevel 'emulate'.

> +esac
> +# Note fallback here is equivalent to the usual best-guess used by
> +# functions written for zsh before $zsh_eval_context was available
> +# so this case-statement is backward-compatible.


Bart Schaefer wrote on Sat, Jul 16, 2016 at 18:51:03 -0700:
> It also switches from defining the hooks functions in a loop to defining
> them with multifuncdef syntax, and updates contrib.yo.

The new docs look great, thank you very much! ☺

