zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: detect if compinit was run and rerun
Date: Fri, 1 Jun 2018 16:52:28 +0100	[thread overview]
Message-ID: <20180601155230eucas1p194ef43527516536f63849b4205608220~0FCtchhae1846918469eucas1p1n@eucas1p1.samsung.com> (raw)
In-Reply-To: <20180601145818.GC17967@robusta>

On Fri, 1 Jun 2018 16:58:19 +0200
Paul Seyfert <pseyfert.mathphys@gmail.com> wrote:
> I am therefore wondering if I can detect if `compinit` has already
> been called and rerun it if so.

if (( ${+_comps} )): then
  ...
fi

should be good enough in the vast majority of cases.  _comps is only
setup within compinit or by compdef which isn't defined until compinit
runs.  So this only fails if the user is doing something very personal
best kept to the privacy of their own home.

pws


  reply	other threads:[~2018-06-01 15:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180601145937epcas3p38d330847971b65037b3a1596f186f9e9@epcas3p3.samsung.com>
2018-06-01 14:58 ` Paul Seyfert
2018-06-01 15:52   ` Peter Stephenson [this message]
2018-06-01 17:12   ` Mikael Magnusson
2018-06-01 17:46     ` Sebastian Gniazdowski
2018-06-14 15:12       ` Paul Seyfert

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='20180601155230eucas1p194ef43527516536f63849b4205608220~0FCtchhae1846918469eucas1p1n@eucas1p1.samsung.com' \
    --to=p.stephenson@samsung.com \
    --cc=zsh-users@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).