Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: _rcs (was Re: still confused about completion and matching)



On Nov 6, 10:34am, E. Jay Berkenbilt wrote:
} Subject: Re: still confused about completion and matching
} 
} It seems that the changes have still not been committed to the
} repository. Is this because we're still waiting for reactions from
} people who are not using the new patches or because we forgot or for
} some other reason?

I rather suspect it's just because Sven is busy.

} I still haven't had time to write my smbclient completion function.
} I've also added rewriting _rcs to use _arguments to my "eventually"
} list unless someone else gets to it first.  As brought up by another
} user (Vincent Lefevre) the current behavior doesn't handle the more
} subtle aspects of rcs's behavior very well.

Hrm, I was just looking at the current _rcs.  It begins:

    local nm=$compstate[nmatches] cmd="${words[1]:t}" ret=1

    if [[ $compstate[nmatches] -eq nm && -d RCS && $cmd != ci ]]; then

[[ $compstate[nmatches] -eq nm ]] can't possibly be false.  There used to
be a call to _files *before* that test, but it got moved to the end by
users/3472.

I played for a few minutes with ${${((s:/:)words[(r)-x*]:s/-x//}:-,v} but 
concluded I wasn't going to get it right in the time I have to spare.  So
consider that a hint towards your rewrite.

Index: Completion/User/_rcs
===================================================================
@@ -1,8 +1,8 @@
 #compdef co ci rcs

-local nm=$compstate[nmatches] cmd="${words[1]:t}" ret=1
+local cmd="${words[1]:t}" ret=1

-if [[ $compstate[nmatches] -eq nm && -d RCS && $cmd != ci ]]; then
+if [[ -d RCS && $cmd != ci ]]; then
   local rep expl

   rep=(RCS/*,v(:t:s/\,v//))


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



Messages sorted by: Reverse Date, Date, Thread, Author