From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20993 invoked from network); 3 Dec 1999 13:14:01 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 3 Dec 1999 13:14:01 -0000 Received: (qmail 2185 invoked by alias); 3 Dec 1999 13:13:40 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8869 Received: (qmail 2178 invoked from network); 3 Dec 1999 13:13:39 -0000 Date: Fri, 3 Dec 1999 14:13:38 +0100 (MET) Message-Id: <199912031313.OAA00670@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk Subject: PATCH: better control for _cd 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