zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Harshad R Joglekar <harshad.joglekar@wipro.com>, zsh-users@sunsite.dk
Subject: Re: cvs completion / intelligent open
Date: Mon, 19 Nov 2001 17:30:16 +0000	[thread overview]
Message-ID: <1011119173018.ZM28041@candle.brasslantern.com> (raw)
In-Reply-To: <3BF8AC8D.478A8D11@wipro.com>

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   


      reply	other threads:[~2001-11-19 17:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-19  6:54 Harshad R Joglekar
2001-11-19 17:30 ` 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=1011119173018.ZM28041@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=harshad.joglekar@wipro.com \
    --cc=zsh-users@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).