From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8152 invoked from network); 3 Sep 1999 07:56:45 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 3 Sep 1999 07:56:45 -0000 Received: (qmail 25480 invoked by alias); 3 Sep 1999 07:56:30 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7635 Received: (qmail 25472 invoked from network); 3 Sep 1999 07:56:29 -0000 Date: Fri, 3 Sep 1999 09:56:28 +0200 (MET DST) Message-Id: <199909030756.JAA03752@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Tanaka Akira's message of 03 Sep 1999 03:23:01 +0900 Subject: Re: PATCH: _lynx and _urls. Tanaka Akira wrote: > This is completion function for lynx. I hope you don't mind if I change the name of the configuration key to `urls_dir' -- no other key starts with an underscore. `_lynx' looks like a candidate for the support for state transitions I plan to add to `_arguments'. I hope I'll find the time at the weekend so that we can compare the different forms. Bye Sven diff -u Completion.old/User/_urls Completion/User/_urls --- Completion.old/User/_urls Fri Sep 3 09:22:43 1999 +++ Completion/User/_urls Fri Sep 3 09:53:37 1999 @@ -3,24 +3,27 @@ # Usage: _urls [-f] # Options: # -f : complete files. - -# To complete URLs, you must make a URL database locally such as: # -# % cd ~/.zsh/urls -# % find . -ls -# ... drwxr-xr-x ... 512 Sep 3 02:46 . -# ... drwxr-xr-x ... 512 Sep 3 02:48 ./http -# ... drwxr-xr-x ... 512 Sep 3 02:52 ./http/www.zsh.org -# ... drwxr-xr-x ... 512 Sep 3 03:01 ./http/www.zsh.org/mla -# ... drwxr-xr-x ... 512 Sep 3 03:01 ./http/www.zsh.org/mla/workers -# ... drwxr-xr-x ... 512 Sep 3 03:01 ./http/www.zsh.org/mla/workers/1999 -# ... -rw-r--r-- ... 0 Sep 3 03:01 ./http/www.zsh.org/mla/workers/1999/index.html -# ... drwxr-xr-x ... 512 Sep 3 02:48 ./http/sunsite.auc.dk -# ... drwxr-xr-x ... 512 Sep 3 02:48 ./http/sunsite.auc.dk/zsh -# ... drwxr-xr-x ... 512 Sep 3 02:47 ./bookmark -# ... drwxr-xr-x ... 512 Sep 3 02:48 ./bookmark/zsh -# ... -rw-r--r-- ... 27 Sep 3 02:47 ./bookmark/zsh/home -# ... -rw-r--r-- ... 20 Sep 3 02:48 ./bookmark/zsh/meta +# Configuration key used: +# +# urls_dir +# The path to a directory containing a URL database, such as: +# +# % cd ~/.zsh/urls +# % find . -ls +# ... drwxr-xr-x ... 512 Sep 3 02:46 . +# ... drwxr-xr-x ... 512 Sep 3 02:48 ./http +# ... drwxr-xr-x ... 512 Sep 3 02:52 ./http/www.zsh.org +# ... drwxr-xr-x ... 512 Sep 3 03:01 ./http/www.zsh.org/mla +# ... drwxr-xr-x ... 512 Sep 3 03:01 ./http/www.zsh.org/mla/workers +# ... drwxr-xr-x ... 512 Sep 3 03:01 ./http/www.zsh.org/mla/workers/1999 +# ... -rw-r--r-- ... 0 Sep 3 03:01 ./http/www.zsh.org/mla/workers/1999/index.html +# ... drwxr-xr-x ... 512 Sep 3 02:48 ./http/sunsite.auc.dk +# ... drwxr-xr-x ... 512 Sep 3 02:48 ./http/sunsite.auc.dk/zsh +# ... drwxr-xr-x ... 512 Sep 3 02:47 ./bookmark +# ... drwxr-xr-x ... 512 Sep 3 02:48 ./bookmark/zsh +# ... -rw-r--r-- ... 27 Sep 3 02:47 ./bookmark/zsh/home +# ... -rw-r--r-- ... 20 Sep 3 02:48 ./bookmark/zsh/meta local ipre scheme dirs files @@ -29,8 +32,8 @@ _files "$@" && return fi -if [[ -z "$compconfig[_urls_dir]" ]]; then - compconfig[_urls_dir]=${ZDOTDIR:-$HOME}/.zsh/urls +if [[ -z "$compconfig[urls_dir]" ]]; then + compconfig[urls_dir]=${ZDOTDIR:-$HOME}/.zsh/urls fi ipre="$IPREFIX" @@ -49,12 +52,12 @@ esac if [[ "$scheme" = bookmark && - -f "$compconfig[_urls_dir]/$scheme/$PREFIX$SUFFIX" && - -s "$compconfig[_urls_dir]/$scheme/$PREFIX$SUFFIX" ]]; then - compadd "$@" -QU -- "$ipre$(<"$compconfig[_urls_dir]/$scheme/$PREFIX$SUFFIX")" + -f "$compconfig[urls_dir]/$scheme/$PREFIX$SUFFIX" && + -s "$compconfig[urls_dir]/$scheme/$PREFIX$SUFFIX" ]]; then + compadd "$@" -QU -- "$ipre$(<"$compconfig[urls_dir]/$scheme/$PREFIX$SUFFIX")" else - dirs=($compconfig[_urls_dir]/$scheme/$PREFIX*$SUFFIX(/:t)) - files=($compconfig[_urls_dir]/$scheme/$PREFIX*$SUFFIX(.:t)) + dirs=($compconfig[urls_dir]/$scheme/$PREFIX*$SUFFIX(/:t)) + files=($compconfig[urls_dir]/$scheme/$PREFIX*$SUFFIX(.:t)) compset -P '*/' compadd "$@" -Q -S '/' - $dirs if [[ "$scheme" = bookmark ]]; then -- Sven Wischnowsky wischnow@informatik.hu-berlin.de