zsh-users
 help / color / mirror / code / Atom feed
* ytalk completion
@ 1998-10-10 11:33 Bek Oberin
  1998-10-10 12:53 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Bek Oberin @ 1998-10-10 11:33 UTC (permalink / raw)
  To: zsh-users


Okay, I've figured out completion on ssh/telnet/etc. by means
of an array of my favorite hosts.  But how can I do
the same for ytalk?

ie  I type
   ytalk matt@ne<tab>

and it completes the after-the-@-sign bit from the hosts array?

Same for finger, actually.


bekj

-- 
: --Neophilic-Hacker-Grrl-Geek-Eclectic-Gay-Disabled-Boychick--
: gossamer@tertius.net.au  http://www.tertius.net.au/~gossamer/
: There are only two ways to live your life.  One is as though
: nothing is a miracle. The other is as though everything is a
: miracle.  -- Albert Einstein


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ytalk completion
  1998-10-10 11:33 ytalk completion Bek Oberin
@ 1998-10-10 12:53 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 1998-10-10 12:53 UTC (permalink / raw)
  To: gossamer, zsh-users

Bek Oberin wrote:
> 
> Okay, I've figured out completion on ssh/telnet/etc. by means
> of an array of my favorite hosts.  But how can I do
> the same for ytalk?
> 
> ie  I type
>    ytalk matt@ne<tab>
> 
> and it completes the after-the-@-sign bit from the hosts array?

The incantation is

  compctl -s '`users`' -x 'n[1,@]' -k hosts -- ytalk

or something such (whatever array name you've used for the hosts).
This is the canonical use for the 'n[...]' completion, so here's a
patch adding this example to the manual page.  (You need yodl for this
to get through to the installable manual page.)  Hope this doesn't
clash with other manual patches this time.

*** Doc/Zsh/compctl.yo.next	Sun Jan 11 00:28:51 1998
--- Doc/Zsh/compctl.yo	Sat Oct 10 14:48:05 1998
***************
*** 474,480 ****
  including the var(index)th occurrence of this string will not be
  considered part of the completion, but the rest will.  var(index) may
  be negative to count from the end: in most cases, var(index) will be
! 1 or -1.
  )
  item(tt(N[)var(index)tt(,)var(string)tt(])...)(
  Like tt(n) except that the string will be
--- 474,487 ----
  including the var(index)th occurrence of this string will not be
  considered part of the completion, but the rest will.  var(index) may
  be negative to count from the end: in most cases, var(index) will be
! 1 or -1.  For example,
! 
! nofill(tt(compctl -s '`users`' -x 'n[1,@]' -k hosts -- talk))
! 
! will usually complete usernames, but if you insert an tt(@) after the
! name, names from the array var(hosts) (assumed to contain hostnames,
! though you must make the array yourself) will be completed.  Other
! commands such as tt(rcp) can be handled similarly.
  )
  item(tt(N[)var(index)tt(,)var(string)tt(])...)(
  Like tt(n) except that the string will be


-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarotti 2, 56100 Pisa, Italy


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-10-10 13:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-10-10 11:33 ytalk completion Bek Oberin
1998-10-10 12:53 ` Peter Stephenson

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).