Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: _cvs on zsh without dynamic-linking modules.



I found a problem with _cvs on zsh without dynamic-linking modules.

Z:akr@is27e1u11% ../zz/bin/zsh.old -f
is27e1u11% bindkey -e; autoload -U compinit; compinit -D 
is27e1u11% cvs commit <TAB>
_cvs_extract_modifiedfile_entries:2: failed to load module: zsh/stat
is27e1u11% cvs commit 

This patch tries to detect zsh/stat module more carefuly.

Index: Completion/User/_cvs
===================================================================
RCS file: /projects/zsh/zsh/Completion/User/_cvs,v
retrieving revision 1.1.1.24
diff -u -r1.1.1.24 _cvs
--- Completion/User/_cvs	2000/01/09 02:31:55	1.1.1.24
+++ Completion/User/_cvs	2000/01/14 09:06:53
@@ -388,6 +388,15 @@
       '*:file:_cvs_files'
 }
 
+(( $+functions[_cvs_loadstat] )) ||
+_cvs_loadstat () {
+  zstyle -t ":completion${curcontext}:cvs" disable-stat && return
+  (( $+_cvs_loadstat_tried )) && return
+  _cvs_loadstat_tried=yes
+
+  zmodload -i zsh/stat 2>/dev/null
+}
+
 (( $+functions[_cvs_root] )) ||
 _cvs_root () {
   local cvspassfile id
@@ -395,7 +404,8 @@
   typeset -gU _cvs_roots
 
   if [[ -f "${cvspassfile::=${CVS_PASSFILE:-$HOME/.cvspass}}" ]]; then
-    if zmodload -e stat; then
+    _cvs_loadstat
+    if (( $+builtins[stat] )); then
       id="$(LANG=C builtin stat -g +mtime -F '%Y/%m/%d-%T' "$cvspassfile")"
     else
       id="$(LANG=C ls -l "$cvspassfile")"
@@ -508,8 +518,8 @@
 
 (( $+functions[_cvs_extract_modifiedfile_entries] )) ||
 _cvs_extract_modifiedfile_entries () {
-  if zstyle -t ":completion${curcontext}:cvs" disable-stat ||
-     ! { zmodload -e zsh/stat || zmodload zsh/stat }; then
+  _cvs_loadstat
+  if (( ! $+builtins[stat] )); then
     _cvs_extract_file_entries
     return
   fi
-- 
Tanaka Akira



Messages sorted by: Reverse Date, Date, Thread, Author