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-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:from:date:message-id:subject:to:content-type;
        bh=iG/a6ppCWkAEPNMojoAZ/beCZtMGKbTkpyyFGR4wMRY=;
        b=s8Ck65cpbg/DgI+iz4zB9lrbf83d94GL3WjTcF4F6RXBy+n/gMOtvpPkPiq45qmiSW
         nfZx54yprrept/uQ3hIWL5dc6OZc3KueDpH8r2zZGKU/uTTI9QjPz/mY0JhYgWd/4qAU
         Jad3wI/67yy+cP2WxovdQFN6eg14OIFw9KFfA42TjecNJST/0jY9hDUlTPIj7fJ24163
         WBCuKziW13DjpoiDO00KJhbfJYxiDy8VDlGWY7aXkfOUyLboMow5pG8xZdHwp5lm3WP8
         WsnCuy1FAMm8SOvMto+IEZnOnHZw3a3YGNLa3ug+2CckGPbtDLDpND5PEZD0SAg93etF
         pULQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:from:date:message-id:subject:to
         :content-type;
        bh=iG/a6ppCWkAEPNMojoAZ/beCZtMGKbTkpyyFGR4wMRY=;
        b=mum67K6lRDqyg9L6/loI1oM4iwLDUSrq6/os5zai6n8Ed8Xj/roU+mGOeftDymAA9x
         PyHcLE8dParvTEc7gv648phjaQLd2D9xJwqjrri7sCVe25b/bcVFyrjI8+2/z8TNOwHp
         IE9qNn8WPdssMMJ8bSsNkGFcO9/cIMb9eMKJnQN/JqUGfDnG4YLrVFYbkQVuKjMRC475
         GvAiGXJvEzWDpoLYeH/PPeofZJ+Is82uUpjbbljoQjMwX2WgmS9DszMbnZYJLbKe2/7e
         QWKBIvEc0gWJkgOIchCIxcKq4SbD9ATJs8pYYbFTWlfxshqHa5QyK9ioCJokHR673H+f
         7unw==
X-Gm-Message-State: AG10YOQG+FYUj5aLeccz0o1cTjFhCcT08SnJGwSolsbanIJfq4d3s1HzmiHrHOB/x4xi/Bd39Gxx0s3l1HV1aQ==
X-Received: by 10.25.20.218 with SMTP id 87mr1898745lfu.148.1453491866847;
 Fri, 22 Jan 2016 11:44:26 -0800 (PST)
MIME-Version: 1.0
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
Date: Fri, 22 Jan 2016 20:44:07 +0100
Message-ID: <CAKc7PVByfo51GcVkb_kYgO2D3cWYrcq-p4v8gmyfsaeWU=2new@mail.gmail.com>
Subject: Proof of concept mainstream plugin manager
To: Zsh hackers list <zsh-workers@zsh.org>
Content-Type: text/plain; charset=UTF-8
X-Seq: zsh-workers 37729

Hello
There are many plugin managers but the technology is not very
astonishing. The managers add any plugin to $fpath and that's pretty
it. FPATH gets flooded, possibly naive code gets injected into
session. That's why the technology isn't very popular on this mailing
list and on IRC.

I've utilized Bart's idea to prevent fpath from flooding:

  function some_function_from_plugin {
        local FPATH=/path/to/the/plugin
        autoload -X
    }

and written a plugin manager that utilizes this. Furthermore, any
autoload, bindkey, setopt is catched and a report of plugin operation
can be obtained:

https://asciinema.org/a/f4g9dgqcq2w7998761qyigqa2

I've written the proof of concept software in 1 hour. I wonder, could
this be a path that Zsh mainstream could take to provide robust
technology for plugins, whose users demand? I imagine much more can be
done if mainstream pairs of eyes will look at this. Any ideas of what
can be done?

https://github.com/psprint/zsh-plugin-governor

Best regards,
Sebastian Gniazdowski

