Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: how can i get lynx news:<special newsgroup> done?



fk5a005@xxxxxxxxxxxxxxxxxx <fk5a005@xxxxxxxxxxxxxxxxxx> typed:
:i sometimes love to view only a few new mails in a newsgroup.
:then i take my lynx and let it view the newsserver with a special
:newsgroup.
:only the newsgroup should be a variable. because i read many newsgroups.
:lynx news:<variable>
:<variable> should be completed.
:say, i wanted to search for unix in newsgroup-names with the script below:.
:cat ~/..nn/ACTIVE | cut -d  ' ' -f1 | grep $1
:now i want zsh to complete all found unix-newsgroups for me to choose from.
:and then invoke lynx news:<all-unix-newsgroups to choose from>
:anyone here, who has a solution?
:i simply do not get it.
:i think, -P "news:"; should be there with compctl, the rest i am not sure.
:I only think , i need a function which should be completed somehow.

OK, it's been about a week and nobody has answered yet.  Please note that
I'm probably one of the lesser qualified to answer this as there are several
(very quiet or very busy or very lazy) compctl gurus around.  Here's a 
starting point.  Note that I've been lazy and left it to you to tidy it up.
eg.  ``lynx ne<TAB>'' won't work properly because "ne" won't be stripped out
in the second line of getgroups(), so you'll get all matches for ``ne''.

getgroups() {
   local v="$1$2"
   v=${v:s#news:##}
   reply=( $(cut -d' ' -f1 < ~/..nn/ACTIVE | fgrep "$v") )
}

compctl -U -P 'news:' -K getgroups - lynx

-- 
Geoff Wing [gcw@xxxxxxxxx]                         Phone    : +61-3-9818 2977
 Technical Manager: PrimeNet Computer Consultants  Facsimile: +61-3-9818 5155
 Web: <URL:http://primenet.com.au/>                Mobile   : 0412 162 441



Messages sorted by: Reverse Date, Date, Thread, Author