zsh-users
 help / color / mirror / code / Atom feed
From: Lloyd Zusman <ljz@asfast.com>
To: zsh-users@sunsite.dk
Subject: Re: Incomplete completion for w3m under 4.1.1
Date: Tue, 21 Oct 2003 14:29:46 -0400	[thread overview]
Message-ID: <m38yne1m1x.fsf@asfast.com> (raw)
In-Reply-To: <19026.1066297547@csr.com> (Peter Stephenson's message of "Thu, 16 Oct 2003 10:45:47 +0100")

[-- Attachment #1: Type: text/plain, Size: 791 bytes --]

Peter Stephenson <pws@csr.com> writes:

> Lloyd Zusman wrote:
>> How can the _w3m completion spec be changed so that both kinds of values
>> can validly be completed for the final argument?
>
> Have a look at the _lynx completer, which deals with this problem using
> _alternative; that's probably the best way since it allows the normal
> tags stuff to work.  That would probably be easiest if the _w3mhistory
> stuff went into a function itself

I very much appreciate this information.  Attached are my altered _w3m
and a new helper function _w3mhist.  I'm pretty new at this, so could
someone evaluate what I came up with?

Also, I could only get this to work if I put "autoload -U _w3mhist" in
my /etc/zshrc, even though the file _w3mhist is in my $fpath.  What am
I missing?

Thanks.


[-- Attachment #2: New _w3m --]
[-- Type: text/plain, Size: 1030 bytes --]

#compdef w3m

local curcontext="$curcontext" state line
typeset -A opt_args

_arguments -C \
  '-t[tabwidth]:tabwidth:' \
  '-r[ignore backspace effect]' \
  '-l[preserved lines]:number of lines:' \
  '-B[load bookmark]' \
  '-bookmark:bookmark file:_files' \
  '-T[content-type]:content type:' \
  '-m[internet message mode]' \
  '-v[visual startup mode]' \
  '-M[monochrome display]' \
  '-F[automatically render frame]' \
  '(-dump_source -dump_head)-dump' \
  '-cols:column width:' \
  '(-dump -dump_head)-dump_source' \
  '(-dump -dump_source)-dump_head' \
  '+:goto line:' \
  '-num[show line number]' \
  '-no-proxy' \
  '-no-mouse' \
  '(-no-cookie)-cookie' \
  '(-cookie)-no-cookie' \
  '-no-graph' \
  '-S[squeeze multiple blank lines]' \
  '-W[toggle wrap search mode]' \
  '-X[do not use termcap init/deinit]' \
  '-o[option]:option-value:' \
  '-config:config file:_files' \
  '-debug' \
  ':url:->html' && return 0

case $state in
	html)
	_alternative 'files:file:_files -g "*.x#html"' 'urls:url:_w3mhist'
	;;

esac

[-- Attachment #3: _w3mhist --]
[-- Type: text/plain, Size: 157 bytes --]

#compdef -default-

local _w3mhistory

if [[ -s ~/.w3m/history ]]; then
   _w3mhistory=(${(f)"$(<$HOME/.w3m/history)"})
   compadd $_w3mhistory
fi

_urls -f

[-- Attachment #4: Type: text/plain, Size: 35 bytes --]


-- 
 Lloyd Zusman
 ljz@asfast.com

  reply	other threads:[~2003-10-21 18:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-15 19:26 Lloyd Zusman
2003-10-16  9:45 ` Peter Stephenson
2003-10-21 18:29   ` Lloyd Zusman [this message]
2003-10-21 21:06     ` Lloyd Zusman
2003-10-17  5:50 ` Zvi Har'El
2003-10-21 18:30   ` Lloyd Zusman

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=m38yne1m1x.fsf@asfast.com \
    --to=ljz@asfast.com \
    --cc=zsh-users@sunsite.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).