From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14979 invoked by alias); 27 Jan 2016 07:48:07 -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: 37813 Received: (qmail 23202 invoked from network); 27 Jan 2016 07:48:06 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=p/fFf3WnBMwyWALBveYpuU58o8fbsKepC8x0p6NPNhE=; b=LQBBS6XuwGO5c2sMhXw+9GVVDx/KaPPH6EyNki9HGnAjchFOWZKffG05Vfcg0PfKRv vzrxQb53PM8gcOmrtWyztrS6/vsSQ4zFpl/IhoxZpqLK3tt2aYQPA4npud9iJ2ONXSK5 5w3aLaRNKi6uFLYF4N4IvwDAD/5vPICHpWMZBKnB42VRXDEjDY08rxfzVfQO/Tck/Gkd Gwu29pSU5CwqwHLjKZL/BycFESY8qMpkTqWdoUR0pWgVD4FXE+5k9vD7b5TwjpvyeW0A XH2rsVvuXo0rDxYaAYmjqz4gy/+HijbmPZOJVLfQ+mV+4SCa8H3Ssl7lF7NOzTZokr96 2pxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=p/fFf3WnBMwyWALBveYpuU58o8fbsKepC8x0p6NPNhE=; b=NdsjgANyszjX3ymRIlWQh7a06IxqlM0vsIAoQ6OOqpyI7C0HZta9PDUiVsnTfSq91M LTQltyVKfnHuBwgCTL9aACilqVwaBkNL6/VpzGrSzEGuZ2EGYWJWHTL2Pwc2Dbwk2Ani X/eylrrbYCWZCfEiqP+iLXzZMSzYEJ8FtUO23NFp3wWHQEU+2VcDg+8Q+ByixuUxEMtL JcHlPum1u7nV4MfRjQGihGPKY/qWakwJeT483tOIi93GQJ/Bj2phR88Abypq8tSdPwtr +ZRlcdi0mcMlOkTlSbTC2pEf+psS1k82Eb36zp5e8H9zQciK8ep25WU88WzidDCmdmCE R5vQ== X-Gm-Message-State: AG10YOTD7mfwhx0yq/W3EawEKhEjmMAm/IXRShQzFRWoDEowHIKK105ZLhlobgR7nXQCXntKSqKkXWUYlWLk4g== X-Received: by 10.25.151.9 with SMTP id z9mr8702063lfd.72.1453880884254; Tue, 26 Jan 2016 23:48:04 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20160126225009.GA31700@tarsus.local2> References: <160122173705.ZM11491@torch.brasslantern.com> <160123093602.ZM14454@torch.brasslantern.com> <160123112004.ZM14739@torch.brasslantern.com> <160123120055.ZM14828@torch.brasslantern.com> <20160126225009.GA31700@tarsus.local2> From: Sebastian Gniazdowski Date: Wed, 27 Jan 2016 08:47:44 +0100 Message-ID: Subject: Re: Proof of concept mainstream plugin manager To: Daniel Shahaf Cc: Zsh hackers list Content-Type: text/plain; charset=UTF-8 On 26 January 2016 at 23:50, Daniel Shahaf wrote: > Sebastian Gniazdowski wrote on Sun, Jan 24, 2016 at 11:51:49 +0100: > I'd be more interested in the "How to > package a plugin to make it loadable by zplugin" side of things. matches=( $dname/$pdir/init.zsh(N) $dname/${pdir}.plugin.zsh(N) $dname/${pdir}.zsh-theme(N) $dname/${pdir}.theme.zsh(N) $dname/${pdir}.zshplugin(N) $dname/${pdir}.zsh.plugin(N) $dname/*.plugin.zsh(N) $dname/*.zsh(N) $dname/*.sh(N) ) [ "$#matches" -eq "0" ] && return 1 local fname="${matches[1]#$dname/}" That's how things are done currently. This is based on what zgen checks for, but done better, I quess, in single line. So, to create a plugin, a directory with e.g. "directoryname.plugin.zsh" is needed, and then it can do autoloads and setopts, etc. Zplugin does more than just sourcing, tracks e.g. the setopts, to report them and also to allow unloading, with options restoration. Best regards, Sebastian Gniazdowski