Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: _urls again (Re: setopt localoptions noautoremoveslash)
- X-seq: zsh-workers 8276
- From: Oliver Kiddle <opk@xxxxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxxxxxxxxx>
- Subject: PATCH: _urls again (Re: setopt localoptions noautoremoveslash)
- Date: Fri, 15 Oct 1999 12:24:32 +0100
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <E11boTW-0002tB-00@xxxxxxxxxxxxxxxxxx> <rsq6709lsr0.fsf@xxxxxxxxxxxxxxxxx>
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/~<tab> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author