zsh-workers
 help / color / mirror / code / Atom feed
From: Tanaka Akira <akr@jaist.ac.jp>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: _cvs update.
Date: 30 Jul 1999 05:45:02 +0900	[thread overview]
Message-ID: <rsqlnbzb2y9.fsf@crane.jaist.ac.jp> (raw)

This is _cvs update.

* more cvsignores for _cvsaddp.
* _cvsaddp tries completion without cvsignores if there is no
  completion candidates.
* cvs_roots is renamed to _cvs_roots and the definition is moved to
  toplevel.  Also, its definition is now external command free.
* some code beautification.

--- Completion/User/_cvs-	Thu Jul 29 03:00:57 1999
+++ Completion/User/_cvs	Fri Jul 30 05:31:49 1999
@@ -142,23 +142,12 @@
     return
   fi
 
-  case ${+cvs_roots} in
-    0)
-      cvs_roots=()
-      if [[ -f ~/.cvspass ]]; then
-	cvs_roots=(
-	  $(cut -d ' ' -f 1 ~/.cvspass)
-	)
-      fi
-      ;;
-  esac
-
   _complete_opts \
     H '' Q '' q '' r '' w '' l '' n '' t '' v '' f '' a '' \
     b: "compadd /usr/local/bin" \
     T: "compadd $TMPPREFIX:h $TMPDIR /tmp" \
     e: "compadd vi" \
-    d: "compadd $cvs_roots || _files -/" \
+    d: "compadd $_cvs_roots || _files -/" \
     z: "compadd 9'" \
     s: "_cvs_user_variable" \
    || 
@@ -198,7 +187,7 @@
 _cvsdirentries () {
   setopt localoptions nullglob unset
   if [[ -f ${pref}CVS/Entries ]]; then
-    entries=( ${${${(M)${(f)"$(<${pref}CVS/Entries)"}:#D/*}#D/}%%/*} )
+    entries=(${${${(M)${(f)"$(<${pref}CVS/Entries)"}:#D/*}#D/}%%/*})
   else
     entries=()
   fi
@@ -207,7 +196,7 @@
 _cvsentries () {
   setopt localoptions nullglob unset
   if [[ -f ${pref}CVS/Entries ]]; then
-    entries=( ${${${${(f)"$(<${pref}CVS/Entries)"}:#D}#(D|)/}%%/*} )
+    entries=(${${${${(f)"$(<${pref}CVS/Entries)"}:#D}#(D|)/}%%/*})
   else
     entries=()
   fi
@@ -233,8 +222,8 @@
   local LANG=C
   local OLDTZ="$TZ"; if ! (( $+TZ )); then unset OLDTZ; fi; export TZ=GMT
 
-  mtime=( ${(s:/:)${(j:/:)${${${${(M)${(f)Entries}:#/*}#/}%/*/*}/\\/*\\///}}} )
-  entries=( ${${${(M)${(f)Entries}:#D/*}#D/}%%/*} )
+  mtime=(${(s:/:)${(j:/:)${${${${(M)${(f)Entries}:#/*}#/}%/*/*}/\\/*\\///}}})
+  entries=(${${${(M)${(f)Entries}:#D/*}#D/}%%/*})
   builtin stat -n +mtime -F '%a %b %e %T %Y' "$pref${(@k)^mtime}" |
   while read line
   do
@@ -297,8 +286,8 @@
     _cvsentries
     setopt localoptions unset
     local omit
-    omit=( ${pref}*(D:t) )
-    eval 'entries=( ${entries:#('${(j:|:)omit:q}')} )'
+    omit=(${pref}*(D:t))
+    eval 'entries=(${entries:#('${(j:|:)omit:q}')})'
     compadd -P "$qpref" - ${entries:q} ||
     _cvsdirs
   else
@@ -313,14 +302,32 @@
     _cvsentries
     setopt localoptions unset
     local omit
-    omit=( CVS ${entries:q} ${=cvsignore} )
-    [[ -r ~/.cvsignore ]] && omit=( $omit $(<~/.cvsignore) )
-    [[ -r ${pref}.cvsignore ]] && omit=( $omit $(<${pref}.cvsignore) )
+    omit=($_cvs_ignore_default ${entries:q} ${=cvsignore})
+    [[ -r ~/.cvsignore ]] && omit=($omit $(<~/.cvsignore))
+    [[ -r ${pref}.cvsignore ]] && omit=($omit $(<${pref}.cvsignore))
     compgen -g '*~(*/|)('${(j:|:)omit}')(D)' ||
-    { _cvsdirentries; compgen -g '('${(j:|:)entries:q}')(D)' }
+    compgen -g '*~(*/|)('${(j:|:)entries:q}')(D)' ||
+    _cvsdirs
   else
     _files
   fi
 }
+
+if (( ! $+_cvs_ignore_default )); then
+  _cvs_ignore_default=(
+    RCS SCCS CVS CVS.adm RCSLOG 'cvslog.*' tags TAGS .make.state .nse_depinfo
+    '*\~' '\#*' '.\#*' ',*' '_$*' '*$' '*.old' '*.bak' '*.BAK' '*.orig' '*.rej'
+    '.del-*' '*.a' '*.olb' '*.o' '*.obj' '*.so' '*.exe' '*.Z' '*.elc' '*.ln'
+    core
+  )
+fi
+
+if (( ! $+_cvs_roots )); then
+  if [[ -f ~/.cvspass ]]; then
+    _cvs_roots=(${${(f)"$(<~/.cvspass)"}%% *})
+  else
+    _cvs_roots=()
+  fi
+fi
 
 _cvs "$@"
-- 
Tanaka Akira


             reply	other threads:[~1999-07-29 20:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-29 20:45 Tanaka Akira [this message]
1999-08-13 15:22 Tanaka Akira
2000-01-09  2:23 Tanaka Akira

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=rsqlnbzb2y9.fsf@crane.jaist.ac.jp \
    --to=akr@jaist.ac.jp \
    --cc=zsh-workers@sunsite.auc.dk \
    /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).