From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16284 invoked by alias); 18 Jun 2018 22:12:35 -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: List-Unsubscribe: X-Seq: 23498 Received: (qmail 2767 invoked by uid 1010); 18 Jun 2018 22:12:35 -0000 X-Qmail-Scanner-Diagnostics: from mail-pf0-f175.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.192.175):SA:0(-0.9/5.0):. Processed in 0.679948 secs); 18 Jun 2018 22:12:35 -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=-0.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_PASS, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: arturoescaip@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0nrwcY9w9ejOlBncbeJeUxgFGM6MQnmgcRL6WDe0ZPY=; b=XfvmsC406gCyJOEttz5Ne5ZcGJJAt5Cq94feumjNDMD4O0KU3gyf2Fv8Yk22nnnm5P h733QTx01H5YWCnUlzJrtVrG46fbWKyHWeSmcVP/g4hvd0eiqh7CDsTV0Lesv2I0I9r9 VmJutUHwnHjc8s3/qAjxrgxal2HSjXv674Kf8Tzi0Gjj6RiG3XS/FxjnzyXrXrj5+aES TvMCBStgrhMilpeZv8PFdV7cMrgDyZTdQ0eKCOC74BHPAsZRFZZHCEFPRz201/Dcd6AW ei6A20N4Js8U9ZWfSfo0Cd/k7cC/TiSIL2ZH5u9q6VwAomr4i10tulDbjpny92m1iDgc QP+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0nrwcY9w9ejOlBncbeJeUxgFGM6MQnmgcRL6WDe0ZPY=; b=NTdumEYNm+lriiqblRjLRY9bB8nqni2QoaHoWxgrW/7WUW2k2EgYc94PUczCMh77X7 tLrOeViYZVjZs7PxwSCVyoF/Xa0i/y53yacEbfHhRcWHvv76GzOMLRprTxGGe5bYRYAc BaIZRnPz8RfbKGhZvZuzY7+2VX813jcPTJQ8wTX2YB7zVDx56KUKQZmwU7QDE2E4dnw2 htblhIRQrysNOqD5bmS8NiJdjLWZ2uQT8tSHJAkHmWPld90vLLqT5JqEeB3Oo+bIjNKR d4cDcX8KHZFE3bpEuI+acPh2xAJskb2fm9eA4T53iOHuFvHpKjbY+0CQerp1rHaX6jsJ Mchw== X-Gm-Message-State: APt69E3Vhx4e1sxMzcOcPX/13lyvVJngARo//sxrcM+ULQFcQKCRsbS2 7Evde4FmCFSAv++quL3S064adN1H9HSLUJHMsN4= X-Google-Smtp-Source: ADUXVKKvHRHEZXvP9+HTboLdMIhwC8mSINuEVrawifnm+GM9HkxrYTCMTY1gKgRDMRFd50eMy2cqN507jeNWhivPLm4= X-Received: by 2002:a65:4348:: with SMTP id k8-v6mr12702736pgq.341.1529359951748; Mon, 18 Jun 2018 15:12:31 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Arturo Escaip Date: Mon, 18 Jun 2018 15:12:20 -0700 Message-ID: Subject: Re: completion configuration To: pierpaolog@gmail.com Cc: zsh-users@zsh.org Content-Type: multipart/alternative; boundary="000000000000a863f0056ef1dcc8" --000000000000a863f0056ef1dcc8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hey Pier, I=E2=80=99m not very knowledgeable about styles, but I think you may have t= he context pattern wrong. You can use C-x h to see the context at any point when writing a command and you can use that output as a guide when building a pattern for a style. For example, I have a command that I wrote that is called pb and this is the output I get when I do C-x h right after typing pb: ~% pb tags in context :completion::complete:pb:: argument-1 options (_arguments _pb (eval)) The full context is :completion::complete:pb::, I think in your call to zstyle you are missing the last two colons, so what if you try: zstyle ':completion:*:approximate:my_command:*' max-errors 0 You don=E2=80=99t need the -e option because you don=E2=80=99t need 0 to be= evaluated. =E2=80=8B On Mon, Jun 18, 2018 at 2:41 PM Pier Paolo Grassi wrote: > Hello everybody, I must confess I don't have a clue when it comes to > configure completion styles. I made various attempts but for now, I don't > seem to grasp the syntax of ztyle. > I have in my .zshrc (blindly copied years ago from who knows where): > > zstyle -e ':completion:*:approximate:*' max-errors \ > 'reply=3D( $(( ($#PREFIX+$#SUFFIX)/3 )) numeric )' > > that, as I understand, enables approximate match for all the commands whe= n > trying completion for a number of errors proportional to the number of > characters of the word to be completed etc. > > I would like to disable this completion for a command that has a complete= r > function I wrote that pass to compadd various values, since these are so > many that the completion is very slow to show matches. So I thought that > maybe disabling the approximate match for this command would speed things > up. > > My best bet doing this was: > zstyle -e ':completion:*:approximate:my_command' max-errors 0 > > but this does not work. I tried also various variants to no success. > Can someone shed some light on this please? > > -- > Pier Paolo Grassi > email: pierpaolog@gmail.com > linkedin: https://www.linkedin.com/in/pier-paolo-grassi-19300217 > founder: https://www.meetup.com/it-IT/Machine-Learning-TO > --000000000000a863f0056ef1dcc8--