zsh-workers
 help / color / mirror / code / Atom feed
From: Tanaka Akira <akr@jaist.ac.jp>
To: zsh-workers@sunsite.auc.dk
Subject: Re: CVS completer (Re: PATCH: Re: Completion/User functions again)
Date: 26 Jul 1999 13:48:53 +0900	[thread overview]
Message-ID: <rsqpv1g2eyy.fsf@crane.jaist.ac.jp> (raw)
In-Reply-To: Tanaka Akira's message of "25 Jul 1999 18:23:00 +0900"

In article <rsqvhb9ulqj.fsf@crane.jaist.ac.jp>,
  Tanaka Akira <akr@jaist.ac.jp> writes:

> Most of codes to handle CVS/* are taken from Misc/compctl-examples.

This refines it.

--- Completion/User/_cvsaddp-	Mon Jul 26 13:43:26 1999
+++ Completion/User/_cvsaddp	Mon Jul 26 13:43:42 1999
@@ -5,8 +5,9 @@
 _cvsentries
 setopt localoptions unset
 local all omit
-all=( ${pref}*(D) )
-omit=( $entries ${pref}${^${=cvsignore}} )
-[[ -r ~/.cvsignore ]] && omit=( $omit ${pref}${^$(<~/.cvsignore)} )
-[[ -r ${pref}.cvsignore ]] && omit=( $omit ${pref}${^$(<${pref}.cvsignore)} )
-eval 'compadd - ${all:#('${(j:|:)omit}')}' 
+all=( ${pref}*~${pref}CVS(D:t) )
+omit=( $entries ${=cvsignore} )
+[[ -r ~/.cvsignore ]] && omit=( $omit $(<~/.cvsignore) )
+[[ -r ${pref}.cvsignore ]] && omit=( $omit $(<${pref}.cvsignore) )
+eval 'compadd -fp "$pref" - ${all:#('${(j:|:)omit}')}' ||
+  compadd -fp "$pref" - ${pref}*~${pref}CVS(/:t)
--- Completion/User/_cvsentries-	Mon Jul 26 13:43:26 1999
+++ Completion/User/_cvsentries	Mon Jul 26 13:43:42 1999
@@ -2,6 +2,6 @@
 
 setopt localoptions nullglob unset
 if [[ -f ${pref}CVS/Entries ]]; then
-    entries=( "${pref}${(@)^${(@)${(@)${(f@)$(<${pref}CVS/Entries)}:#D*}#/}%%/*}" )
+    entries=( "${(@)${(@)${(@)${(f@)$(<${pref}CVS/Entries)}:#D}#(D|)/}%%/*}" )
 fi
 
--- Completion/User/_cvsprefix-	Mon Jul 26 13:43:27 1999
+++ Completion/User/_cvsprefix	Mon Jul 26 13:43:42 1999
@@ -2,10 +2,15 @@
 
 local f
 pref=$PREFIX
-if [[ -d $pref:h && ! -d $pref ]]; then
+if [[ $pref != */ ]]; then
+  if [[ $pref = */* ]]; then
     pref=$pref:h
-elif [[ $pref != */* ]]; then
+  else
     pref=
+  fi
+fi
+if [[ ! -d "$pref" ]]; then
+  pref=
 fi
 [[ -n "$pref" && "$pref" != */ ]] && pref=$pref/
 
--- Completion/User/_cvsremovep-	Mon Jul 26 13:43:27 1999
+++ Completion/User/_cvsremovep	Mon Jul 26 13:43:42 1999
@@ -5,5 +5,7 @@
 _cvsentries
 setopt localoptions unset
 local omit
-omit=( ${pref}*(D) )
-eval 'compadd - ${entries:#('${(j:|:)omit}')}'
+omit=( ${pref}*(D:t) )
+eval 'compadd -fp "$pref" - ${entries:#('${(j:|:)omit}')}' ||
+  compadd -fp "$pref" - ${pref}*~${pref}CVS(/:t)
+
--- Completion/User/_cvstargets-	Mon Jul 26 13:43:27 1999
+++ Completion/User/_cvstargets	Mon Jul 26 13:43:42 1999
@@ -4,6 +4,4 @@
 _cvsprefix
 _cvsentries
 
-compadd - $entries
-
-compgen -g "^CVS(/)"
+compadd -fp "$pref" - $entries

-- 
Tanaka Akira


  parent reply	other threads:[~1999-07-26  4:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-21 11:27 Sven Wischnowsky
1999-07-21 12:35 ` Tanaka Akira
1999-07-21 15:43   ` Tanaka Akira
1999-07-21 15:54 ` Bart Schaefer
1999-07-25  9:23   ` Tanaka Akira
1999-07-25 11:38     ` Tanaka Akira
1999-07-26  4:48     ` Tanaka Akira [this message]
1999-07-26 16:26       ` Tanaka Akira
1999-07-26 17:10         ` Tanaka Akira
1999-07-27  7:48           ` PATCH: " Bart Schaefer
1999-07-27  8:12             ` Peter Stephenson
1999-07-27 10:07             ` Tanaka Akira
1999-07-27 11:45               ` Tanaka Akira
1999-07-27 13:49                 ` Bart Schaefer
1999-07-27 13:58                   ` Tanaka Akira
1999-07-27 14:11                     ` Tanaka Akira
1999-07-28 16:05                       ` Tanaka Akira
1999-07-27  8:15           ` Peter Stephenson
1999-07-27  8:58             ` Tanaka Akira
  -- strict thread matches above, loose matches on Subject: below --
1999-07-22  6:43 Sven Wischnowsky
1999-07-14 12:46 PATCH: Re: Completion/User functions again Sven Wischnowsky
1999-07-14 13:12 ` Tanaka Akira
1999-07-20 18:05   ` CVS completer (Re: PATCH: Re: Completion/User functions again) Bart Schaefer
1999-07-26  0:52     ` 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=rsqpv1g2eyy.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).