From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6103 invoked by alias); 10 Feb 2016 11:03:01 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21267 Received: (qmail 20334 invoked from network); 10 Feb 2016 11:03:00 -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,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 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=ZlGDWDiQQAgXqLEiFaNXxrwhVVRgmR86doNulY0Kwu4=; b=iADRAMBhRRGiueloS/Z/b3GE4mRQoSsRcRRoaRYfnhFaROky3FgXpw1E3yu1PdLG47 Fj/NfdlKPzJX1dmLdE83Doc32aanEHgNp2SjzubJcQRhtPyeZ1z9t/CMOouWtG6HjJsa IuoeY7j/67tA++qknudK1Gny6YmPQi+g9ahVDA0GfMLDNWKLeQ4nRHQrIriUekeqOmac ymHMeP8Be7uIvURZLtUOaCjAejbeAzVOd8I0BVcw5YD/e1uwmH5qO2cWik9xIvUH49T5 V1MSjSRG3GbrSzQeBgCiPQlw/RRkzI8Azq5Qfawmiku4XEXfZkGY9M/3kNkFBG7hsi2W 6Rkg== 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=ZlGDWDiQQAgXqLEiFaNXxrwhVVRgmR86doNulY0Kwu4=; b=Gh9ahDspkhWIRwiuDO3z7a8qxpcYM9wMNdKAXUTmFxo6vGJ9RVsbjdNCs4okjgZBa8 gCBfuN0IZpIuY62ao++yLwKaRQ+GqR2pzoQSyVHFW0BPbkdwKoAA7hnu/p4RENnIyGG/ +udth3ViPRB8BKUC8ZMiNkKRdPbflEs30xr1B3sGfdgdUYBUPZN/uAqHAr1YW84kljlp QgxJBe1C4c6aCpQMcftFKKlFMnQeRZZ9IPvr4S7in9P+RoeGJSGx8zu6+J4amdOu/kwG uX5m3Om1zkOoaiPwrXrkBhpMOBU65eE+OXNsjHgkEcdratzFktZVSL/qVuliraJZl4wx At2A== X-Gm-Message-State: AG10YOSaW1IJsSQ4XQQcl+HzlQnVN9H92a/XQYD303EDKPDFeDcFw7Amef3hvIPauHA2zdOO9/wHA6Io+ZW2GA== X-Received: by 10.112.199.41 with SMTP id jh9mr16049787lbc.125.1455102177537; Wed, 10 Feb 2016 03:02:57 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <20160210092322.GB6339@tarsus.local2> From: Sebastian Gniazdowski Date: Wed, 10 Feb 2016 12:02:38 +0100 Message-ID: Subject: Re: Forgetting about compinit with manual alteration of _comps To: Mikael Magnusson Cc: Daniel Shahaf , Zsh Users Content-Type: text/plain; charset=UTF-8 On 10 February 2016 at 11:32, Mikael Magnusson wrote: > Another thought is designing a plugin interface designed around how > zsh actually works, rather than bending over backwards to accomodate > cargo culted code that barely works in the first place. That's quite true, sadly. Most of the plugins are written very poorly. One reason for Zplugin to exist, with the debugging functionalities that are intended to quickly identify a junk plugin. Other thought is that writing robust zsh code isn't that simple. Let's forget about possibility of KSH_ARRAYS, which will break probably all plugins. There are other robustness-demanding options like GLOB_SUBST, where simple echo ${fg_bold[red]}"Hello"$reset_color will cause problems. I would create a list of options that would be repeated loudly for green Zsh programmers. Not that I knew all this myself always, only recently I discovered that SH_GLOB disables parentheses at parse time. The point is that flexibility of Zsh can be converted into quality control tool. Let fresh programmers know just few options (KSH_ARRAYS, GLOB_SUBST, SH_GLOB, POSIX_IDENTIFIERS, that's only four) and they will write better code regardless of their will. Plus patterns, which will allow to leave ABS scripting that utilizes sed, etc. Of course, this results in {} being all over the place, around ${#every_identifier}, etc. But not quite, when one writes plugin he can use setopt localoptions and configure zsh according to his needs. Exposed code would have {} everywhere, resulting in whole /usr/share/functions/* working with emulate sh. Best regards, Sebastian Gniazdowski