From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13246 invoked from network); 25 Feb 2000 15:51:32 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 25 Feb 2000 15:51:32 -0000 Received: (qmail 27010 invoked by alias); 25 Feb 2000 15:51:25 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9880 Received: (qmail 27002 invoked from network); 25 Feb 2000 15:51:25 -0000 Date: Fri, 25 Feb 2000 16:51:24 +0100 (MET) Message-Id: <200002251551.QAA26294@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk Subject: PATCH: quiet _path_files Until now, _path_files printed ugly error messages when completing after ~foo/ where ~foo was neither a known user nor a named directory. This makes it display a message, just like _tilde_files. Or should we make them completely quiet? Bye Sven diff -ru ../z.old/Completion/Core/_path_files Completion/Core/_path_files --- ../z.old/Completion/Core/_path_files Fri Feb 25 14:17:21 2000 +++ Completion/Core/_path_files Fri Feb 25 16:47:29 2000 @@ -172,9 +172,19 @@ # prefix from the string to complete, set `donepath' to build the correct # paths and make sure that the loop below is run only once with an empty # prefix path by setting `prepaths'. - - linepath="${pre%%/*}/" - realpath=$~linepath + + linepath="${pre[2,-1]%%/*}" + if [[ -z "$linepath" ]]; then + realpath="${HOME%/}/" + elif (( $+userdirs[$linepath] )); then + realpath="${userdirs[$linepath]%/}/" + elif (( $+nameddirs[$linepath] )); then + realpath="${nameddirs[$linepath]%/}/" + else + _message "unknown user \`$linepath'" + return 1 + fi + linepath="~${linepath}/" [[ "$realpath" = "$linepath" ]] && return 1 pre="${pre#*/}" orig="${orig#*/}" -- Sven Wischnowsky wischnow@informatik.hu-berlin.de