From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: better control for _cd
Date: Fri, 3 Dec 1999 14:13:38 +0100 (MET) [thread overview]
Message-ID: <199912031313.OAA00670@beta.informatik.hu-berlin.de> (raw)
This makes _cd use the tags local-directories and path-directories to
decide if those in the cwd and/or those in $cdpath should be
completed.
I.e. you can put in your _sort_tags:
*::cd:*)
comptry local-directories
comptry path-directories
;;
to first complete only the directories in $PWD and the ones in $cdpath
only if that fails.
Bye
Sven
diff -u -r oldcompletion/Builtins/_cd Completion/Builtins/_cd
--- oldcompletion/Builtins/_cd Fri Dec 3 10:22:05 1999
+++ Completion/Builtins/_cd Fri Dec 3 14:07:02 1999
@@ -33,11 +33,13 @@
# Note we need a tilde because cdablevars also allows user home
# directories, hence we also need nonomatch to suppress error messages.
if [[ -o cdablevars && -n "$PREFIX" && ! -d ${tdir::=${PREFIX%%/*}} &&
- -d ${~tdir2::="~$tdir"} ]]; then
+ -d ${~tdir2::="~$tdir"} ]]; then
PREFIX="~$PREFIX"
_path_files -/
else
- _path_files -W "(. $cdpath)" -/
+ _alternative \
+ 'local-directories:local directories:_path_files -/' \
+ 'path-directories: directories in cdpath:_path_files -W \(${cdpath:#.}\) -/'
fi
else
_path_files -/
diff -u olddoc/Zsh/compsys.yo Doc/Zsh/compsys.yo
--- olddoc/Zsh/compsys.yo Fri Dec 3 10:21:51 1999
+++ Doc/Zsh/compsys.yo Fri Dec 3 14:09:05 1999
@@ -622,6 +622,10 @@
item(tt(keysyms))(
for names of X keysyms
)
+item(tt(local-directories))(
+for names of directories in the current working directory when
+completing for the tt(cd) builtin command
+)
item(tt(libraries))(
for names of system libraries
)
@@ -666,6 +670,10 @@
)
item(tt(parameters))(
for names of parameters
+)
+item(tt(path-directories))(
+for names of directories in directories from the tt(cdpath) array when
+completing for the tt(cd) builtin command
)
item(tt(paths))(
used to look up the values of the tt(expand) and tt(cursor) styles
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~1999-12-03 13:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-12-03 13:13 Sven Wischnowsky [this message]
1999-12-03 15:24 ` Bart Schaefer
1999-12-03 15:34 Sven Wischnowsky
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=199912031313.OAA00670@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.auc.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).