From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21737 invoked from network); 19 Nov 2001 17:31:23 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 19 Nov 2001 17:31:23 -0000 Received: (qmail 10382 invoked by alias); 19 Nov 2001 17:31:01 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4483 Received: (qmail 10352 invoked from network); 19 Nov 2001 17:30:55 -0000 From: Bart Schaefer Message-Id: <1011119173018.ZM28041@candle.brasslantern.com> Date: Mon, 19 Nov 2001 17:30:16 +0000 In-Reply-To: <3BF8AC8D.478A8D11@wipro.com> Comments: In reply to Harshad R Joglekar "cvs completion / intelligent open" (Nov 19, 12:24pm) References: <3BF8AC8D.478A8D11@wipro.com> X-Mailer: Z-Mail (5.0.0 30July97) To: Harshad R Joglekar , zsh-users@sunsite.dk Subject: Re: cvs completion / intelligent open MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Nov 19, 12:24pm, Harshad R Joglekar wrote: } } "cvs add" should complete not only files that are not currently in cvs, } but also files that have been locally removed (but not yet committed). These files are included in CVS/Entries in the form /filename/-version/date//tag where the `-' before the version number is what marks them removed. To show these files for "cvs add", the pattern used to set the `omitpats' array, in _cvs_nonentried_files() in Completion/Command/Unix/_cvs, has to be modified to leave out lines matching the above format. I think this should do it: Index: Completion/Unix/Command/_cvs =================================================================== RCS file: /extra/cvsroot/zsh/zsh-4.0/Completion/Unix/Command/_cvs,v retrieving revision 1.7 diff -c -r1.7 _cvs --- Completion/Unix/Command/_cvs 2001/09/05 15:22:29 1.7 +++ Completion/Unix/Command/_cvs 2001/11/19 17:21:31 @@ -959,7 +959,7 @@ realdir=${(e)~linedir} [[ -f "$realdir"CVS/Entries ]] && { omitpats=( - ${${${${(M)${(f)"$(<"$realdir"CVS/Entries)"}:#(D|)/*}#(D|)/}%%/*}//(#m)[][*?()<|^~#\\]/\\$MATCH} + ${${${${(M)${${(f)"$(<"$realdir"CVS/Entries)"}:#/*/-*}:#(D|)/*}#(D|)/}%%/*}//(#m)[][*?()<|^~#\\]/\\$MATCH} $_cvs_ignore_default ${=cvsignore} ) However, I'm not certain it's correct to treat removed files as nonentries in all other cases, so it may really be necessary to create an entire other function for this. Any other zsh-workers have an opinion? (Continue that part of this thread on zsh-workers, please.) } I also want to implement a semantic for opening / editing files, that } is independent of the file type. That is, if I say "open a.html" it } should open my preferred browser, and if I say "edit a.html" it could } open my preferred editor. Is such a function already implemented? Look at Functions/Example/zless for something similar. -- 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