From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19796 invoked by alias); 22 Jun 2016 20:25:10 -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: 38750 Received: (qmail 18589 invoked from network); 22 Jun 2016 20:25:09 -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.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 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=dJ4C1YBZuIMLB574aoBgTcfc2Z+MHmjVaBNHl7czzvs=; b=k+JrFEnpl9OzUUDB9FtaU0H93xik1b2sR0nqZj9kin4JDpqE65aFfDiciMojTEbGv/ N28l9gydgXHxYOCZIlJEXfO2/1+2lzDzMwGwrHVdRH/s8YIa0C4ct5GGZxv/797leZKf pygRxnkE9eKEVzhY3xM/ZSV5CP6Vl+tQjeJ35eeL+hjcIUL10i86U+pjwvXB7UbaLqWZ ti+SEUdZgYTgtFBljzHLb+CtUO4UJaL0M4rK3F0PUt/F362gKS9RlZd8yHHHQ1KrM2xd ZM/uVxO7jr++kdFuKlIEzlEOR2EC3Img93fUvaMTy3R29WUoNUQt6mH3zFmS1pUKFwni gsLg== 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=dJ4C1YBZuIMLB574aoBgTcfc2Z+MHmjVaBNHl7czzvs=; b=fhxXg+FdWsa3yu7kD7kE54UwVtosXmF7fRAEETQ89vjAHdvvE2oQF2gOciab+M943L RKmsNOaMZSBHakBtZuMuOTA34q5xZdCWOPs9eoUDCCI+i40zsAALGGry041JrSyFXoqC Unos8pbdNiDv5pwmpLKz2VQtVkyuQbVGbs/vtBYEyJ9K75s/Bl+V0VxM72hcnBuTJSDa /KkEI9YvyP6kzIDIpMVeiOjfc8xDKvMs7tPTpzeGbsgEV2n59U8BmqiYo+tgq7ykSeDs sYkBZZVQxnSeAyJYsME8FOooJ7ucQZOX6U9qIDozXsKNkATSQMztqWo9jwugC83goDFH EHSQ== X-Gm-Message-State: ALyK8tKorBM5RmdF5flktZtTVF7OH6QnDVyeDzbHHXcHAwP1dDeUP8mEcegL/jHX8hXARg== X-Received: by 10.98.5.2 with SMTP id 2mr23291647pff.58.1466627105858; Wed, 22 Jun 2016 13:25:05 -0700 (PDT) From: Bart Schaefer Message-Id: <160622132541.ZM12746@torch.brasslantern.com> Date: Wed, 22 Jun 2016 13:25:41 -0700 In-Reply-To: <20160621014130.GA17100@tarsus.local2> Comments: In reply to Daniel Shahaf "Re: [PATCH] add-zle-hook-widget" (Jun 21, 1:41am) References: <160612184453.ZM11316@torch.brasslantern.com> <20160613085219.GA23148@tarsus.local2> <160614111054.ZM17893@torch.brasslantern.com> <20160615232447.GA29225@tarsus.local2> <160616222055.ZM27034@torch.brasslantern.com> <20160621014130.GA17100@tarsus.local2> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: [PATCH] add-zle-hook-widget MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 21, 1:41am, Daniel Shahaf wrote: } Subject: Re: [PATCH] add-zle-hook-widget } } > I'm not sure there's a way to make it safe for all three of autoload +X, } > source, and kshautoload. } } Wouldn't the following work? } } $ cat f } f() { echo I have been called with "$@" } } if [[ "$zsh_eval_context" != *\ file && ! -o kshautoload ]]; then } f "$@" } fi I don't think this correctly handles the case where "autoload -k" is used but kshautoload is not actually set when the function is first called. There's also the reverse case, where kshautoload IS set but the function was declared with "autoload -z", to be considered.