zshrc: introduce variable for the compdump file [Closes: issue1275]
authorErik Bernstein <erik@fscking.org>
Thu, 20 Mar 2014 18:47:11 +0000 (19:47 +0100)
committerFrank Terbeck <ft@grml.org>
Thu, 20 Mar 2014 19:10:48 +0000 (20:10 +0100)
Make the completion dump file location configurable by
setting COMPDUMPFILE.

doc/grmlzshrc.t2t
etc/zsh/zshrc

index f7afc41..f6c62a4 100644 (file)
@@ -105,6 +105,9 @@ Import "/etc/default/locale", if set to zero (default).
 A non zero value causes shell functions to be profiled. The results can be
 obtained with the zprof builtin command (see zshmodules(1) for details).
 
+: **COMPDUMPFILE**
+Specifies the location of the completion dump file. Default: $HOME/.zcompdump.
+
 
 = FEATURE DESCRIPTION =
 This is an in depth description of non-standard features implemented by
index 1af7ed7..d032b3e 100644 (file)
@@ -601,8 +601,9 @@ if is4 ; then
 fi
 
 # completion system
+COMPDUMPFILE=${COMPDUMPFILE:-${ZDOTDIR:-${HOME}}/.zcompdump}
 if zrcautoload compinit ; then
-    compinit || print 'Notice: no compinit available :('
+    compinit -d ${COMPDUMPFILE} || print 'Notice: no compinit available :('
 else
     print 'Notice: no compinit available :('
     function compdef { }