zsh-users
 help / color / mirror / code / Atom feed
* problem with zstyle file-patterns
@ 2013-11-05  3:36 John
  2013-11-05  7:31 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: John @ 2013-11-05  3:36 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 452 bytes --]

I'm having an issue with file-patterns on zstyle:

% zstyle ':completion:*:*:yes:files' file-patterns '*XXX.*'

(using "yes" as just an example)

Now when I do "yes XXX", I get:

% yes XXX<tab>
XXX-YYY.4 XXX.3

Why is it giving me XXX-YYY.4 as an option when it doesn't match the 
file-patterns, in that it doesn't have a dot after the XXX?

I've also tried 'XXX.*'and 'XXX\.*' and get the same results.

This is with zsh version 4.3.17...

TIA,
John


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: problem with zstyle file-patterns
  2013-11-05  3:36 problem with zstyle file-patterns John
@ 2013-11-05  7:31 ` Bart Schaefer
  2013-11-05 16:02   ` John
  2013-11-05 16:09   ` John
  0 siblings, 2 replies; 4+ messages in thread
From: Bart Schaefer @ 2013-11-05  7:31 UTC (permalink / raw)
  To: zsh-users

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'


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: problem with zstyle file-patterns
  2013-11-05  7:31 ` Bart Schaefer
@ 2013-11-05 16:02   ` John
  2013-11-05 16:09   ` John
  1 sibling, 0 replies; 4+ messages in thread
From: John @ 2013-11-05 16:02 UTC (permalink / raw)
  To: zsh-users

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'


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: problem with zstyle file-patterns
  2013-11-05  7:31 ` Bart Schaefer
  2013-11-05 16:02   ` John
@ 2013-11-05 16:09   ` John
  1 sibling, 0 replies; 4+ messages in thread
From: John @ 2013-11-05 16:09 UTC (permalink / raw)
  To: zsh-users

Argh, yes.  Not doing the compinit part was the problem.  All set now.  
Thanks!
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'


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-11-05 16:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-05  3:36 problem with zstyle file-patterns John
2013-11-05  7:31 ` Bart Schaefer
2013-11-05 16:02   ` John
2013-11-05 16:09   ` John

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).