zsh-users
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@brasslantern.com>
To: GoTaR <gotar@poczta.onet.pl>
Cc: zsh-users@sunsite.dk
Subject: Re: completions issues
Date: Sun, 14 Jul 2002 21:09:16 +0000	[thread overview]
Message-ID: <1020714210916.ZM15050@candle.brasslantern.com> (raw)
In-Reply-To: <20020714105554.GC824@os>

On Jul 14, 12:55pm, GoTaR wrote:
} Subject: Re: completions issues
}
} On Sat, Jul 13, 2002 at 21:20:37 +0000, Bart Schaefer wrote:
} 
} > } And question: how to make it without perl?
} > 
} >     smsas=( ${(f)$(smsaddr -l)} )
} 
} Here is the first trap - ${(f)... will change double tab to space

That has nothing to do with ${(f)...}.  It's just that I lost the double
quotes somehow when typing my reply:

	smsas=( ${(f)"$(smsaddr -l)"} )

Elsewhere, you wrote:

} No no no, adding both will cause showing them _all_ when completion
} without any prefix - and I don't want doubled entries like this:
} 
} gotar:~: smsaddr -l [tab]
} SMS alias
} rtrzepla -- 692xxx
} 692xxx   -- rtrzepla

Getting a little demanding, aren't we?

Anyway, just add the inverted pairs only when the word on the line is
non-empty, and then let completion deal with it from there.

  _sms_aliases () {
    smsas=( ${(f)"$(smsaddr -l)"} )
    smsas=( ${smsas/		/:} )
    if [[ -n "$PREFIX$SUFFIX" ]]; then
      smsas=( ${smsas/(#s)(#b)(*)		(*)(#e)/$match[2]:$match[1]} )
    fi
    _describe "SMS alias" smsas
  }


-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


  reply	other threads:[~2002-07-14 21:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-10 20:47 GoTaR
2002-07-12 18:44 ` Borsenkow Andrej
2002-07-13 19:37   ` GoTaR
2002-07-13 21:20     ` Bart Schaefer
2002-07-14 10:55       ` GoTaR
2002-07-14 21:09         ` Bart Schaefer [this message]
2002-07-14  8:57     ` Borsenkow Andrej
2002-07-14 10:49       ` GoTaR

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=1020714210916.ZM15050@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=gotar@poczta.onet.pl \
    --cc=zsh-users@sunsite.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).