zsh-users
 help / color / mirror / code / Atom feed
From: John <jmharres@gmail.com>
To: zsh-users@zsh.org
Subject: Re: problem with zstyle file-patterns
Date: Tue, 05 Nov 2013 09:02:44 -0700	[thread overview]
Message-ID: <527916A4.6060705@gmail.com> (raw)
In-Reply-To: <131104233118.ZM17331@torch.brasslantern.com>

I still must be doing something wrong:

% zstyle ':completion:*:*:yes::' file-patterns '*XXX.*:files'
% yes <tab>
DIR1/    DIR2/  DIR3/     XXX-YYY.4      XXX.3

I've been using zsh for a rather long time, and it's possible I've got 
old, now-irrelevant settings.  I only found out about the new completion 
system in the past week, and am not sure what to change for that.

John


On 11/5/13, 12:31 AM, Bart Schaefer wrote:
> On Nov 4,  8:36pm, John wrote:
> }
> } I'm having an issue with file-patterns on zstyle:
> }
> } % zstyle ':completion:*:*:yes:files' file-patterns '*XXX.*'
>
> First problem is that this zstyle pattern is wrong.  The file-patterns
> style is looked up using the context ":completion::complete:yes::"
> which does not match ":completion:*:*:yes:files".
>
> Second problem is that even if the ":tag" part of the style were to
> be used, the tag "files" is not valid.
>
> The zle keybinding ctrl+x h (_complete_help) would have shown you this
> *if* you used it *before* you executed the above zstyle command:
>
> % yes <C-x h>
> tags in context :completion::complete:yes::
>      all-files  (_files _default)
>
> Once you run the above zstyle, you've [unintentionally] created a
> "files" tag, but that doesn't matter because the doc for file-patterns
> says:
>
>       The file-patterns style provides alternatives to the default tags,
>       which are not used.  Its value consists of elements of the form
>       `PATTERN:TAG'; each string may contain any number of such
>       specifications separated by spaces.
>
> Note that it says the default tags aren't used.  That's because you can
> use file-patterns to define what the tags are, so there can't yet be any
> tags at the time this zstyle is looked up.  That could be clearer (it
> should probably say that *no* tags are used).
>
> Try instead
>
>      zstyle ':completion:*:*:yes::' file-patterns '*XXX.*:files'


  reply	other threads:[~2013-11-05 16:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-05  3:36 John
2013-11-05  7:31 ` Bart Schaefer
2013-11-05 16:02   ` John [this message]
2013-11-05 16:09   ` John

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=527916A4.6060705@gmail.com \
    --to=jmharres@gmail.com \
    --cc=zsh-users@zsh.org \
    /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).