From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23359 invoked from network); 15 Oct 1999 11:25:49 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 15 Oct 1999 11:25:49 -0000 Received: (qmail 16607 invoked by alias); 15 Oct 1999 11:25:37 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8276 Received: (qmail 16493 invoked from network); 15 Oct 1999 11:24:53 -0000 Message-ID: <38070EF0.BD3C2469@u.genie.co.uk> Date: Fri, 15 Oct 1999 12:24:32 +0100 From: Oliver Kiddle X-Mailer: Mozilla 4.7 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 To: Zsh workers Subject: PATCH: _urls again (Re: setopt localoptions noautoremoveslash) References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Tanaka Akira wrote: > > I see. I modifed _urls to call _path_files twice: for directories > and other files. This is also applicable for the file url. Also, another slash is the one character which should remove the auto-inserted slash. One strange behaviour I find with completing urls is that with urls_localhttpd set, when I complete user directories, menu selection is entered imediately rather than waiting for a second tab: e.g: netscape http://risc10/~ will insert 'ada' and give me the list with 'ada' selected rather than just giving me the list. This behaviour continues when completing files and directories after the username. I've also noticed that with this dual file/directory completion and description_format set, I get 'file' aswell as 'directory' at the top of the list even if there were no files to complete. Oliver Kiddle --- Completion/Users/_urls.ta Fri Oct 15 11:21:05 1999 +++ Completion/Users/_urls Fri Oct 15 12:12:45 1999 @@ -70,11 +70,13 @@ file) if ! compset -P //; then if [ -prefix / ]; then - _files "$@" + _path_files "$@" -S '' -g '*(^/)' && ret=0 + _path_files "$@" -S/ -r '/' -/ && ret=0 elif [ ! "$PREFIX" ]; then - compadd -S '/' - "${PWD%/}" + compadd -S '/' -r '/' - "${PWD%/}" + ret=0 fi - return + return $ret fi ;; bookmark) @@ -84,7 +86,7 @@ else _description expl 'bookmark' _path_files -W "$urls_path/$scheme" "$expl[@]" -S '' -g '*(^/)' && ret=0 - _path_files -W "$urls_path/$scheme" -S/ -r '' -/ && ret=0 + _path_files -W "$urls_path/$scheme" -S/ -r '/' -/ && ret=0 fi return $ret ;; @@ -94,8 +96,7 @@ if ! [[ -prefix */* ]]; then dirs=($urls_path/$scheme/$PREFIX*$SUFFIX(/:t)) (( $#dirs )) || _hosts -S/ && ret=0 - [ "$scheme" = "http" ] && - dirs=($dirs $localhttp_servername) + [ "$scheme" = "http" ] && dirs=($dirs $localhttp_servername) compadd "$@" -QS/ - $dirs && ret=0 return $ret fi @@ -103,23 +104,23 @@ # Complete part after hostname host=${PREFIX%%/*} compset -P "$host/" -if [[ "$compconfig[urls_localhttp]" = ${host}:* ]]; then +if [[ "$localhttp_servername" = $host ]]; then if [[ -prefix \~ ]]; then compset -P \~ if [[ -prefix */* ]]; then user=${PREFIX%%/*} compset -P $user/ _path_files -W ~$user/$localhttp_userdir -g '*(^/)' && ret=0 - _path_files -W ~$user/$localhttp_userdir -S/ -r '' -/ && ret=0 + _path_files -W ~$user/$localhttp_userdir -S/ -r '/' -/ && ret=0 else _users -S/ && ret=0 fi else _path_files -W $localhttp_documentroot -g '*(^/)' && ret=0 - _path_files -W $localhttp_documentroot -S/ -r '' -/ && ret=0 + _path_files -W $localhttp_documentroot -S/ -r '/' -/ && ret=0 fi else _path_files -W $urls_path/$scheme/$host/ -g '*(^/)' && ret=0 - _path_files -W $urls_path/$scheme/$host/ -S/ -r '' -/ && ret=0 + _path_files -W $urls_path/$scheme/$host/ -S/ -r '/' -/ && ret=0 fi return $ret