From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 14160 invoked from network); 28 Jul 2020 16:13:14 -0000 Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 28 Jul 2020 16:13:14 -0000 Received: (qmail 11238 invoked by alias); 28 Jul 2020 16:13:06 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: Sender: zsh-workers@zsh.org X-Seq: 46280 Received: (qmail 2280 invoked by uid 1010); 28 Jul 2020 16:13:05 -0000 X-Qmail-Scanner-Diagnostics: from mail-lj1-f173.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.3/25884. spamassassin: 3.4.4. Clear:RC:0(209.85.208.173):SA:0(-2.0/5.0):. Processed in 0.832033 secs); 28 Jul 2020 16:13:05 -0000 X-Envelope-From: mikachu@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.208.173 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=WAS1SRfDj/FgKWTOxh+SnS0ajkanM5VrFCDvL7U15xM=; b=pbOuUdmgXZ/yjJVqfWvYABSUaiNsKZw2MXLIRc6dDhKkpimR278gfbEcITvGt6wArz EzUBXqXz/FVDBqk3sr0f3o7e5NDaHyaT4gWzOOLOxdV6AxGnowaY05darQsD9YbXHSmB 6BLn0xUulNCM+2gorXqPFITJE014O1D/DyHY0BUEUHu3bqmlE6aqXaQdPQWfgzQgf4af tUsaFwbDpdYptXYQaWqDqTYjIvFHqg3R/ailk9WDa0ZzDRyesuD6b3NLUORva7WqIfNd P/p7nJpwr/BlMzMK2mjYUo9yRGa5C0R2bcMli34Qa5J2YQZHUt0ldNMDTAQAiYE3OGgq tnmA== X-Gm-Message-State: AOAM5334JuZJ10793hrirE1ycHKT4Eb9ODE5UxbHalo9iAsl4KCVHn7W VYu6KciiowcjXJf9x/SL9xpdvf+s X-Google-Smtp-Source: ABdhPJyA/lpihzFpEPCtX2zuqEzTubh6062XL7aZbe8IUP60TXRBtz0XG9Rke9F+w8J8LNV6HM7buw== X-Received: by 2002:a2e:91da:: with SMTP id u26mr13266818ljg.311.1595952747887; Tue, 28 Jul 2020 09:12:27 -0700 (PDT) From: Mikael Magnusson To: zsh-workers@zsh.org Subject: PATCH: compinit: add -w to explain why compdump runs Date: Tue, 28 Jul 2020 18:12:19 +0200 Message-Id: <20200728161219.14587-1-mikachu@gmail.com> X-Mailer: git-send-email 2.15.1 Sometimes people have trouble with compinit taking a long time, and having them add -w would be a lot faster than doing a bunch of manual checks to see if compdump runs again. --- Completion/compinit | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/Completion/compinit b/Completion/compinit index f0f8421df8..6166d8ae26 100644 --- a/Completion/compinit +++ b/Completion/compinit @@ -71,9 +71,9 @@ emulate -L zsh setopt extendedglob typeset _i_dumpfile _i_files _i_line _i_done _i_dir _i_autodump=1 -typeset _i_tag _i_file _i_addfiles _i_fail=ask _i_check=yes _i_name +typeset _i_tag _i_file _i_addfiles _i_fail=ask _i_check=yes _i_name _i_why -while [[ $# -gt 0 && $1 = -[dDiuC] ]]; do +while [[ $# -gt 0 && $1 = -[dDiuCw] ]]; do case "$1" in -d) _i_autodump=1 @@ -99,6 +99,10 @@ while [[ $# -gt 0 && $1 = -[dDiuC] ]]; do _i_check= shift ;; + -w) + _i_why=1 + shift + ;; esac done @@ -484,11 +488,28 @@ if [[ -f "$_comp_dumpfile" ]]; then then builtin . "$_comp_dumpfile" _i_done=yes + elif [[ _i_why -eq 1 ]]; then + print -nu2 "Loading dump file skipped, regenerating" + local pre=" because: " + if [[ _i_autodump -ne 1 ]]; then + print -nu2 $pre"-D flag given" + pre=", " + fi + if [[ $_i_line[2] -ne $#_i_files ]]; then + print -nu2 $pre"number of files in dump $_i_line[2] differ from files found in \$fpath $#_i_files" + pre=", " + fi + if [[ $ZSH_VERSION != $_i_line[4] ]]; then + print -nu2 $pre"zsh version changed from $_i_line[4] to $ZSH_VERSION" + fi + print -u2 fi else builtin . "$_comp_dumpfile" _i_done=yes fi +elif [[ _i_why -eq 1 ]]; then + print -u2 "No existing compdump file found, regenerating" fi if [[ -z "$_i_done" ]]; then typeset -A _i_test -- 2.15.1