zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@u.genie.co.uk>
To: Zsh workers <zsh-workers@sunsite.auc.dk>
Subject: PATCH: _urls again (Re: setopt localoptions noautoremoveslash)
Date: Fri, 15 Oct 1999 12:24:32 +0100	[thread overview]
Message-ID: <38070EF0.BD3C2469@u.genie.co.uk> (raw)
In-Reply-To: <rsq6709lsr0.fsf@crane.jaist.ac.jp>

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


  reply	other threads:[~1999-10-15 11:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-14 17:09 setopt localoptions noautoremoveslash Tanaka Akira
1999-10-14 17:15 ` Zefram
1999-10-14 18:08   ` Tanaka Akira
1999-10-15 11:24     ` Oliver Kiddle [this message]
1999-10-15 14:36       ` PATCH: _urls again (Re: setopt localoptions noautoremoveslash) Tanaka Akira
1999-10-15  3:15   ` setopt localoptions noautoremoveslash Wayne Davison
1999-10-15 12:10 PATCH: _urls again (Re: setopt localoptions noautoremoveslash) Sven Wischnowsky
1999-10-15 15:30 ` Oliver Kiddle
     [not found]   ` <991015155008.ZM24081@candle.brasslantern.com>
1999-10-15 16:05     ` Oliver Kiddle
1999-10-15 16:40       ` Bart Schaefer
1999-10-16 13:56   ` Tanaka Akira
1999-10-18  9:41 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=38070EF0.BD3C2469@u.genie.co.uk \
    --to=opk@u.genie.co.uk \
    --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).