zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@ibmth.df.unipi.it>
To: zsh-workers@sunsite.auc.dk (Zsh hackers list)
Subject: Re: pws-23
Date: Mon, 21 Jun 1999 09:15:45 +0200	[thread overview]
Message-ID: <9906210715.AA16384@ibmth.df.unipi.it> (raw)
In-Reply-To: ""Bart Schaefer""'s message of "Sun, 20 Jun 1999 17:15:53 DFT." <990620171553.ZM14680@candle.brasslantern.com>

"Bart Schaefer" wrote:
> There seems to be a problem in this tar file with Completion/Base/_first --
> to wit, it's a fragment of Completion/Base/_subscript, and the entire
> previous contents of _first (which was nothing but a long comment) have
> disappeared.

Somehow applying a patch has done for it.  This is how I think it should
look after 6685.


#compdef -first-

# This function is called at the very beginning before any other
# function for a specific context.
#
# This just gives some examples of things you might want to do here.
#
#
# If you use the vared builtin and want completion in there to act the 
# way completion on the right hand side of assignments is done, add
# (or un-comment) this code:
#
#     if [[ -n $compstate[vared] ]]; then
#       if [[ $compstate[vared] = *\[* ]]; then
#         # vared on an array-element
#         compstate[parameter]=${compstate[vared]%%\[*}
#         compstate[context]=value
#       else
#         # vared on a parameter, let's see if it is an array
#         compstate[parameter]=$compstate[vared]
#         if [[ ${(tP)compstate[vared]} = *(array|assoc)* ]]; then
#           compstate[context]=array_value
#         else
#           compstate[context]=value
#         fi
#       fi
#       return
#     fi
#
#
#
# Other things you can do here is to complete different things if the
# word on the line matches a certain pattern. This example allows
# completion of words from the history by adding two commas at the end 
# and hitting TAB.
#
#     if [[ "$PREFIX" = *,, ]]; then
#       local max i=1
#     
#       PREFIX="$PREFIX[1,-2]"
#       # If a numeric prefix is given, we use it as the number of
#       # lines (multiplied by ten below) in the history to search.
#       if [[ ${NUMERIC:-1} -gt 1 ]]; then
#         max=$NUMERIC
#         unset NUMERIC
#       else
#         # The default is to search the last 100 lines.
#         max=10
#       fi
#       # We first search in the last ten lines, then in the last
#       # twenty lines, and so on...
#       while [[ i -le max ]]; do
#         if compgen -X "%Bhistory ($n):%b" -Q -H $(( i*10 )) ''; then
#           # We have found at least one matching word, so we switch
#           # on menu-completion and make sure that no other
#           # completion function is called by setting _comp_skip.
#           compstate[insert]=menu
#           _comp_skip=1
#           return
#         fi
#         (( i++ ))
#       done
#     fi

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


  reply	other threads:[~1999-06-21  7:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-20 15:28 pws-23 Peter Stephenson
1999-06-20 17:15 ` pws-23 Bart Schaefer
1999-06-21  7:15   ` Peter Stephenson [this message]
1999-06-20 17:28 ` PATCH: Spelling error (Re: pws-23) Bart Schaefer
1999-06-20 18:16 ` PATCH: Omissions " Bart Schaefer

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=9906210715.AA16384@ibmth.df.unipi.it \
    --to=pws@ibmth.df.unipi.it \
    --cc=zsh-workers@sunsite.auc.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).