zsh-users
 help / color / mirror / code / Atom feed
From: Andy Spiegl <zsh.Andy@spiegl.de>
To: zsh-users@sunsite.dk
Subject: Re: which completion function are used for aliases?
Date: Sun, 26 Mar 2006 21:20:54 +0200	[thread overview]
Message-ID: <20060326192054.GA27247@spiegl.de> (raw)
In-Reply-To: <060325103101.ZM21832@torch.brasslantern.com>

Hi Bart,

> Try "unsetopt complete_aliases".
Aaah, interesting!  I guess I added this option a long time ago
and had forgotten about it, but the name of the option really is
a bit confusing. :-)

Now, is it also possible to make zsh "know" the options of the alias,
so that I don't have to hardcode the aliases in my completion function?

But how can I get the details of the defined aliases???

Right now, my completion function uses this code:
---------------
local dir=${words[(r)--dir=*]##--dir=}
if [[ -z $dir ]]; then
  integer dirind=${words[(i)--dir]}
  if (( dirind )); then
    dir=$words[dirind+1]
  fi
fi

# Default directories (depending on which alias is used)
if [[ -z $dir ]]; then
  if [[ $words[1] = gigaset2 ]]; then
    dir="/home/spiegl/movies/gigaset/PVR/"
  elif [[ $words[1] = gigaset3 ]]; then
    dir="/data2/movies/gigaset/PVR/"
  elif [[ $words[1] = gigaset-ext ]]; then
    dir="/extern-dos/Video/"
  else
    dir="/data/movies/gigaset/PVR/"
  fi
fi
--------------

Thx,
 Andy.

PS:
 gigaset2='gigaset --dir /home/spiegl/movies/gigaset/PVR'
 gigaset3='gigaset --dir /data2/movies/gigaset/PVR'
 gigaset-ext='gigaset --dir /extern-dos/Video'

-- 
 New Windows XP error message:
   "File not found. Should I fake it? (Y/N)"


  reply	other threads:[~2006-03-26 19:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-25  0:08 Andy Spiegl
2006-03-25 18:31 ` Bart Schaefer
2006-03-26 19:20   ` Andy Spiegl [this message]
2006-03-26 20:23     ` Peter Stephenson
2006-03-27  9:30       ` Andy Spiegl

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=20060326192054.GA27247@spiegl.de \
    --to=zsh.andy@spiegl.de \
    --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).