zsh-users
 help / color / mirror / code / Atom feed
* cvs completion / intelligent open
@ 2001-11-19  6:54 Harshad R Joglekar
  2001-11-19 17:30 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Harshad R Joglekar @ 2001-11-19  6:54 UTC (permalink / raw)
  To: zsh-users


[-- Attachment #1.1: Type: text/plain, Size: 641 bytes --]

Hi all,
I have been using zsh for quite some time now, and the completion system
is superb. There are some minor nits though:
"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).

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?

regards,
Harshad

--
Harshad RJ

PS. I am not subsribed to the list, so please cc your replies.

[-- Attachment #1.2: Type: text/html, Size: 757 bytes --]

[-- Attachment #2: InterScan_Disclaimer.txt --]
[-- Type: text/plain, Size: 855 bytes --]

-------------------------------------------------------------------------------------------------------------------------
Information transmitted by this E-MAIL is proprietary to Wipro and/or its Customers and
is intended for use only by the individual or entity to which it is
addressed, and may contain information that is privileged, confidential or
exempt from disclosure under applicable law. If you are not the intended
recipient or it appears that this mail has been forwarded to you without
proper authority, you are notified that any use or dissemination of this
information in any manner is strictly prohibited. In such cases, please
notify us immediately at mailto:mailadmin@wipro.com and delete this mail
from your records.
----------------------------------------------------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: cvs completion / intelligent open
  2001-11-19  6:54 cvs completion / intelligent open Harshad R Joglekar
@ 2001-11-19 17:30 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2001-11-19 17:30 UTC (permalink / raw)
  To: Harshad R Joglekar, zsh-users

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   


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-11-19 17:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-19  6:54 cvs completion / intelligent open Harshad R Joglekar
2001-11-19 17:30 ` Bart Schaefer

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).