zsh-users
 help / color / mirror / code / Atom feed
* Re: ClearCase version-extended filename completion
@ 2003-03-02 14:05 Hari Rao
  0 siblings, 0 replies; 3+ messages in thread
From: Hari Rao @ 2003-03-02 14:05 UTC (permalink / raw)
  To: zsh-users; +Cc: h_a_r_i_k


> > Version-extended file names in ClearCase (e.g.,
> > "foo.c@@/main/1") complete correctly (Type
"foo.c@@/"
> > and press tab) only while using old-style
completion.
> > No completions are displayed once you activate new
> > style completions by calling "compinit."  I
understand
> > from earlier threads* that this can be fixed by
some
> > changes to the "_files" function, but haven't been
> > able to figure out the changes required.  Has
anyone
> > already done this or can explain to me what needs
to
> > be done?
> 
> This is fixed in the latest 4.1 version (the main
trunk) in the archive.
> 
> The patch was the one below.  I don't know if it
works in 4.0, but
> there's a reasonable chance.  It's had only limited
testing, so any
> feedback is useful.

Thanks a lot.  I use v4.0.2 on Linux/x86 and had to
change the  "VAR+=STHG" line to "VAR=${VAR}STHG", and
similarly for the array, after I patched and it worked
like magic.  The same thing also worked for v4.0.6 on
SunOS/sparc and v4.0.6 on Cygwin_NT-5.0,Win2k/x86. 
Nothing broken so far.

Sorry about the ersatz OS/CPU terminology.

Regards,
harik


________________________________________________________________________
Missed your favourite TV serial last night? Try the new, Yahoo! TV.
       visit http://in.tv.yahoo.com


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

* Re: ClearCase version-extended filename completion
  2003-02-28 12:57 Hari Rao
@ 2003-02-28 14:01 ` Peter Stephenson
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 2003-02-28 14:01 UTC (permalink / raw)
  To: zsh-users

> Version-extended file names in ClearCase (e.g.,
> "foo.c@@/main/1") complete correctly (Type "foo.c@@/"
> and press tab) only while using old-style completion. 
> No completions are displayed once you activate new
> style completions by calling "compinit."  I understand
> from earlier threads* that this can be fixed by some
> changes to the "_files" function, but haven't been
> able to figure out the changes required.  Has anyone
> already done this or can explain to me what needs to
> be done?

This is fixed in the latest 4.1 version (the main trunk) in the archive.

The patch was the one below.  I don't know if it works in 4.0, but
there's a reasonable chance.  It's had only limited testing, so any
feedback is useful.


Index: Completion/Unix/Type/_path_files
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_path_files,v
retrieving revision 1.20
diff -u -r1.20 _path_files
--- Completion/Unix/Type/_path_files	6 Nov 2002 08:03:44 -0000	1.20
+++ Completion/Unix/Type/_path_files	12 Feb 2003 15:05:06 -0000
@@ -343,6 +343,22 @@
     if [[ -n "$PREFIX$SUFFIX" ]]; then
       # See which of them match what's on the line.
 
+      # pws non-canonical hack which seems to work so far...
+      # if we didn't match by globbing, check that there is
+      # something to match by explicit name.  This is for
+      # `clever' filing systems where names pop into existence
+      # when referenced.
+      if (( ! $#tmp1 )); then
+	  for tmp3 in "$tmp2[@]"; do
+	      if [[ -n $tmp3 && $tmp3 != */ ]]; then
+		  tmp3+=/
+	      fi
+	      if [[ -e "$tmp3${(Q)PREFIX}${(Q)SUFFIX}" ]] then
+		  tmp1+=("$tmp3${(Q)PREFIX}${(Q)SUFFIX}")
+	      fi
+	  done
+      fi
+
       if (( ! $#tmp1 )); then
         tmp2=( ${^tmp2}/$PREFIX$SUFFIX )
       elif [[ "$tmp1[1]" = */* ]]; then

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************


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

* ClearCase version-extended filename completion
@ 2003-02-28 12:57 Hari Rao
  2003-02-28 14:01 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Hari Rao @ 2003-02-28 12:57 UTC (permalink / raw)
  To: zsh-users; +Cc: h_a_r_i_k

Hello zsh-users,

Version-extended file names in ClearCase (e.g.,
"foo.c@@/main/1") complete correctly (Type "foo.c@@/"
and press tab) only while using old-style completion. 
No completions are displayed once you activate new
style completions by calling "compinit."  I understand
from earlier threads* that this can be fixed by some
changes to the "_files" function, but haven't been
able to figure out the changes required.  Has anyone
already done this or can explain to me what needs to
be done?

Thanks a lot,
harik  

* http://www.zsh.org/mla/users/2001/msg00678.html, http://www.zsh.org/mla/workers/2000/msg00457.html

________________________________________________________________________
Missed your favourite TV serial last night? Try the new, Yahoo! TV.
       visit http://in.tv.yahoo.com


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

end of thread, other threads:[~2003-03-02 14:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-02 14:05 ClearCase version-extended filename completion Hari Rao
  -- strict thread matches above, loose matches on Subject: below --
2003-02-28 12:57 Hari Rao
2003-02-28 14:01 ` Peter Stephenson

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