zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: Completion for AUTO_CD
@ 2001-06-21  9:17 Bart Schaefer
  2001-06-21  9:54 ` Peter Stephenson
  2001-06-21 10:22 ` Oliver Kiddle
  0 siblings, 2 replies; 5+ messages in thread
From: Bart Schaefer @ 2001-06-21  9:17 UTC (permalink / raw)
  To: zsh-workers

This should be pretty self-explanatory, except for the fact that it's
named _autocd because _command is pre-empted for the `command' builtin.

There doesn't seem to be a lot of documentation for the context funcs.
Some of them get mentioned in a few places as if people should know that
they exist (e.g. _default in the use-compctl entry) but that's all, so
I didn't document this one either.

May I add this to 4.0.2?

On a semi-related note, why doesn't _command call `_command_names -e'?

Index: Completion/Zsh/Context/_autocd
===================================================================
RCS file: _autocd
diff -N _autocd
--- /dev/null	Tue May  5 13:32:27 1998
+++ Completion/Zsh/Context/_autocd	Thu Jun 21 01:55:18 2001
@@ -0,0 +1,5 @@
+#compdef -command-
+
+_command_names
+local ret=$?
+[[ -o autocd ]] && _cd || return ret
Index: Completion/Zsh/Command/_cd
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-4.0/Completion/Zsh/Command/_cd,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 _cd
--- Completion/Zsh/Command/_cd	2001/04/09 20:14:09	1.1.1.1
+++ Completion/Zsh/Command/_cd	2001/06/21 08:48:03
@@ -24,7 +24,7 @@
   rep=(${${rep#${PWD%%$words[2]*}}%${PWD#*$words[2]}})
   (( $#rep )) && _wanted -C replacement strings expl replacement compadd -a rep
 else
-  _directory_stack && ret=0
+  [[ CURRENT -gt 1 ]] && _directory_stack && ret=0
 
   if [[ $PREFIX != (\~|/|./|../)* && $#cdpath -ne 0 ]]; then
     local tdir tdir2
Index: Completion/Zsh/Type/_command_names
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-4.0/Completion/Zsh/Type/_command_names,v
retrieving revision 1.2
diff -u -r1.2 _command_names
--- Completion/Zsh/Type/_command_names	2001/06/18 18:01:55	1.2
+++ Completion/Zsh/Type/_command_names	2001/06/21 08:54:50
@@ -1,4 +1,4 @@
-#compdef -command-
+#autoload
 
 # The option `-e' if given as the first argument says that we should
 # complete only external commands and executable files. This and a

-- 
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] 5+ messages in thread

end of thread, other threads:[~2001-06-21 10:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-21  9:17 PATCH: Completion for AUTO_CD Bart Schaefer
2001-06-21  9:54 ` Peter Stephenson
2001-06-21 10:22 ` Oliver Kiddle
2001-06-21 10:30   ` Sven Wischnowsky
2001-06-21 10:50     ` 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).