Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: configurability of pattern characters, part 1



On Sun, 02 Jun 2013 00:16:27 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Jun 1,  9:18pm, Peter Stephenson wrote:
> }
> } The simple meaning for enable -p is that it reverses a disable, it
> } doesn't explicitly enable something that's not allowed by the options.
> 
> Agreed.  In the other cases of disable, you have to create something a
> different way (function, alias) before you can disable/enable it, so
> I think that's fine here too.
> 
> I'm still not entirely clear what happens in e.g. this case:
> 
> % setopt kshglob
> % disable -p '+('
> % setopt kshglob
> 
> Does the setopt re-enable '+(' or does it remain disabled?

It remains disabled: that's a separate set of controls.

<  What about:
> 
> % setopt kshglob
> % disable -p '+('
> % unsetopt kshglob
> % setopt kshglob

It will stay disabled until you "enable -p '+('" or enter an emulation.
But if you enter a non-ksh emulation in which you "setopt kshglob" it
will pop up.

By the way, I suspect I need to do more work on the various expressions
with parentheses to make everything work smoothly.

> } "disable -p" should output the current settings, which we could save.
> 
> Explicit save/restore not necessary with the patch in 31444, right?

Yes, I'll just need to ensure LOCAL_PATTERNS is set with the other
completion options and use enable -p to ensure extendedglob patterns are
enabled.

> } Or how about readonly zsh/parameter arrays corresponding to enabled and
> } disabled patterns?  Same idea, just slightly more efficient to save.
> 
> I think it'd be fine to add these, though calling one of them $patterns
> is likely to clash with some existing scripts.  I'd vote for having it
> be readonly like $builtins and $reswords.  The writable zsh/parameter
> hashes are for objects that can be created/deleted by the user, but we
> are not allowing the user to create new pattern tokens.

It seems like I don't really have a use for these for now.

pws



Messages sorted by: Reverse Date, Date, Thread, Author