zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: "Zsh Users' List" <zsh-users@sunsite.dk>
Subject: Re: Completing a unique prefix of "script" completes "script"
Date: Thu, 10 Aug 2006 22:41:58 +0100	[thread overview]
Message-ID: <200608102141.k7ALfw4J005496@pwslaptop.csr.com> (raw)
In-Reply-To: Message from "Nikolai Weibull" <now@bitwi.se>  of "Thu, 10 Aug 2006 22:17:30 +0200." <dbfc82860608101317t469b4f6eida99a1a390dc49c0@mail.gmail.com>

"Nikolai Weibull" wrote:
> Is there a way to make sure that both options, i.e., "script/" and
> "script ", are completed?

This is all rather frustrating, yet again...

Looks like you can get this with the combination of "setopt autocd" to
have local directories completed and "zstyle ':completion:*' group-name
''" to separate groups, so that it knows that it's ok to have both
matches for "script" separately.  I'm not sure why you would need
autocd---that looks like a bug, since you can execute commands by relative
paths anyway.

That's still not it, however, since you only get both if the completion
is otherwise ambiguous (i.e. script and script/ aren't sufficiently
different to show up separately).  Bizarrely, playing around suggests my
matcher-list is enough to make them appear "different":

zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[.,_-]=**r:|=**'

> Also, is there a way to ignore the command "script" found in $path?
> Using the ignored-patterns style doesn't work, of course.  And that's
> basically the only thing I
> was able to think of.

You should be able to do it with the tag-order style so that it prefers
the directory if it's found.  However, there's something a bit screwy
here, too.

zstyle :completion::complete:-command-:: tag-order local-directories

should prefer local directory completion to everything else, only
offering other stuff if there's no local directory (or if you explicitly
use _next_tags).  But that doesn't work; you get all possibilities
together.

Explicitly listing other possibilities in a second argument doesn't
work, either.

However, it's not completely broken since

zstyle :completion::complete:-command-:: tag-order local-directories -

does work; that gives you only local directories and nothing else.  So
for some reason as soon as you try to specify an order it's assuming you
don't want an order.

You can cheat and unhash the command if you never use it.  "unhash
script" did seem to do the trick.  Note, however, that a "rehash" will
bring it back.

That's about five things I don't understand.

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


  reply	other threads:[~2006-08-10 21:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <now@bitwi.se>
2006-08-10 20:17 ` Nikolai Weibull
2006-08-10 21:41   ` Peter Stephenson [this message]
2006-08-13 14:49     ` Nikolai Weibull
2006-08-14 12:12       ` Peter Stephenson
2006-08-14 22:36         ` Nikolai Weibull
2006-08-13 14:59     ` Nikolai Weibull
2006-08-13 16:34       ` Peter Stephenson
2006-08-13 17:01         ` Nikolai Weibull
2006-11-21 22:57 ` Problem with _arguments Nikolai Weibull
2006-11-21 23:42   ` Peter Stephenson
2006-11-22  8:35     ` Nikolai Weibull
2006-11-22 10:39       ` Peter Stephenson
2006-11-22 15:55         ` Bart Schaefer
2006-11-22 22:22           ` Nikolai Weibull
2006-11-24 20:56             ` Bart Schaefer
2006-11-22 21:31         ` Nikolai Weibull

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=200608102141.k7ALfw4J005496@pwslaptop.csr.com \
    --to=p.w.stephenson@ntlworld.com \
    --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).