zsh-workers
 help / color / mirror / code / Atom feed
From: Eric Cook <llua@gmx.com>
To: zsh-workers@zsh.org
Subject: [PATCH] compdump: only autoload functions in fpath
Date: Thu, 26 May 2016 10:17:23 -0400	[thread overview]
Message-ID: <1464272243-28784-1-git-send-email-llua@gmx.com> (raw)

When a user uses compdump after helper functions by completers are
defined. compdump will mark those functions for autoloading also.

This was noticed by a user who calls compinit multiple times, atleast once
after .zcompdump was deleted during the session then attempting to use
_vim.

You can reproduce the issue with:
1. vim <tab>
2. rm -f ~/.zcompdump; compinit # compdump executes during this
3. zsh
4. vim <tab>

Since compdump() does have a small mention in zshcompsys(1) about possibly
using it without compinit [1], it should probably be fixed.

[1] which should only be used once.
---
 Completion/compdump | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Completion/compdump b/Completion/compdump
index 068383c..619e39e 100644
--- a/Completion/compdump
+++ b/Completion/compdump
@@ -101,9 +101,9 @@ bindkey |
 print >> $_d_file
 
 
-# Autoloads: look for all functions beginning with `_'.
+# Autoloads: look for all functions in fpath beginning with `_'.
 
-_d_als=(${(o)$(typeset +fm '_*')})
+_d_als=($^fpath/(${(o~j.|.)$(typeset +fm '_*')})(N:t))
 
 # print them out:  about five to a line looks neat
 
-- 
2.6.6


                 reply	other threads:[~2016-05-26 14:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1464272243-28784-1-git-send-email-llua@gmx.com \
    --to=llua@gmx.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).