zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Sebastian Gniazdowski <sgniazdowski@gmail.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: How to disable completion for a builtin? (actually a reserved word) + an apparent bug
Date: Wed, 24 Jul 2019 16:48:27 +0100	[thread overview]
Message-ID: <1563983307.5930.28.camel@samsung.com> (raw)
In-Reply-To: <CAKc7PVAN7BtCRRX0rJAN29PUbTQyR6ot_SicMLzoHFFE4CVz+Q@mail.gmail.com>

On Wed, 2019-07-24 at 17:39 +0200, Sebastian Gniazdowski wrote:
> śr., 24 lip 2019, 17:15 użytkownik Peter Stephenson <p.stephenson@samsung.com> napisał:
> > On Wed, 2019-07-24 at 17:02 +0200, Sebastian Gniazdowski wrote:
> > > On Wed, 24 Jul 2019 at 16:28, Peter Stephenson <p.stephenson@samsung.com> wrote:
> > > > 
> > > > 
> > > > On Wed, 2019-07-24 at 16:18 +0200, Sebastian Gniazdowski wrote:
> > > > > accomplish this?
> > > > unset '_comps[declare]'
> > > Actually that's not what I've meant. I've should have put this more
> > > clearly: how to prevent command `declare' from being completed? Like
> > > if chmod -x /usr/bin/declare?
> > 
> > Either you have a special completion, or it does default completion.
> > If you don't want default completion, you need a compdef for a do-nothing
> > completion function.
> > 
> > pws
> I don't want to change disable's completion. What I want is that:
> 
> % decl<TAB>
> 
> will not try to complete "declare".

declare is usually a builtin.  If you disabled that it should
remove it from the list of enabled builtins and reserved words
and it won't complete.

disable -r declare
disable declare

(they're different because the reserved word needs to do
special parsing for arrays that an ordinary builtin doesn't.)

If you really have an external command called declare, remove
it from the hash table:

unhash declare

pws


  reply	other threads:[~2019-07-24 15:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20190724141945epcas1p30d69e2d7ba1ce29f994ff486284d4553@epcas1p3.samsung.com>
2019-07-24 14:18 ` Sebastian Gniazdowski
2019-07-24 14:27   ` Peter Stephenson
2019-07-24 14:56     ` Sebastian Gniazdowski
2019-07-24 15:02     ` Sebastian Gniazdowski
2019-07-24 15:15       ` Peter Stephenson
2019-07-24 15:39         ` Sebastian Gniazdowski
2019-07-24 15:48           ` Peter Stephenson [this message]
2019-07-24 15:59             ` Sebastian Gniazdowski
2019-07-24 19:50           ` Eric Cook
2019-07-25  8:58             ` Sebastian Gniazdowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1563983307.5930.28.camel@samsung.com \
    --to=p.stephenson@samsung.com \
    --cc=sgniazdowski@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).