From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23338 invoked by alias); 8 Jun 2016 04:35:19 -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: 21628 Received: (qmail 21842 invoked from network); 8 Jun 2016 04:35:18 -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-transfer-encoding; bh=GQW7czKhdDOpF7hFW6aMFU/NgC7PDgk9LkL4PX/cSOs=; b=tMH/hY99MbCwVUbk15xsnVnBjZMdVCK77OFUav8jJ1amqeUXxKAUuPqhyMpqKWT2lI /XTtcS8hANzJi01t5tgIOs3rYiyLCKIf2qVBWsrB8ENsG2kMeKEv9y6aoV4MoifhH9Wm 1C26cdhL0o48WeQObkYcyImxjQ8w7RcswCnTUnVqSCpmsijBJi5Qyw/0+6wP5AtA2eq7 wiVXLXY10VM1e+65aDcEBnFroC0YBfx7s1hyKocgpPWsOFoIjczAeVS9MIkzPguIEyGS 9LOR6B4kQ0hgYRUJbv4gGIxgzY+IGUet4pYD9HrzI4z8G92LEhC85UQB/RoyeuxhwLQM zXvQ== 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-transfer-encoding; bh=GQW7czKhdDOpF7hFW6aMFU/NgC7PDgk9LkL4PX/cSOs=; b=FCax/H1SVzV6YlYZ0ApOvRg1R07h/AXy0Jf81R8EiZFow/TFnkHPne0kuXw6ruS46D owmhZNP8FjAqCO5qlNYwgqMEBE+BhOtWR71dXN/Sx5TnNhUvp9X7Pzj84A6XJM1Ui52U UmjjAJvC9AGl/Unw/09E1sxwMwYMCx0qJ8ZaD+RX/tbHdCVMbShkJzzKXzpFWiypoH+/ VPqzEDa8DcVaO60kNu9FLpxxVjS1FnOsY0TnaRKuJwiP62BcO6DkXMLTizMS9u540BNz ZX5gA1bGR70K0GfGHhvPmG/W8Q4zZPD74sHosokC/Q99I0suPhXkLzL3pXyMKAhqaQWg XXig== X-Gm-Message-State: ALyK8tLPvmKwuO7OABW5huNx0apy0tIv/lWKFaFIkfAmctCJN2MV0Wk6rkNp5DMz5zORiNYVlxBaFCCeCdmRjA== X-Received: by 10.140.136.16 with SMTP id 16mr2920737qhi.25.1465360516158; Tue, 07 Jun 2016 21:35:16 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <160607134455.ZM29902@torch.brasslantern.com> References: <160606090104.ZM11947@torch.brasslantern.com> <160607134455.ZM29902@torch.brasslantern.com> From: Sebastian Gniazdowski Date: Wed, 8 Jun 2016 06:34:56 +0200 Message-ID: Subject: Re: Are completions in some way heavy? To: Bart Schaefer Cc: Zsh Users Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 7 June 2016 at 22:44, Bart Schaefer wrote: > To your later point, *dis*abling a completion isn't something that I > recall ever being closely considered. The assumption was that if you > didn't need a completion, it was either because you never used the > corresponding command (maybe it isn't even available to you), or you > always type out the arguments without pressing tab. This is fine, all logical. However from practice about "having a clean FPATH" I can maybe signal a topic about need of order of users. Ability to do "disable debian", "disable cygwin", "enable osx", to turn on and off needed/unneeded completions would bring this sense of order maybe. But logically this is futile. Compdump optimizes greatly, autoload keeps functions fit, user uses completions that he needs to use, what's the point of disable/enable. > I believe the problem is that some people expect completions to be more > comprehensive/intuitive than they were ever intended to be. Completion > is supposed to save you keystrokes and occasionally to jog your memory; > it's not supposed to be an AI that eliminates the need to think. ... > } I guess patience is needed for completions. They're like small man > } pages that disturb view. One has to keep calm and try to read. Then > } it's fine. > > Again if they are actually disturbing you, why are you invoking them > in the first place? They're not meant to slow you down. If you have > to patiently read, then seemingly you did need your memory jogged and > the information is worthwhile? Luckily an example can be provided. I was greeping for a text. It was returning git objects. Wanted to disable lookup in binary files. But can never remember is it "with-binary-files" or something similar (turns out it's --binary-files, but my memory didn't play nice on this). So I entered grep --with. Nothing was returned. I might have tried grep --binary and nothing would be returned because turns out grep completion is very short on long options on OS X (no one complained?). Reverted to manual. Entered "binary", found what was needed, used it. So why did I try completion. To take a guess maybe. This leads to an idea of how this could be done: - tab invokes "small man page" as it usually does after "command -" - the text can be searched =E2=80=93 entering something greps lines in the = "man page" - bits of text can be navigated like in file completion when properly configured =E2=80=93 I mean cursor keys move the reverse highlight over wha= t's available I have a proof of concept tool for this =E2=80=93 h-list, horizontal list (allows to browse elements horizontally). Might not look perfect as I do (z) split on current line and don't restore spaces when displaying (easy to fix): https://asciinema.org/a/ewb3uj9095ixakd45yiztnqey https://github.com/psprint/zsh-tools/ Also a bug revealed, searching for binary doesn't return "--binary-files". Nevertheless, Zsh has apparently proper tools for this task. Zcurses, desired performance (n-list, a vertical-only version, processes 120k elements with no problem), approximate matching. > } Forward-portable? > > Meaning, a function deliberately written using syntax from an older > version with the intention that it will run unchanged on all future > versions. That's fine for plugins that are meant to be compatible > with many versions, but avoid replacing an improved version of > something shipped with a newer zsh for no other reason than this. Yes that's something not wanted. Maybe generations of the completions could be done. Of course if anything will be actually done in the topic as performance gain is a fail due to compdump optimizations. Anyway, allocompletions-4, allcompletions-5.0.2, allcompletions-5.3. Best regards, Sebastian Gniazdowski