zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] compdump: only autoload functions in fpath
@ 2016-05-26 14:17 Eric Cook
  0 siblings, 0 replies; only message in thread
From: Eric Cook @ 2016-05-26 14:17 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-05-26 14:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-26 14:17 [PATCH] compdump: only autoload functions in fpath Eric Cook

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).