zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: zsh-workers@sunsite.dk
Subject: PATCH: Completion for AUTO_CD
Date: Thu, 21 Jun 2001 09:17:40 +0000	[thread overview]
Message-ID: <1010621091740.ZM1701@candle.brasslantern.com> (raw)

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   


             reply	other threads:[~2001-06-21  9:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-21  9:17 Bart Schaefer [this message]
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

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=1010621091740.ZM1701@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=zsh-workers@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).