zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@ibmth.df.unipi.it>
To: gossamer@tertius.net.au, zsh-users@math.gatech.edu
Subject: Re: ytalk completion
Date: Sat, 10 Oct 1998 14:53:29 +0200	[thread overview]
Message-ID: <9810101253.AA14713@ibmth.df.unipi.it> (raw)
In-Reply-To: "Bek Oberin"'s message of "10 Oct 1998 11:33:43 NFT." <slrn71uhgn.lhn.gossamer@dora.tertius.net.au>

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


      reply	other threads:[~1998-10-10 13:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-10 11:33 Bek Oberin
1998-10-10 12:53 ` Peter Stephenson [this message]

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=9810101253.AA14713@ibmth.df.unipi.it \
    --to=pws@ibmth.df.unipi.it \
    --cc=gossamer@tertius.net.au \
    --cc=zsh-users@math.gatech.edu \
    /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).