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

Re: new completion modifications



> > $hosts=(commonly used hosts)
> > $sshhosts=(hosts I ssh to)
> > $pages=(a list of URLs I visit)
> 
> You certainly mean `hosts=(...)'.  Written too much perl lately ? ;-)

yup, thanks.  I had it right in my .zshrc :)


> > 
> > zstyle ':*' hosts $hosts
> > zstyle ':*' hosts $sshhosts
> 
> The second call overrides the first one.
> 
> > First, which is the magic zstyle for a list of URLs?  It seems that 
> > lynx/netscape use http:/(hosts)/ by default.
> 
> See the description of the `urls' tag and the `path' style in the
> docs.

OK - that put me on the right track, but its still not quite working the 
way I'm used to.  I created the directory tree:

~/.zsh/urls/http/www.myhost.com/directory/file.html

and did:

% zstyle ':completion:*:urls' path $HOME/.zsh/urls/

now to get the whole url, I have to type:

% lynx h<tab>w<tab>d<tab>f<tab>

or just:

% lynx h<tab><tab><tab><tab>

While I can see that this directory structure is useful if you have 
hundreds of URLs, many from the same hosts, it really isn't great for me -
I probably have 5 or 10 URLs that I'd like to complete in this manner, all
unique in the host portion (so I'd like to be able to type enough of the host
to identify the url, and have the whole thing expand on a tab)


> You can't without modifying the function.  But it's *very* simple.  At 
> the beginning of _rlogin you see:

OK, thanks - that works fine.  I didn't want to modify it if I didn't
have to though.

> If you want to help us and others you could try to find a (secure)
> test if the `rlogin' supports kerberos-specific options.  If there is
> such a test we could add it to the distributed _rlogin to make it
> support these commands out-of-the-box.


This seems to work on my system:

% /usr/bin/rlogin -x 2>&1 | egrep '(illegal|invalid) option' > /dev/null && echo kerberized
% /usr/local/bin/rlogin -x 2>&1 | egrep '(illegal|invalid) option' > /dev/null && echo kerberized
kerberized
%

/usr/bin/rlogin is the stock FreeBSD rlogin, /usr/local/bin/rlogin is from  
the kerberos distribution (1.2.1, I believe)  I also tested it on a linux
system (with no kerberos).

Not sure how to integrate this.


I've got one more question - hopefully not too basic :)

I use nmh/exmh for email - the new completion system is wonderful.  It just 
works, I can get rid of literally 200 lines of functions and compctl's.   I 
have one small problem though - mutt can read mh folders, and occasionally 
I use it to quickly read through a folder.  Is there an easy way (using
zstyle) to tell mutt to use mh folder completions after -f?  If not, any
hints on how to modify _mutt to use mh folders?  It seems that _mutt's 
-f flag uses _mailboxes to complete, and _mailboxes doesn't know about
mh folders.

Thanks very much,

Scott



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