zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: _cvs on zsh without dynamic-linking modules.
@ 2000-01-14  9:13 Tanaka Akira
  0 siblings, 0 replies; only message in thread
From: Tanaka Akira @ 2000-01-14  9:13 UTC (permalink / raw)
  To: zsh-workers

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


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

only message in thread, other threads:[~2000-01-14  9:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-14  9:13 PATCH: _cvs on zsh without dynamic-linking modules Tanaka Akira

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