From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: zsh-workers@sunsite.dk
Subject: Re: PATCH: Re: cvs completion does not support partial path completion
Date: Fri, 4 May 2001 16:39:54 +0000 [thread overview]
Message-ID: <1010504163954.ZM19303@candle.brasslantern.com> (raw)
In-Reply-To: <1010504051600.ZM18512@candle.brasslantern.com>
On May 4, 5:16am, Bart Schaefer wrote:
} Subject: PATCH: Re: cvs completion does not support partial path completio
}
} The following seems to give the desired behavior for the most part. It
} does partial-path completion as far as possible, then stops leaving the
} trailing file name uncompleted. Press TAB again, and it completes the
} final part by examining the CVS/Entries file as usual.
Here's the patch as I actually plan to commit it. In addition to the
problem with the empty message-part of the _arguments spec, I found that
it didn't complete properly in the middle of a word.
Index: Completion/Unix/Command/_cvs
===================================================================
--- Completion/Unix/Command/_cvs 2001/04/09 20:14:09 1.1.1.1
+++ Completion/Unix/Command/_cvs 2001/05/04 16:33:59
@@ -73,7 +73,7 @@
_arguments -s \
'-k+[keyword]:keyword substitution:_cvs_k' \
'-m+[message]:message:_cvs_m' \
- '*:file:_cvs_files_unmaintained' \
+ '*:added file:_cvs_files_unmaintained' \
}
(( $+functions[_cvs_admin] )) ||
@@ -157,7 +157,7 @@
'(-F)-m+[message]:message:_cvs_m' \
'(-m)-F+[message file]:log message file:_files' \
'-r+[specify revision]:tag:_cvs_revisions' \
- '*:file:_cvs_files_modified'
+ '*:modified file:_cvs_files_modified'
}
(( $+functions[_cvs_diff] )) ||
@@ -434,7 +434,7 @@
'-f[force to remove]' \
'(-R)-l[don'\''t recursive]' \
'(-l)-R[recursive]' \
- '*:file:_cvs_remove_arg'
+ '*:removed file:_cvs_remove_arg'
}
(( $+functions[_cvs_remove_arg] )) ||
@@ -516,7 +516,7 @@
'(-D)-r+[specify revision]:tag:_cvs_revisions' \
'(-r)-D+[specify date]:date:_cvs_D' \
'-j+[merge]:tag:_cvs_revisions' \
- '*-I+[ignore files]:name:_files' \
+ '*-I+[ignore files]:file:_files' \
'*-W+[wrapper specification]:spec:_files' \
'*:file:_cvs_files'
}
@@ -856,7 +856,8 @@
(( $+functions[_cvs_existing_directories] )) ||
_cvs_existing_directories () {
local expl
- _wanted files expl file _path_files -g "*~(*/|)CVS(/)"
+ _wanted directories expl directory _path_files -g "*~(*/|)CVS(/)" ||
+ _cvs_path_prefixes
}
(( $+functions[_cvs_existing_entries] )) ||
@@ -881,7 +882,7 @@
realdir=${(e)~linedir}
[[ -f "$realdir"CVS/Entries ]] &&
[[ -n ${pat::="${(@j:|:)${(@)${(@)${(@)${(@)${(@)${(@M)${(@f)"$(<"$realdir"CVS/Entries)"}:#/*}#/}/\\/[^\\/]#\\///}%/[^/]#/[^/]#}:#${(j:|:)~${${${${(f)"$(LC_ALL=C builtin stat -gn +mtime -F '%a %b %e %T %Y' ${realdir}*(D) 2>/dev/null)"}##*/}/ //}//(#m)[][*?()<|^~#\\]/\\$MATCH}}}%%/*}//(#m)[][*?()<|^~#\\]/\\$MATCH}"} ]] &&
- _wanted files expl file _path_files -g "$pat"
+ _wanted files expl 'modified file' _path_files -g "$pat"
else
_cvs_existing_entries
fi
@@ -945,7 +946,20 @@
${${${${(M)${(f)"$(<"$realdir"CVS/Entries)"}:#(D|)/*}#(D|)/}%%/*}:#${(j:|:)~${files//(#m)[][*?()<|^~#\\]/\\$MATCH}}}
)
compquote files
- _wanted files expl file compadd -Qp "$linedir" -a files
+ _wanted files expl 'removed file' compadd -Qp "$linedir" -a files
+ }
+}
+
+(( $+functions[_cvs_path_prefixes] )) ||
+_cvs_path_prefixes () {
+ local expl match
+ match=()
+ [[ "$PREFIX$SUFFIX" = (#b)(*)(/[^/]#) ]] && {
+ PREFIX="$match[1]"
+ ISUFFIX="$match[2]$ISUFFIX"
+ SUFFIX=''
+ _wanted directories expl directory \
+ _path_files -g "*~($PREFIX|(*/|)CVS)(/)" -S ''
}
}
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
prev parent reply other threads:[~2001-05-04 16:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-26 14:05 Andrej Borsenkow
2001-04-27 12:20 ` Sven Wischnowsky
2001-04-27 13:08 ` Andrej Borsenkow
2001-04-27 13:22 ` Sven Wischnowsky
2001-04-27 17:54 ` Bart Schaefer
2001-04-30 8:17 ` Sven Wischnowsky
2001-04-30 16:56 ` Bart Schaefer
2001-05-01 9:39 ` Tanaka Akira
2001-05-04 5:16 ` PATCH: " Bart Schaefer
2001-05-04 16:26 ` Bart Schaefer
2001-05-07 7:58 ` Sven Wischnowsky
2001-05-07 14:52 ` Bart Schaefer
2001-05-08 8:45 ` Sven Wischnowsky
2001-05-04 16:39 ` Bart Schaefer [this message]
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=1010504163954.ZM19303@candle.brasslantern.com \
--to=schaefer@candle.brasslantern.com \
--cc=zsh-workers@sunsite.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).